[Skiboot] [PATCH] pflash: Fix the makefile

Joel Stanley joel at jms.id.au
Thu Jul 28 14:45:58 AEST 2016


Someone was a bit too keen with the cleanups last time. Restore the
ability for pflash to build in non-shared mode.

Fixes: c327eddd9b29 (pflash: Clean up makefiles and resolve build race)
Signed-off-by: Joel Stanley <joel at jms.id.au>
---
 external/pflash/rules.mk | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/external/pflash/rules.mk b/external/pflash/rules.mk
index 6be9b677698f..c8a1476bf329 100644
--- a/external/pflash/rules.mk
+++ b/external/pflash/rules.mk
@@ -1,19 +1,22 @@
 .DEFAULT_GOAL := all
 
 override CFLAGS  += -O2 -Wall -I.
-PFLASH_OBJS    := pflash.o progress.o version.o common-arch_flash.o
-OBJS	:= $(PFLASH_OBJS) $(LIBFLASH_OBJS)
-EXE     = pflash
-sbindir?=/usr/sbin
+LIBFLASH_FILES	:= libflash.c libffs.c ecc.c blocklevel.c file.c
+LIBFLASH_OBJS	:= $(addprefix libflash-, $(LIBFLASH_FILES:.c=.o))
+LIBFLASH_SRC	:= $(addprefix libflash/,$(LIBFLASH_FILES))
+PFLASH_OBJS	:= pflash.o progress.o version.o common-arch_flash.o
+OBJS		:= $(PFLASH_OBJS) $(LIBFLASH_OBJS)
+EXE     	:= pflash
+sbindir		?= /usr/sbin
 
-PFLASH_VERSION ?= $(shell ../../make_version.sh $(EXE))
-LINKAGE?=static
+PFLASH_VERSION	?= $(shell ../../make_version.sh $(EXE))
+LINKAGE		?= static
 
 ifeq ($(LINKAGE),dynamic)
 include ../shared/rules.mk
-SHARED	:= ../shared/$(SHARED_NAME)
-OBJS	:= $(PFLASH_OBJS) $(SHARED)
-INSTALLDEPS+=install-shared
+SHARED		:= ../shared/$(SHARED_NAME)
+OBJS		:= $(PFLASH_OBJS) $(SHARED)
+INSTALLDEPS	+= install-shared
 
 install-shared:
 	$(MAKE) -C ../shared install PREFIX=$(PREFIX)
@@ -32,6 +35,11 @@ version.c: .version
 %.o : %.c
 	$(Q_CC)$(CC) $(CFLAGS) -c $< -o $@
 
+$(LIBFLASH_SRC): | links
+
+$(LIBFLASH_OBJS): libflash-%.o : libflash/%.c
+	$(Q_CC)$(CC) $(CFLAGS) -c $< -o $@
+
 $(EXE): $(OBJS)
 	$(Q_CC)$(CC) $(CFLAGS) $^ -lrt -o $@
 
-- 
2.8.1



More information about the Skiboot mailing list