diff --git a/src/Makefile b/src/Makefile index 83a51ec3..ada25920 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,20 +2,23 @@ CC = clang LD = clang DB = lldb -CFLAGS = -I ../include -g +CFLAGS_COMMON = -I ../include -Wall -Wextra +CFLAGS = $(CFLAGS_COMMON) OBJ = main.o parse.o endian.o write.o BUILD = ../build -all: clean jas +all: clean jas debug +jas: CFLAGS = $(CFLAGS_COMMON) jas: $(OBJ) $(LD) $^ -o $(BUILD)/$@ -# TODO: fix this ugly hack! -debug: clean jas $(OBJ) - $(DB) $(BUILD)/jas +debug: CFLAGS = $(CFLAGS_COMMON) -g +debug: clean $(OBJ) + $(LD) $(wordlist 2,$(words $^),$^) -o $(BUILD)/$@ + $(DB) $(BUILD)/debug clean: rm -r -f *.o $(BUILD) - mkdir -p $(BUILD) \ No newline at end of file + mkdir -p $(BUILD)