Newer
Older
CFLAGS := $(shell pkg-config --cflags glib-2.0) -std=gnu99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-attributes
LDFLAGS := $(shell pkg-config --libs glib-2.0)
CC := gcc
Dan Hirsch
committed
CFLAGS += -DINCLUDE_TESTS $(EXTRA_CFLAGS)
HUSH = $(TOPLEVEL)/lib/hush
# Check to make sure variables are properly set
ifeq ($(TOPLEVEL),)
$(error $$TOPLEVEL is unset)
endif
ifsilent = $(if $(findstring 0, $(V)),$(1),)
hush = $(call ifsilent,$(HUSH) $(1))
.DEFAULT_GOAL:=all
%.a: $(call ifsilent,| $(HUSH))
$(call hush,"Archiving $@") ar cr $@ $^
%.o: %.c $(call ifsilent,| $(HUSH))
$(call hush, "Compiling $<") $(CC) $(CFLAGS) -c -o $@ $<
clean:
-rm -f $(OUTPUTS)
make -C $(TOPLEVEL)/lib hush