blob: be4cf0abde53905a43029cd00afd802afe72b6aa (
plain) (
tree)
|
|
all: $(patsubst example/%.c, out/%, $(wildcard example/*.c))
all: $(patsubst example/%.c, run/%, $(wildcard example/*.c))
CFLAGS := -Wall -Wextra -g
CFLAGS_recurse1 := -Wno-infinite-recursion
CFLAGS_recurse2 := -lpthread -Wno-infinite-recursion
run/%:
LD_PRELOAD=$(PWD)/libbt.so out/$* || test $$? -eq 42 && exit 0
out/%: example/%.c libbt.so
@mkdir -p out
$(CC) -o $@ $< -rdynamic $(CFLAGS) $(CFLAGS_$*)
libbt.so: bt.c
$(CC) -o $@ $^ -shared -fPIC -static-libgcc -ldl $(CFLAGS)
clean:
$(RM) -r out
$(RM) libbt.so
|