2013-11-25 11:50:35 +02:00
|
|
|
default: all
|
|
|
|
|
|
|
|
|
|
|
|
# Include Autoconf variables.
|
2013-11-25 12:16:07 +02:00
|
|
|
template_files += Makefile.config
|
2013-11-25 11:50:35 +02:00
|
|
|
include Makefile.config
|
|
|
|
|
|
|
|
|
|
|
|
# Initialise some variables.
|
|
|
|
QUIET = @
|
|
|
|
|
|
|
|
|
|
|
|
# Pass -fPIC if we're building dynamic libraries.
|
|
|
|
ifeq ($(BUILD_SHARED_LIBS), 1)
|
|
|
|
GLOBAL_CFLAGS += -fPIC
|
|
|
|
GLOBAL_CXXFLAGS += -fPIC
|
|
|
|
GLOBAL_LDFLAGS += -Wl,--no-copy-dt-needed-entries
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
# Pass -g if we want debug info.
|
|
|
|
ifeq ($(BUILD_DEBUG), 1)
|
|
|
|
GLOBAL_CFLAGS += -g
|
|
|
|
GLOBAL_CXXFLAGS += -g
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
include mk/clean.mk
|
|
|
|
include mk/dist.mk
|
|
|
|
include mk/install.mk
|
|
|
|
include mk/libraries.mk
|
|
|
|
include mk/programs.mk
|
|
|
|
include mk/patterns.mk
|
2013-11-25 12:16:07 +02:00
|
|
|
include mk/templates.mk
|
2013-11-25 11:50:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Include all sub-Makefiles.
|
|
|
|
define include-sub-makefile =
|
|
|
|
d := $$(patsubst %/, %, $$(dir $(1)))
|
|
|
|
include $(1)
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach mf, $(SUBS), $(eval $(call include-sub-makefile, $(mf))))
|
|
|
|
|
|
|
|
|
2013-11-25 12:16:07 +02:00
|
|
|
# Instantiate stuff.
|
2013-11-25 11:50:35 +02:00
|
|
|
$(foreach lib, $(LIBS), $(eval $(call build-library,$(lib))))
|
|
|
|
$(foreach prog, $(PROGRAMS), $(eval $(call build-program,$(prog))))
|
2013-11-25 12:16:07 +02:00
|
|
|
$(foreach template, $(template_files), $(eval $(call instantiate-template,$(template))))
|
2013-11-25 11:50:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
all: $(programs_list)
|