From fe0c58e5fbaa37668779ec10d2761e6657b824f4 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Mon, 9 Sep 2024 22:58:51 +0200 Subject: initial commit of libbt --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bd97388 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +all: $(patsubst example/%.c, out/%, $(wildcard example/*.c)) +all: $(patsubst example/%.c, run/%, $(wildcard example/*.c)) + +CFLAGS := -Wall -Wextra -g -O2 +CFLAGS_recurse2 := -lpthread + +run/%: + LD_PRELOAD=$(PWD)/libbt.so out/$* || test $$? -eq 42 && exit 0 + +out/%: example/%.c libbt.so + @mkdir -p out + $(CC) -o $@ $< -rdynamic $(FLAGS) $(CFLAGS_$*) + +libbt.so: bt.c + $(CC) -o $@ $^ -shared -fPIC -static-libgcc -ldl $(FLAGS) + +clean: + $(RM) -r out + $(RM) libbt.so -- cgit v1.2.3