2012-04-30 23:35:11 +01:00
|
|
|
# Most of this is so that you can do
|
|
|
|
|
# $ make all
|
|
|
|
|
# and kick off a recursive make
|
|
|
|
|
# Also, "make src/all" turns into "make -C src all"
|
|
|
|
|
|
2013-05-10 12:05:20 +02:00
|
|
|
SUBDIRS = src examples jni
|
2012-04-30 23:35:11 +01:00
|
|
|
|
2012-10-10 16:45:10 +02:00
|
|
|
include config.mk
|
2013-07-10 21:32:05 +02:00
|
|
|
TOPLEVEL=.
|
|
|
|
|
include common.mk
|
2012-10-10 16:45:10 +02:00
|
|
|
|
|
|
|
|
CONFIG_VARS= INCLUDE_TESTS
|
|
|
|
|
|
2012-04-30 23:35:11 +01:00
|
|
|
.DEFAULT_GOAL := all
|
|
|
|
|
|
2013-05-23 23:26:22 +02:00
|
|
|
nojni: all
|
|
|
|
|
nojni: SUBDIRS:=$(filter-out jni,$(SUBDIRS))
|
|
|
|
|
|
|
|
|
|
all clean:
|
2012-04-30 23:35:11 +01:00
|
|
|
+for dir in $(SUBDIRS); do $(MAKE) -C $${dir} $@; done
|
|
|
|
|
|
2012-05-04 21:23:56 +01:00
|
|
|
test: src/test_suite
|
|
|
|
|
$<
|
|
|
|
|
|
2013-04-26 20:36:54 -07:00
|
|
|
examples/all: src/all
|
|
|
|
|
examples/compile: src/compile
|
|
|
|
|
|
2012-04-30 23:35:11 +01:00
|
|
|
define SUBDIR_TEMPLATE
|
2013-05-25 03:35:42 +02:00
|
|
|
$(1)/%: force
|
|
|
|
|
$(MAKE) -C $(1) $$*
|
2012-04-30 23:35:11 +01:00
|
|
|
endef
|
|
|
|
|
|
2013-05-25 03:35:42 +02:00
|
|
|
force:
|
|
|
|
|
|
2012-04-30 23:35:11 +01:00
|
|
|
$(foreach dir,$(SUBDIRS),$(eval $(call SUBDIR_TEMPLATE,$(dir))))
|
|
|
|
|
|
|
|
|
|
#.DEFAULT:
|
2012-05-04 21:23:56 +01:00
|
|
|
# $(if $(findstring ./,$(dir $@)),$(error No rule to make target `$@'),$(MAKE) -C $(dir $@) $(notdir $@))
|
2012-05-12 01:28:16 +01:00
|
|
|
|
2013-05-25 03:35:42 +02:00
|
|
|
TAGS: force
|
|
|
|
|
etags $(shell find * -name "*.c" -o -name "*.h")
|
2012-10-10 16:45:10 +02:00
|
|
|
|
|
|
|
|
config:
|
|
|
|
|
@printf "%30s %s\n" $(foreach var,$(CONFIG_VARS),$(var) $($(var)) )
|