Cleaned up makefiles a bit, fixed all the warnings in hammer.c

This commit is contained in:
Dan Hirsch 2012-05-01 02:05:58 +01:00
commit 5f26455924
4 changed files with 232 additions and 29 deletions

View file

@ -1,4 +1,4 @@
CFLAGS := $(shell pkg-config --cflags glib-2.0) -std=gnu99 -Wall -Wextra -Werror
CFLAGS := $(shell pkg-config --cflags glib-2.0) -std=gnu99 -Wall -Wextra -Werror -Wno-unused-parameter
LDFLAGS := $(shell pkg-config --libs glib-2.0)
CC := gcc
# Set V=1 for verbose mode...
@ -11,6 +11,8 @@ ifeq ($(TOPLEVEL),)
$(error $$TOPLEVEL is unset)
endif
ifsilent = $(if $(findstring 0, $(V)),$(1),)
hush = $(call ifsilent,$(HUSH) $(1))
#.SUFFIXES:
ifeq ($(V),0)
@ -19,21 +21,16 @@ endif
.DEFAULT_GOAL:=all
%.a: | $(HUSH)
%.a: $(call ifsilent,| $(HUSH))
-rm -f $@
$(if $(findstr 0,$(V)),$(HUSH) "Archiving $@",) ar cr $@ $^
$(call hush,"Archiving $@") ar cr $@ $^
ifeq ($(V),0)
# silent mode
%.o: %.c | $(HUSH)
$(HUSH) "Compiling $<" $(CC) $(CFLAGS) -c -o $@ $<
else
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
endif
%.o: %.c $(call ifsilent,| $(HUSH))
$(call hush, "Compiling $<") $(CC) $(CFLAGS) -c -o $@ $<
clean:
-rm -f $(OUTPUTS)
$(TOPLEVEL)/lib/hush: $(TOPLEVEL)/lib/hush.c
make -C $(TOPLEVEL)/lib hush
make -C $(TOPLEVEL)/lib hush