diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2022-10-31 05:42:30 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2022-10-31 05:42:30 -0500 |
| commit | 58caeb36fa461d680d370dfba084f3800b645d6d (patch) | |
| tree | 61795b4d6b5e623500311585b526a75d5157ca17 /makefile | |
| parent | 6cdf07fb786c4c0a882cb7fde07e17a693941eaf (diff) | |
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) |
