hammer/Makefile

28 lines
546 B
Makefile
Raw 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"
2012-05-12 21:20:38 +01:00
SUBDIRS = src
2012-04-30 23:35:11 +01:00
.DEFAULT_GOAL := all
%:
+for dir in $(SUBDIRS); do $(MAKE) -C $${dir} $@; done
test: src/test_suite
$<
2012-04-30 23:35:11 +01:00
define SUBDIR_TEMPLATE
$(1)/%:
$$(MAKE) -C $(1) $$*
endef
$(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: $(shell find * -name "*.c")
etags $^