diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -5,7 +5,9 @@ BINPREFIX ?= $(PREFIX)/bin MANPREFIX ?= $(PREFIX)/share/man DATAPREFIX ?= $(PREFIX)/share -V ?= +ifeq ($(V),) +MUTE := @ +endif CFLAGS ?= -W -Wall -Wpedantic CFLAGS += -std=gnu11 $(shell sdl2-config --cflags) @@ -24,26 +26,26 @@ CFLAGS += -DIMV_VERSION=\"$(VERSION)\" $(TARGET): $(OBJECTS) @echo "LINKING $@" - $(V:%=@)$(CC) -o $@ $^ $(LDLIBS) $(LDFLAGS) + $(MUTE)$(CC) -o $@ $^ $(LDLIBS) $(LDFLAGS) debug: CFLAGS += -DDEBUG -g -pg debug: $(TARGET) $(BUILDDIR)/%.o: src/%.c - $(V:%=@)mkdir -p $(BUILDDIR) + $(MUTE)mkdir -p $(BUILDDIR) @echo "COMPILING $@" - $(V:%=@)$(CC) -c $(CFLAGS) -o $@ $< + $(MUTE)$(CC) -c $(CFLAGS) -o $@ $< test_%: test/%.c src/%.c @echo "BUILDING $@" - $(V:%=@)$(CC) -o $@ -Isrc -W -Wall -std=gnu11 -lcmocka $^ + $(MUTE)$(CC) -o $@ -Isrc -W -Wall -std=gnu11 -lcmocka $^ check: $(TESTS) @echo "RUNNING TESTS" - $(V:%=@)for t in "$(TESTS)"; do ./$$t; done + $(MUTE)for t in "$(TESTS)"; do ./$$t; done clean: - $(V:%=@)$(RM) $(TARGET) $(OBJECTS) $(TESTS) + $(MUTE)$(RM) $(TARGET) $(OBJECTS) $(TESTS) install: $(TARGET) install -D -m 0755 $(TARGET) $(DESTDIR)$(BINPREFIX)/imv |