aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-06-14 23:43:48 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-06-14 23:43:48 -0400
commit7ac498c2a2ad00e0a9c850f22a1012a9a3240fb7 (patch)
tree24d8e5a044bb755918f93dacd98b49c46b2188af /Makefile
parent41b94bf5e29d0cf13b22c9fc09061e050474eaf5 (diff)
downloadlibrambutan-7ac498c2a2ad00e0a9c850f22a1012a9a3240fb7.tar.gz
librambutan-7ac498c2a2ad00e0a9c850f22a1012a9a3240fb7.zip
Tweak build system to allow out-of-tree projects.
It's very annoying to have to build libmaple projects in-tree. Users are just copying the repository everywhere. That's stupid. So I made this: https://github.com/mbolivar/example-libmaple-project It needs these patches to work. Add a header and footer for rules.mk files, so we can change them around and things will continue to work for the users, who just include them. In Makefile, add USER_MODULES to LIBMAPLE_MODULES if it's nonempty. This is the hook you use to get your code compiled and linked correctly. Hack build-targets.mk for stupid reasons I hope to fix later. For now, you'll need an empty main.cpp in BOTH the libmaple directory and your directory if you want things to work the way you'd expect. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 6 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 45b34da..e2ca0e0 100644
--- a/Makefile
+++ b/Makefile
@@ -67,12 +67,7 @@ include $(SUPPORT_PATH)/make/build-templates.mk
## Set all submodules here
##
-# Try to keep LIBMAPLE_MODULES a simply-expanded variable
-ifeq ($(LIBMAPLE_MODULES),)
- LIBMAPLE_MODULES := $(SRCROOT)/libmaple
-else
- LIBMAPLE_MODULES += $(SRCROOT)/libmaple
-endif
+LIBMAPLE_MODULES += $(SRCROOT)/libmaple
LIBMAPLE_MODULES += $(LIBMAPLE_MODULE_FAMILY) # family submodule in libmaple
LIBMAPLE_MODULES += $(SRCROOT)/wirish
# Official libraries:
@@ -83,6 +78,11 @@ LIBMAPLE_MODULES += $(SRCROOT)/libraries/Wire
# Experimental libraries:
LIBMAPLE_MODULES += $(SRCROOT)/libraries/FreeRTOS
+# User modules:
+ifneq ($(USER_MODULES),)
+LIBMAPLE_MODULES += $(USER_MODULES)
+endif
+
# Call each module's rules.mk:
$(foreach m,$(LIBMAPLE_MODULES),$(eval $(call LIBMAPLE_MODULE_template,$(m))))