aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDmitrij D. Czarkoff <czarkoff@gmail.com>2015-12-25 23:27:11 +0100
committerDmitrij D. Czarkoff <czarkoff@gmail.com>2015-12-25 23:27:11 +0100
commit447e86d35d4a0a4aed50056a08c4361c7f903dd8 (patch)
tree4d0cf43883b4036be615b92efb067b7c4cc57b54 /Makefile
parentc42ab088191d5dd8a2d856dc96cb5b3f90687fc4 (diff)
downloadimv-447e86d35d4a0a4aed50056a08c4361c7f903dd8.tar.gz
Fix verbose build
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 9 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 6ffa5c5..ca917af 100644
--- a/Makefile
+++ b/Makefile
@@ -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