aboutsummaryrefslogtreecommitdiffstats
path: root/support/make
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-08-05 13:27:13 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-08-05 13:27:13 -0400
commitd8830b1448809b84ed95047a90a6793d59527ca0 (patch)
tree019d860680b38b2e3ffc7c5f95b402a33fb31b22 /support/make
parent5b66935b6ec54d16b3536cf13d8fca53358d8777 (diff)
downloadlibrambutan-d8830b1448809b84ed95047a90a6793d59527ca0.tar.gz
librambutan-d8830b1448809b84ed95047a90a6793d59527ca0.zip
Add support for ARM's GCC ARM embedded toolchain.
Based on patches provided by Hanspeter Portner: http://forums.leaflabs.com/topic.php?id=1717#post-11812 Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'support/make')
-rw-r--r--support/make/build-rules.mk13
1 files changed, 13 insertions, 0 deletions
diff --git a/support/make/build-rules.mk b/support/make/build-rules.mk
index 3d541ba..d180c89 100644
--- a/support/make/build-rules.mk
+++ b/support/make/build-rules.mk
@@ -22,6 +22,8 @@ ifndef V
SILENT_OBJDUMP = @echo ' [OBJDUMP] ' $(OBJDUMP);
endif
+# Extra build configuration
+
BUILDDIRS :=
TGT_BIN :=
@@ -29,6 +31,17 @@ CFLAGS = $(GLOBAL_CFLAGS) $(TGT_CFLAGS)
CXXFLAGS = $(GLOBAL_CXXFLAGS) $(TGT_CXXFLAGS)
ASFLAGS = $(GLOBAL_ASFLAGS) $(TGT_ASFLAGS)
+# Hacks to determine extra libraries we need to link against based on
+# the toolchain. The default specifies no extra libraries, but it can
+# be overridden.
+LD_TOOLCHAIN_PATH := $(LDDIR)/toolchains/generic
+ifneq ($(findstring ARM/embedded,$(shell $(CC) --version)),)
+# GCC ARM Embedded, https://launchpad.net/gcc-arm-embedded/
+LD_TOOLCHAIN_PATH := $(LDDIR)/toolchains/gcc-arm-embedded
+endif
+# Add toolchain directory to LD search path
+TOOLCHAIN_LDFLAGS := -L $(LD_TOOLCHAIN_PATH)
+
# General directory independent build rules, generate dependency information
$(BUILD_PATH)/%.o: %.c
$(SILENT_CC) $(CC) $(CFLAGS) -MMD -MP -MF $(@:%.o=%.d) -MT $@ -o $@ -c $<