hammer/Makefile

45 lines
862 B
Makefile
Raw Permalink Normal View History

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"
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
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
$(1)/%: force
$(MAKE) -C $(1) $$*
2012-04-30 23:35:11 +01:00
endef
force:
2012-04-30 23:35:11 +01:00
$(foreach dir,$(SUBDIRS),$(eval $(call SUBDIR_TEMPLATE,$(dir))))
#.DEFAULT:
# $(if $(findstring ./,$(dir $@)),$(error No rule to make target `$@'),$(MAKE) -C $(dir $@) $(notdir $@))
2012-05-12 01:28:16 +01: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)) )