diff mbox

pflash: Fix the makefile

Message ID 1469681158-12327-1-git-send-email-joel@jms.id.au
State Accepted
Headers show

Commit Message

Joel Stanley July 28, 2016, 4:45 a.m. UTC
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>
---
 external/pflash/rules.mk | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

Comments

Stewart Smith July 28, 2016, 4:53 a.m. UTC | #1
Joel Stanley <joel@jms.id.au> writes:
> 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>

World record time merged as of fd599965f723330da5ec55519c20cdb6aa2b3a2d
as, well, couldn't break it any further, righT? :)
Stewart Smith July 28, 2016, 4:53 a.m. UTC | #2
Joel Stanley <joel@jms.id.au> writes:
> 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>

World record time merged as of fd599965f723330da5ec55519c20cdb6aa2b3a2d
as, well, couldn't break it any further, righT? :)
diff mbox

Patch

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 $@