Makefile: use libflashrom.a as input to build the flashrom executable
Change-Id: Ib0091a23611cd5a1d915e56c6d0f061d74198e88
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/62198
Original-Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72304
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/Makefile b/Makefile
index e064ea3..ad58af9 100644
--- a/Makefile
+++ b/Makefile
@@ -877,8 +877,8 @@
endif
endif
-LIBFLASHROM_OBJS = $(CHIP_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS)
-OBJS = $(CLI_OBJS) $(LIBFLASHROM_OBJS)
+OBJS = $(CHIP_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS)
+
all: $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8
ifeq ($(ARCH), x86)
@@ -945,10 +945,10 @@
%.o: %.c | config
$(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FLASHROM_CFLAGS) $(FEATURE_FLAGS) $(SCMDEF) -o $@ -c $<
-$(PROGRAM)$(EXEC_SUFFIX): $(OBJS)
- $(CC) -o $(PROGRAM)$(EXEC_SUFFIX) $(OBJS) $(LDFLAGS)
+$(PROGRAM)$(EXEC_SUFFIX): $(CLI_OBJS) libflashrom.a
+ $(CC) -o $@ $^ $(LDFLAGS)
-libflashrom.a: $(LIBFLASHROM_OBJS)
+libflashrom.a: $(OBJS)
$(AR) rcs $@ $^
$(RANLIB) $@