aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-03 17:16:37 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-03 22:52:06 +0200
commitc3010935141fe60eabdd7dac60153af6281bc74c (patch)
tree75c8ca245cb98962a3e5b0af1cbbfa7f76cadcd9
parentglobal: add space around variable declarations (diff)
downloadwireguard-monolithic-historical-c3010935141fe60eabdd7dac60153af6281bc74c.tar.xz
wireguard-monolithic-historical-c3010935141fe60eabdd7dac60153af6281bc74c.zip
Makefile: add non-verbose mode to tools
Diffstat (limited to '')
-rw-r--r--src/Makefile5
-rw-r--r--src/tools/Makefile20
2 files changed, 23 insertions, 2 deletions
diff --git a/src/Makefile b/src/Makefile
index fca65d2..d47473e 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -7,7 +7,7 @@ DKMSDIR ?= $(SRCDIR)/wireguard
PWD := $(shell pwd)
all: module tools
-debug: module-debug tools
+debug: module-debug tools-debug
version.h:
@export GIT_CEILING_DIRECTORIES="$$(readlink -f ../..)" && \
@@ -58,6 +58,9 @@ dkms-install: $(DKMS_TOP_LEVEL) $(DKMS_SELFTEST_LEVEL) $(DKMS_CRYPTO_LEVEL) $(DK
tools:
$(MAKE) -C tools
+tools-debug:
+ $(MAKE) -C tools V=1 DEBUG_TOOLS=y
+
check:
$(MAKE) -C $(KERNELDIR) M=$(PWD) C=2 CF="-D__CHECK_ENDIAN__" CONFIG_WIREGUARD_DEBUG=y
$(MAKE) -C tools check
diff --git a/src/tools/Makefile b/src/tools/Makefile
index 2dd7f6a..1407de4 100644
--- a/src/tools/Makefile
+++ b/src/tools/Makefile
@@ -36,6 +36,9 @@ CFLAGS += -std=gnu11 -D_GNU_SOURCE
CFLAGS += -Wall -Wextra
CFLAGS += -MMD -MP
CFLAGS += -DRUNSTATEDIR="\"$(RUNSTATEDIR)\""
+ifeq ($(DEBUG_TOOLS),y)
+CFLAGS += -g
+endif
ifeq ($(shell uname -s),Linux)
LIBMNL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libmnl 2>/dev/null)
LIBMNL_LDLIBS := $(shell $(PKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl)
@@ -43,10 +46,25 @@ CFLAGS += $(LIBMNL_CFLAGS)
LDLIBS += $(LIBMNL_LDLIBS)
endif
+ifneq ($(V),1)
+BUILT_IN_LINK.o := $(LINK.o)
+LINK.o = @echo " LD $@";
+LINK.o += $(BUILT_IN_LINK.o)
+BUILT_IN_COMPILE.c := $(COMPILE.c)
+COMPILE.c = @echo " CC $@";
+COMPILE.c += $(BUILT_IN_COMPILE.c)
+endif
+
wg: $(patsubst %.c,%.o,$(wildcard *.c))
+ifneq ($(V),1)
clean:
- rm -f wg *.o *.d
+ @echo " RM " 'wg *.o *.d'
+ @$(RM) wg *.o *.d
+else
+clean:
+ $(RM) wg *.o *.d
+endif
install: wg
@install -v -d "$(DESTDIR)$(BINDIR)" && install -m 0755 -v wg "$(DESTDIR)$(BINDIR)/wg"