From 5468f737e1eb021f8a69fe3ba559c43aa22d1455 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Tue, 19 Nov 2024 11:41:45 +0900 Subject: Polish a tad --- Makefile | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'Makefile') 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) -- cgit 1.4.1