summaryrefslogtreecommitdiffstats
path: root/purgatory
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2006-10-06 12:27:58 +0900
committerSimon Horman <horms@verge.net.au>2006-10-06 12:46:16 +0900
commitba686313d496ee25db69803ef7e5bfb1e07eb841 (patch)
tree91ba8a16a03ed3710c16a01c9cf413d57983c371 /purgatory
parent103c946e39eb9dd57ccbda20ac12ccb01f883c17 (diff)
downloadkexec-tools-ba686313d496ee25db69803ef7e5bfb1e07eb841.tar.gz
build-cpp-and-ld-flags
[BUILD] CPPFLAGS, CFLAGS and LDFLAGS fixes * Set internal CPPFLAGS as EXTRA_CPPFLAGS, CFLAGS as EXTRA_CFLAGS, and LDFLAGS as EXTRA_LDFLAGS - Don't overwrite CPPFLAGS, LDLFAGS or CFLAGS from the environment - They are irrelevant for BUILD_CC - When cross-compiling for a ppc64 host on a non-ppc64 host, EXTRA_CFLAGS, which is included in BUILD_CPPFLAGS contains -mcall-aixdesc, which does not work on i386 at least * Use LDFLAGS when linking kexec - Append rather than overwrite in purgatory/Makefile The purpose of these changes is three-fold. * CPPFLAGS, CFLAGS and LDFLAGS from the environment really ought to be honoured. For one thing; * Without these changes, the confgiure taget in the toplevel makefile can't work * Without these changes, cross compiling does not work - well, I can't work out how to get it to work anyway. Signed-Off-By: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'purgatory')
-rw-r--r--purgatory/Makefile6
1 files changed, 3 insertions, 3 deletions
diff --git a/purgatory/Makefile b/purgatory/Makefile
index 50ce99fe..adbd8148 100644
--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -8,13 +8,13 @@
# or headers.
ifeq ($(ARCH),ppc64)
-LDFLAGS = -melf64ppc
+EXTRA_LDFLAGS = -melf64ppc
endif
PCFLAGS:=-Wall -Os \
-I$(shell $(CC) -print-file-name=include) \
-Ipurgatory/include -Ipurgatory/arch/$(ARCH)/include \
- $(CPPFLAGS)
+ $(CPPFLAGS) $(EXTRA_CPPFLAGS)
PCFLAGS += $(call cc-option, -ffreestanding)
PCFLAGS += $(call cc-option, -fnobuiltin)
@@ -59,7 +59,7 @@ $(PURGATORY_S_OBJS): $(OBJDIR)/%.o: %.S $(OBJDIR)/%.d
$(PURGATORY): $(PURGATORY_OBJS) $(UTIL_LIB)
$(MKDIR) -p $(@D)
- $(LD) $(LDFLAGS) --no-undefined -e purgatory_start -r -o $@ $(PURGATORY_OBJS) $(UTIL_LIB)
+ $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) --no-undefined -e purgatory_start -r -o $@ $(PURGATORY_OBJS) $(UTIL_LIB)
echo::
@echo "PURGATORY_C_SRCS $(PURGATORY_C_SRCS)"