Skip to content
Snippets Groups Projects
Makefile 680 B
Newer Older
Dan Hirsch's avatar
Dan Hirsch committed
# 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"

Dan Hirsch's avatar
Dan Hirsch committed

Dan Hirsch's avatar
Dan Hirsch committed
include config.mk

CONFIG_VARS= INCLUDE_TESTS

Dan Hirsch's avatar
Dan Hirsch committed
.DEFAULT_GOAL := all

%:
	+for dir in $(SUBDIRS); do $(MAKE) -C $${dir} $@; done

test: src/test_suite
	$<

Dan Hirsch's avatar
Dan Hirsch committed
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 $@))
Dan Hirsch's avatar
Dan Hirsch committed

TAGS: $(shell find * -name "*.c")
	etags $^
Dan Hirsch's avatar
Dan Hirsch committed

config:
	@printf "%30s %s\n" $(foreach var,$(CONFIG_VARS),$(var) $($(var)) )