summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 29 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index d768151..4ee0a88 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,32 @@
-CXXFLAGS += -std=c++20
-LDFLAGS += -lcommon -linstructionAPI -lparseAPI # dyninst
+CXXFLAGS += -g -std=c++23 -Wextra -Werror
+LDFLAGS += -lcommon -ldyninstAPI -linstructionAPI -lparseAPI # dyninst
+PREFIX ?= /usr/local
 
-.PHONY: all clean
-all: taosc
+BIN := fix scout synth
+BIN_PREFIX := $(DESTDIR)$(PREFIX)/bin/taosc-
+DATA := collect patch
+DATA_DIR := $(DESTDIR)$(PREFIX)/share/taosc
+
+.PHONY: all clean install
+
+all: $(BIN) $(DATA)
 
 clean:
-	rm taosc
+	rm -f $(BIN) $(DATA)
+
+fix: fix.m4
+	m4 -D DATA_DIR=${DATA_DIR} $< > $@
+
+collect: collect.c
+	e9compile $<
+
+patch: patch.c
+	e9compile $<
+
+install: $(addprefix $(BIN_PREFIX),$(BIN)) $(addprefix $(DATA_DIR)/,$(DATA))
+
+$(BIN_PREFIX)%: %
+	install -Dm 755 $< $@
+
+$(DATA_DIR)/%: %
+	install -Dm 644 $< $@