diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3e20c8c --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +PROG = hashtbl +OBJS = $(PROG).o hashfuncs.o +CC = gcc +DBGFLAGS = -g -O0 +ifdef DEBUG + CFLAGS = $(DBGFLAGS) -Wall -std=c99 +else + CFLAGS = -Wall -std=c99 -O2 -march=native -mtune=native +endif +LDFLAGS = -lm + +$(PROG): $(OBJS) + $(CC) $(LDFLAGS) $(OBJS) -o $(PROG) + +$(PROG).o: $(PROG).c hashtbl.h hashfuncs.h + $(CC) -c $(CFLAGS) $(PROG).c + +hashfuncs.o: hashfuncs.c hashfuncs.h + $(CC) -c $(CFLAGS) hashfuncs.c + +.PHONY: clean + +clean: + rm -f *.o ./$(PROG) |