aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2015-11-16 15:29:51 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-11-16 15:31:11 +1100
commit168b71461d7706724ef2a6d921bc1460c8c3a20a (patch)
treebb95dbf174997ce84bcc7439cee17a23971f64fc /external
parentb630cb5d1219d7eeb92a6dc90484221b293db5aa (diff)
downloadskiboot-168b71461d7706724ef2a6d921bc1460c8c3a20a.zip
skiboot-168b71461d7706724ef2a6d921bc1460c8c3a20a.tar.gz
skiboot-168b71461d7706724ef2a6d921bc1460c8c3a20a.tar.bz2
Make gard and pflash build arch specific files in pwd
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r--external/common/rules.mk12
-rw-r--r--external/gard/rules.mk8
-rw-r--r--external/pflash/rules.mk8
3 files changed, 17 insertions, 11 deletions
diff --git a/external/common/rules.mk b/external/common/rules.mk
index 79078e5..3ae9181 100644
--- a/external/common/rules.mk
+++ b/external/common/rules.mk
@@ -2,15 +2,15 @@ ARCH = $(shell $(GET_ARCH) "$(CROSS_COMPILE)")
ifeq ($(ARCH),ARCH_ARM)
arch = arm
-ARCH_OBJS = common/arch_flash_common.o common/arch_flash_arm.o common/ast-sf-ctrl.o
+ARCH_OBJS = common-arch_flash_common.o common-arch_flash_arm.o common-ast-sf-ctrl.o
else
ifeq ($(ARCH),ARCH_POWERPC)
arch = powerpc
-ARCH_OBJS = common/arch_flash_common.o common/arch_flash_powerpc.o
+ARCH_OBJS = common-arch_flash_common.o common-arch_flash_powerpc.o
else
ifeq ($(ARCH),ARCH_X86)
arch = x86
-ARCH_OBJS = common/arch_flash_common.o common/arch_flash_x86.o
+ARCH_OBJS = common-arch_flash_common.o common-arch_flash_x86.o
else
$(error Unsupported architecture $(ARCH))
endif
@@ -26,11 +26,9 @@ arch_links:
arch_clean:
rm -rf $(ARCH_OBJS)
-#If arch changes make won't realise it needs to rebuild...
-.PHONY: .FORCE
-common/arch_flash_common.o: common/arch_flash_common.c .FORCE
+$(ARCH_OBJS): common-%.o: common/%.c
$(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@
-common/arch_flash.o: $(ARCH_OBJS)
+common-arch_flash.o: $(ARCH_OBJS)
$(CROSS_COMPILE)ld $(LDFLAGS) -r $(ARCH_OBJS) -o $@
diff --git a/external/gard/rules.mk b/external/gard/rules.mk
index a78a401..f0086a2 100644
--- a/external/gard/rules.mk
+++ b/external/gard/rules.mk
@@ -2,8 +2,9 @@
override CFLAGS += -O2 -Wall -Werror -I.
OBJS = version.o gard.o
-OBJS += libflash/file.o libflash/libflash.o libflash/libffs.o libflash/ecc.o libflash/blocklevel.o
-OBJS += common/arch_flash.o
+LIBFLASH_OBJS += libflash-file.o libflash-libflash.o libflash-libffs.o libflash-ecc.o libflash-blocklevel.o
+OBJS += $(LIBFLASH_OBJS)
+OBJS += common-arch_flash.o
EXE = gard
CC = $(CROSS_COMPILE)gcc
@@ -25,6 +26,9 @@ version.c: make_version.sh .version
%.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
+$(LIBFLASH_OBJS): libflash-%.o : libflash/%.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
$(EXE): $(OBJS)
$(CC) $(CFLAGS) $^ -o $@
diff --git a/external/pflash/rules.mk b/external/pflash/rules.mk
index 003758a..96f6a4f 100644
--- a/external/pflash/rules.mk
+++ b/external/pflash/rules.mk
@@ -2,8 +2,9 @@
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
+LIBFLASH_OBJS += libflash-libflash.o libflash-libffs.o libflash-ecc.o libflash-blocklevel.o libflash-file.o
+OBJS += $(LIBFLASH_OBJS)
+OBJS += common-arch_flash.o
EXE = pflash
CC = $(CROSS_COMPILE)gcc
@@ -20,6 +21,9 @@ version.c: make_version.sh .version
%.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
+$(LIBFLASH_OBJS): libflash-%.o : libflash/%.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
$(EXE): $(OBJS)
$(CC) $(CFLAGS) $^ -lrt -o $@