diff options
-rw-r--r-- | Makefile | 14 | ||||
-rw-r--r-- | config.mk | 21 |
2 files changed, 21 insertions, 14 deletions
@@ -3,6 +3,7 @@ include config.mk -include $(DEPS) all: $(TARGET) +debug: $(DTARGET) options: @echo "$(PROJECT) build options:" @@ -12,16 +13,23 @@ options: @echo "CC = $(CC)" src/hints.o: src/hints.js.h +src/hints.do: src/hints.js.h + src/hints.js.h: src/hints.js @echo "minify $<" @cat $< | src/js2h.sh > $@ $(OBJ): src/config.h config.mk +$(DOBJ): src/config.h config.mk $(TARGET): $(OBJ) @echo "$(CC) $@" @$(CC) $(OBJ) -o $(TARGET) $(LDFLAGS) +$(DTARGET): $(DOBJ) + @echo "$(CC) $@" + @$(CC) $(DFLAGS) $(DOBJ) -o $(DTARGET) $(DLDFLAGS) + src/config.h: @echo create $@ from src/config.def.h @cp src/config.def.h $@ @@ -30,12 +38,6 @@ src/config.h: @echo "${CC} $<" @$(CC) -c -o $@ $< $(CFLAGS) -debug: $(DTARGET) - -$(DTARGET): $(DOBJ) - @echo "$(CC) $@" - @$(CC) $(DFLAGS) $(DOBJ) -o $(DTARGET) $(LDFLAGS) - %.do: %.c %.h @echo "${CC} $<" @$(CC) -c -o $@ $< $(DFLAGS) @@ -30,14 +30,19 @@ ifeq ($(USEGTK3), 1) CPPFLAGS += -DHAS_GTK3 endif -CFLAGS += $(shell pkg-config --cflags $(LIBS)) -CFLAGS += -Wall -pipe -ansi -std=c99 -pedantic -CFLAGS += -Wmissing-declarations -Wmissing-parameter-type -Wno-overlength-strings -CFLAGS += ${CPPFLAGS} - -LDFLAGS += $(shell pkg-config --libs $(LIBS)) -lX11 -lXext -lm - -DFLAGS += $(CFLAGS) -DDEBUG -ggdb -g +# prepare the lib flags used for the linker +LIBFLAGS = $(shell pkg-config --libs $(LIBS)) -lX11 -lXext -lm + +# normal compiler flags +CFLAGS += $(shell pkg-config --cflags $(LIBS)) +CFLAGS += -Wall -pipe -ansi -std=c99 -pedantic +CFLAGS += -Wmissing-declarations -Wmissing-parameter-type -Wno-overlength-strings +CFLAGS += ${CPPFLAGS} +LDFLAGS += -s ${LIBFLAGS} + +# compiler flags for the debug target +DFLAGS += $(CFLAGS) -DDEBUG -ggdb -g +DLDFLAGS += ${LIBFLAGS} OBJ = $(patsubst %.c, %.o, $(wildcard src/*.c)) DOBJ = $(patsubst %.c, %.do, $(wildcard src/*.c)) |