2012-05-01 02:05:58 +01:00
|
|
|
CFLAGS := $(shell pkg-config --cflags glib-2.0) -std=gnu99 -Wall -Wextra -Werror -Wno-unused-parameter
|
2012-04-29 01:45:52 +01:00
|
|
|
LDFLAGS := $(shell pkg-config --libs glib-2.0)
|
|
|
|
|
CC := gcc
|
2012-04-30 23:35:11 +01:00
|
|
|
# Set V=1 for verbose mode...
|
|
|
|
|
V := 0
|
2012-04-29 01:45:52 +01:00
|
|
|
CFLAGS += -DINCLUDE_TESTS
|
2012-04-30 23:35:11 +01:00
|
|
|
HUSH = $(TOPLEVEL)/lib/hush
|
|
|
|
|
|
|
|
|
|
# Check to make sure variables are properly set
|
|
|
|
|
ifeq ($(TOPLEVEL),)
|
|
|
|
|
$(error $$TOPLEVEL is unset)
|
|
|
|
|
endif
|
|
|
|
|
|
2012-05-01 02:05:58 +01:00
|
|
|
ifsilent = $(if $(findstring 0, $(V)),$(1),)
|
|
|
|
|
hush = $(call ifsilent,$(HUSH) $(1))
|
2012-04-30 23:35:11 +01:00
|
|
|
#.SUFFIXES:
|
2012-04-29 01:45:52 +01:00
|
|
|
|
2012-04-30 23:35:11 +01:00
|
|
|
ifeq ($(V),0)
|
|
|
|
|
.SILENT:
|
|
|
|
|
endif
|
2012-04-29 01:45:52 +01:00
|
|
|
|
2012-04-30 02:32:32 +01:00
|
|
|
.DEFAULT_GOAL:=all
|
|
|
|
|
|
2012-05-01 02:05:58 +01:00
|
|
|
%.a: $(call ifsilent,| $(HUSH))
|
2012-04-29 01:45:52 +01:00
|
|
|
-rm -f $@
|
2012-05-01 02:05:58 +01:00
|
|
|
$(call hush,"Archiving $@") ar cr $@ $^
|
2012-04-29 01:45:52 +01:00
|
|
|
|
2012-04-30 23:35:11 +01:00
|
|
|
|
2012-05-01 02:05:58 +01:00
|
|
|
%.o: %.c $(call ifsilent,| $(HUSH))
|
|
|
|
|
$(call hush, "Compiling $<") $(CC) $(CFLAGS) -c -o $@ $<
|
2012-04-30 02:20:49 +01:00
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
-rm -f $(OUTPUTS)
|
2012-04-30 23:35:11 +01:00
|
|
|
|
|
|
|
|
$(TOPLEVEL)/lib/hush: $(TOPLEVEL)/lib/hush.c
|
2012-05-01 02:05:58 +01:00
|
|
|
make -C $(TOPLEVEL)/lib hush
|