Makefile: simplify silent cleaning

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2020-03-23 00:06:24 -06:00
parent a8063adc8a
commit dc00c8c577
1 changed files with 2 additions and 6 deletions

View File

@ -67,18 +67,14 @@ LINK.o += $(BUILT_IN_LINK.o)
BUILT_IN_COMPILE.c := $(COMPILE.c) BUILT_IN_COMPILE.c := $(COMPILE.c)
COMPILE.c = @echo " CC $@"; COMPILE.c = @echo " CC $@";
COMPILE.c += $(BUILT_IN_COMPILE.c) COMPILE.c += $(BUILT_IN_COMPILE.c)
BUILT_IN_RM := $(RM)
RM := @a() { echo " CLEAN $$@"; $(BUILT_IN_RM) "$$@"; }; a
endif endif
wg: $(sort $(patsubst %.c,%.o,$(wildcard *.c))) wg: $(sort $(patsubst %.c,%.o,$(wildcard *.c)))
ifneq ($(V),1)
clean:
@echo " CLEAN {wg,*.o,*.d}"
@$(RM) wg *.o *.d
else
clean: clean:
$(RM) wg *.o *.d $(RM) wg *.o *.d
endif
install: wg install: wg
@install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 wg "$(DESTDIR)$(BINDIR)/wg" @install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 wg "$(DESTDIR)$(BINDIR)/wg"