diff options
author | flu0r1ne <flu0r1ne@flu0r1ne.net> | 2022-10-31 05:42:30 -0500 |
---|---|---|
committer | flu0r1ne <flu0r1ne@flu0r1ne.net> | 2022-10-31 05:42:30 -0500 |
commit | b164ac63745e307bfef009400fc3191a27f7c96c (patch) | |
tree | 61795b4d6b5e623500311585b526a75d5157ca17 /makefile | |
parent | 20e52f326cdf1b6c2ca9b2c0b5be07637d9196d2 (diff) | |
download | qidx-b164ac63745e307bfef009400fc3191a27f7c96c.tar.xz qidx-b164ac63745e307bfef009400fc3191a27f7c96c.zip |
restructure library
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 43 |
1 files changed, 40 insertions, 3 deletions
@@ -1,3 +1,40 @@ -main: - gcc main.c ./util/hash.c ./util/prime_search.c -lhts -lm ./util/sds/sds.c ./util/err.c -g -o qidx -fsanitize=address -.PHONY: main +ifeq ($(PREFIX),) + PREFIX := /usr/local +endif + +ifeq ($(BINDIR),) + BINDIR := /bin +endif + +CMD=qidx + +CC=gcc + +DEBUG := -fsanitize=address -O2 + +CFLAGS := -Wall -pedantic -g +LDFLAGS := -lhts -lm + +SRC_EXT:=%.c + +_STD_BUILD=$(CC) $(CFLAGS) $(filter $(SRC_EXT) %.o, $^) -o $@ +STD_BUILD=$(_STD_BUILD) $(LDFLAGS) +STD_COMPILE=$(_STD_BUILD) -c + +OBJS = ./util/hash.o +OBJS += ./util/prime_search.o +OBJS += ./util/prime_search.o +OBJS += ./util/sds/sds.o +OBJS += ./util/err.o +OBJS += ./qidx.o + +make: $(CMD) + +$(CMD): ./main.c $(OBJS) + $(STD_BUILD) + +clean: + $(RM) $(CMD) $(OBJS) + +%.o: %.c + $(STD_COMPILE) |