Skip to content
Snippets Groups Projects
Makefile 875 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"

SUBDIRS = src examples src/bindings/jni
Dan Hirsch's avatar
Dan Hirsch committed

Dan Hirsch's avatar
Dan Hirsch committed
include config.mk
Dan Hirsch's avatar
Dan Hirsch committed
TOPLEVEL=.
include common.mk
Dan Hirsch's avatar
Dan Hirsch committed

CONFIG_VARS= INCLUDE_TESTS

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

nojni: all
nojni: SUBDIRS:=$(filter-out jni,$(SUBDIRS))

all clean:
Dan Hirsch's avatar
Dan Hirsch committed
	+for dir in $(SUBDIRS); do $(MAKE) -C $${dir} $@; done

test: src/test_suite
	$<

Dan Hirsch's avatar
Dan Hirsch committed
examples/all: src/all
examples/compile: src/compile

Dan Hirsch's avatar
Dan Hirsch committed
define SUBDIR_TEMPLATE
Dan Hirsch's avatar
Dan Hirsch committed
endef

Dan Hirsch's avatar
Dan Hirsch committed
$(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: force
	etags $(shell find * -name "*.c" -o -name "*.h")
Dan Hirsch's avatar
Dan Hirsch committed

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