[PATCH skeleton 8/9] bin targets are rebuilt every time

OpenBMC Patches openbmc-patches at stwcx.xyz
Tue Jun 28 04:50:53 AEST 2016


From: Brad Bishop <bradleyb at fuzziesquirrel.com>

Address an issue where the targets specified in the BINS variable
are rebuilt every time.

Signed-off-by: Brad Bishop <bradleyb at fuzziesquirrel.com>
---
 rules.mk | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/rules.mk b/rules.mk
index dec78b8..fcb7b44 100644
--- a/rules.mk
+++ b/rules.mk
@@ -8,18 +8,18 @@ ALL_CFLAGS+=$(shell pkg-config --cflags $(PACKAGE_DEPS)) -fPIC -Werror $(CFLAGS)
 
 BIN_SUFFIX?=.exe
 
-all: $(BINS)
+all: $(BINS:=$(BIN_SUFFIX))
 
 %.o: %.c
 	$(CC) -c $(ALL_CFLAGS) -o $@ $<
 
-$(BINS): %: %.o $(EXTRA_OBJS)
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(BIN_SUFFIX) $^ $(LDLIBS)
+$(BINS:=$(BIN_SUFFIX)): %$(BIN_SUFFIX): %.o $(EXTRA_OBJS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
 
-install: $(BINS)
+install: $(BINS:=$(BIN_SUFFIX))
 	@mkdir -p $(DESTDIR)$(sbindir)
-	@for b in $(BINS); do \
-		install $$b$(BIN_SUFFIX) $(DESTDIR)$(sbindir) || exit 1; \
+	@for b in $(BINS:=$(BIN_SUFFIX)); do \
+		install $$b $(DESTDIR)$(sbindir) || exit 1; \
 	done
 
 clean:
-- 
2.9.0




More information about the openbmc mailing list