Commit 4bbe2cde9ca4829424556f7d9eb04d1aabf516f6

Steffen Jaeckel 2019-10-15T10:42:48

fix build of demos

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/makefile b/makefile
index cc7f922..de65c9c 100644
--- a/makefile
+++ b/makefile
@@ -98,8 +98,14 @@ uninstall:
 test_standalone: test
 	@echo "test_standalone is deprecated, please use make-target 'test'"
 
-test mtest_opponent: demo/shared.o $(LIBNAME) | demo/test.o demo/mtest_opponent.o
-	$(CC) $(LTM_CFLAGS) $(LTM_LFLAGS) demo/$@.o $^ -o $@
+DEMOS=test mtest_opponent
+
+define DEMO_template
+$(1): demo/$(1).o demo/shared.o $$(LIBNAME)
+	$$(CC) $$(LTM_CFLAGS) $$(LTM_LFLAGS) $$^ -o $$@
+endef
+
+$(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo))))
 
 .PHONY: mtest
 mtest: