summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2013-01-16 22:47:36 +0100
committerSylvain Munaut <tnt@246tNt.com>2013-01-16 22:47:36 +0100
commitf82a4854428a0e3f99ec35fc7c087b5b4254a5d5 (patch)
treec6a2dcb263c34c79c8fecfedfb33e330421f7ecf
parentdf1c62c31a8d6e0bf1719d77da74d229669e08c4 (diff)
build: Use a template system for the various host apps
This also now allows to pass specific configure arguments to each host application Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--src/Makefile44
1 files changed, 12 insertions, 32 deletions
diff --git a/src/Makefile b/src/Makefile
index a145880d..af0a68a4 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -33,43 +33,23 @@ shared/libosmocore/build-target/src/.libs/libosmocore.a: shared/libosmocore/buil
cd shared/libosmocore/build-target && make
-.PHONY: osmocon
-osmocon: host/osmocon/osmocon
+HOST_APPS=osmocon gsmmap layer23
-host/osmocon/configure: host/osmocon/configure.ac
- cd host/osmocon && autoreconf -i
+define HOST_APP_template
+.PHONY: $(1)
-host/osmocon/Makefile: host/osmocon/configure
- cd host/osmocon && ./configure $(HOST_CONFARGS)
+host/$(1)/configure: host/$(1)/configure.ac
+ cd host/$(1) && autoreconf -i
-host/osmocon/osmocon: host/osmocon/Makefile
- make -C host/osmocon
+host/$(1)/Makefile: host/$(1)/configure
+ cd host/$(1) && ./configure $(HOST_CONFARGS) $$(HOST_$(1)_CONFARGS)
+$(1): host/$(1)/Makefile
+ make -C host/$(1)
+endef
-.PHONY: gsmmap
-gsmmap: host/gsmmap/gsmmap
-
-host/gsmmap/configure: host/gsmmap/configure.ac
- cd host/gsmmap && autoreconf -i
-
-host/gsmmap/Makefile: host/gsmmap/configure
- cd host/gsmmap && ./configure $(HOST_CONFARGS)
-
-host/gsmmap/gsmmap: host/gsmmap/Makefile
- make -C host/gsmmap
-
-
-.PHONY: layer23
-layer23: host/layer23/layer23
-
-host/layer23/configure: host/layer23/configure.ac
- cd host/layer23 && autoreconf -i
-
-host/layer23/Makefile: host/layer23/configure
- cd host/layer23 && ./configure $(HOST_CONFARGS)
-
-host/layer23/layer23: host/layer23/Makefile
- make -C host/layer23
+$(foreach app,$(HOST_APPS), \
+ $(eval $(call HOST_APP_template,$(app))))
.PHONY: firmware