aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2016-07-28 14:15:58 +0930
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-07-28 14:48:45 +1000
commitfd599965f723330da5ec55519c20cdb6aa2b3a2d (patch)
tree46174bf39c5f98d56cf142a1567bcabb5fb7fafe /external
parent81a538a678edf666568ca4adffe074b3dbce6dc3 (diff)
downloadskiboot-fd599965f723330da5ec55519c20cdb6aa2b3a2d.zip
skiboot-fd599965f723330da5ec55519c20cdb6aa2b3a2d.tar.gz
skiboot-fd599965f723330da5ec55519c20cdb6aa2b3a2d.tar.bz2
pflash: Fix the makefile
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@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r--external/pflash/rules.mk26
1 files changed, 17 insertions, 9 deletions
diff --git a/external/pflash/rules.mk b/external/pflash/rules.mk
index 6be9b67..c8a1476 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 $@