--- ./Makefile	2023-10-25 23:33:14
+++ ./Makefile	2023-10-25 23:34:37
@@ -6,6 +6,9 @@
 CC          = gcc
 MKDIR       = mkdir
 LFLAGS      =
+PREFIX      ?= /opt/local
+BINDIR      ?= $(PREFIX)/bin
+DESTDIR     ?=
 
 INCPATH     = src default
 SRCPATH     = src default
@@ -22,12 +24,7 @@
     PYTHON    ?= python # only for windows and need python3
     COC       := $(PYTHON) $(COC)
 else
-    CFLAGS    += -DUSE_READLINE_LIB
-    LIBS      += -lreadline -ldl
     OS        := $(shell uname)
-    ifeq ($(OS), Linux)
-        LFLAGS += -Wl,--export-dynamic
-    endif
 endif
 
 ifneq ($(V), 1)
@@ -78,10 +75,10 @@
 	$(Q) $(MKDIR) $(GENERATE)
 
 install:
-	cp $(TARGET) /usr/local/bin
+	cp $(TARGET) $(DESTDIR)$(BINDIR)
 
 uninstall:
-	$(RM) /usr/local/bin/$(TARGET)
+	$(RM) $(BINDIR)$(TARGET)
 
 prebuild: $(GENERATE)
 	$(MSG) [Prebuild] generate resources
