2013-07-10 21:32:05 +02:00
|
|
|
ifneq ($(REALLY_USE_OBSOLETE_BUILD_SYSTEM),yes)
|
|
|
|
|
$(error This is the old build system. Use "scons" to build, or use $(MAKE) REALLY_USE_OBSOLETE_BUILD_SYSTEM=yes)
|
|
|
|
|
endif
|
|
|
|
|
|
2012-10-10 16:45:10 +02:00
|
|
|
# Check to make sure variables are properly set
|
|
|
|
|
ifeq ($(TOPLEVEL),)
|
|
|
|
|
$(error $$TOPLEVEL is unset)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
include $(TOPLEVEL)/config.mk
|
|
|
|
|
|
2012-11-13 22:29:25 -05:00
|
|
|
TEST_CFLAGS = $(shell pkg-config --cflags glib-2.0) -DINCLUDE_TESTS
|
2013-05-23 23:26:22 +02:00
|
|
|
TEST_LDFLAGS = $(shell pkg-config --libs glib-2.0) -lrt -ldl
|
2012-10-10 16:45:10 +02:00
|
|
|
|
2013-05-10 12:05:20 +02:00
|
|
|
CFLAGS := -std=gnu99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-attributes -g
|
2012-10-10 16:45:10 +02:00
|
|
|
LDFLAGS :=
|
|
|
|
|
|
2012-05-26 14:36:36 +02:00
|
|
|
CC ?= gcc
|
|
|
|
|
$(info CC=$(CC))
|
2012-04-30 23:35:11 +01:00
|
|
|
# Set V=1 for verbose mode...
|
2012-05-26 14:36:36 +02:00
|
|
|
V ?= 0
|
2012-10-10 16:45:10 +02:00
|
|
|
CFLAGS += $(EXTRA_CFLAGS)
|
2012-04-30 23:35:11 +01:00
|
|
|
HUSH = $(TOPLEVEL)/lib/hush
|
|
|
|
|
|
|
|
|
|
|
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
|