diff options
author | Dmitrij D. Czarkoff <czarkoff@gmail.com> | 2015-12-27 12:33:38 +0100 |
---|---|---|
committer | Dmitrij D. Czarkoff <czarkoff@gmail.com> | 2015-12-27 12:33:38 +0100 |
commit | 96bd50edc990887084da254dc78f9c4657d2c76e (patch) | |
tree | 112c5f8cf7f7fb4e0303b86fc8cf432e4f8afd75 | |
parent | a339d07ec689adc47390ff95822f0472b5b2168f (diff) | |
download | imv-96bd50edc990887084da254dc78f9c4657d2c76e.tar.gz |
Drop "obj" target
It was introduced to make object files depend on $(BUILDDIR) so that creating it
could be moved into separate rule, executed once. That was a bad idea, because
"obj" had to be phony, thus making all targets that depend on it obsolete
between runs of make. This change introduces order-only rule that makes object
files depend on $(BUILDDIR) without obsoleting other targets.
-rw-r--r-- | Makefile | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,4 +1,4 @@ -.PHONY: imv obj clean check install uninstall +.PHONY: imv clean check install uninstall PREFIX ?= /usr BINPREFIX ?= $(PREFIX)/bin @@ -26,14 +26,14 @@ CFLAGS += -DIMV_VERSION=\"$(VERSION)\" imv: $(TARGET) -$(TARGET): obj +$(TARGET): $(OBJECTS) @echo "LINKING $@" - $(MUTE)$(CC) -o $@ $(OBJECTS) $(LDLIBS) $(LDFLAGS) + $(MUTE)$(CC) -o $@ $^ $(LDLIBS) $(LDFLAGS) debug: CFLAGS += -DDEBUG -g -pg debug: $(TARGET) -obj: $(BUILDDIR) $(OBJECTS) +$(OBJECTS): | $(BUILDDIR) $(BUILDDIR): $(MUTE)mkdir -p $(BUILDDIR) |