@@ -32,5 +32,5 @@ common/arch_flash_common.o: common/arch_flash_common.c .FORCE
$(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@
common/arch_flash.o: $(ARCH_OBJS)
- $(CROSS_COMPILE)ld -r $(ARCH_OBJS) -o $@
+ $(CROSS_COMPILE)ld $(LDFLAGS) -r $(ARCH_OBJS) -o $@
@@ -1,7 +1,6 @@
.DEFAULT_GOAL := all
-CFLAGS = -O2 -Wall -I.
-LDFLAGS = -lrt
+override CFLAGS += -O2 -Wall -I.
OBJS = pflash.o progress.o version.o
OBJS += libflash/libflash.o libflash/libffs.o libflash/ecc.o libflash/blocklevel.o libflash/file.o
OBJS += common/arch_flash.o
@@ -22,5 +21,5 @@ version.c: make_version.sh .version
$(CC) $(CFLAGS) -c $< -o $@
$(EXE): $(OBJS)
- $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
+ $(CC) $(CFLAGS) $^ -lrt -o $@
In order to be able to compile for something that isn't the default for the compiler one should be able to use CFLAGS and LDFLAGS on commandline. ie build a 64bit binary with a compiler which builds by default 32bit or the opposite endian for which the compiler is configured. Currently the common/rules.mk ignores LDFLAGS when it shouldn't and pflash sets LDFLAGS for something which only applies to the final link. This patch addresses both those issues. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> --- external/common/rules.mk | 2 +- external/pflash/rules.mk | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)