summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 18 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 4ee0a88..92cefaf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,15 @@
+.POSIX:
+.PHONY: all clean install uninstall
+
 CXXFLAGS += -g -std=c++23 -Wextra -Werror
-LDFLAGS += -lcommon -ldyninstAPI -linstructionAPI -lparseAPI # dyninst
-PREFIX ?= /usr/local
+LDLIBS += -lcommon -ldyninstAPI -linstructionAPI -lparseAPI # dyninst
 
-BIN := fix scout synth
-BIN_PREFIX := $(DESTDIR)$(PREFIX)/bin/taosc-
-DATA := collect patch
-DATA_DIR := $(DESTDIR)$(PREFIX)/share/taosc
+PREFIX ?= /usr/local
+BIN_PREFIX ::= $(DESTDIR)$(PREFIX)/bin/taosc-
+DATA_DIR ::= $(DESTDIR)$(PREFIX)/share/taosc
 
-.PHONY: all clean install
+BIN ::= fix scout synth
+DATA ::= collect patch
 
 all: $(BIN) $(DATA)
 
@@ -15,7 +17,10 @@ clean:
 	rm -f $(BIN) $(DATA)
 
 fix: fix.m4
-	m4 -D DATA_DIR=${DATA_DIR} $< > $@
+	m4 -D DATA_DIR=$(DATA_DIR) $< > $@
+
+synth: synth.py
+	link $< $@
 
 collect: collect.c
 	e9compile $<
@@ -23,10 +28,14 @@ collect: collect.c
 patch: patch.c
 	e9compile $<
 
-install: $(addprefix $(BIN_PREFIX),$(BIN)) $(addprefix $(DATA_DIR)/,$(DATA))
+install: $(BIN:%=$(BIN_PREFIX)%) $(DATA:%=$(DATA_DIR)/%)
 
 $(BIN_PREFIX)%: %
 	install -Dm 755 $< $@
 
 $(DATA_DIR)/%: %
 	install -Dm 644 $< $@
+
+uninstall:
+	rm -f $(BIN:%=$(BIN_PREFIX)%) $(DATA:%=$(DATA_DIR)/%)
+	rmdir $(DATA_DIR)