diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-14 18:14:55 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-14 18:18:40 +0200 |
commit | 3e6bb79515e3919eaee80397a115b6a4f9f2b96a (patch) | |
tree | a433d77a47b0d378893d72f4c748b631d1c7218a | |
parent | allowedips: Fix graphviz output after endianness patch (diff) | |
download | wireguard-monolithic-historical-3e6bb79515e3919eaee80397a115b6a4f9f2b96a.tar.xz wireguard-monolithic-historical-3e6bb79515e3919eaee80397a115b6a4f9f2b96a.zip |
tools: reorganize for multiplatform wg-quick
-rw-r--r-- | src/tools/Makefile | 12 | ||||
-rw-r--r-- | src/tools/man/wg-quick.8 (renamed from src/tools/wg-quick.8) | 0 | ||||
-rw-r--r-- | src/tools/man/wg.8 (renamed from src/tools/wg.8) | 0 | ||||
-rw-r--r-- | src/tools/systemd/wg-quick@.service (renamed from src/tools/wg-quick@.service) | 4 | ||||
-rwxr-xr-x | src/tools/wg-quick/linux.bash (renamed from src/tools/wg-quick.bash) | 0 |
5 files changed, 9 insertions, 7 deletions
diff --git a/src/tools/Makefile b/src/tools/Makefile index 72296aa..241293f 100644 --- a/src/tools/Makefile +++ b/src/tools/Makefile @@ -35,6 +35,8 @@ WITH_SYSTEMDUNITS := yes endif endif +PLATFORM ?= $(shell uname -s | tr '[:upper:]' '[:lower:]') + CFLAGS ?= -O3 CFLAGS += -std=gnu11 -D_GNU_SOURCE CFLAGS += -Wall -Wextra @@ -43,7 +45,7 @@ CFLAGS += -DRUNSTATEDIR="\"$(RUNSTATEDIR)\"" ifeq ($(DEBUG_TOOLS),y) CFLAGS += -g endif -ifeq ($(shell uname -s),Linux) +ifeq ($(PLATFORM),linux) LIBMNL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libmnl 2>/dev/null) LIBMNL_LDLIBS := $(shell $(PKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl) CFLAGS += $(LIBMNL_CFLAGS) @@ -72,17 +74,17 @@ endif install: wg @install -v -d "$(DESTDIR)$(BINDIR)" && install -m 0755 -v wg "$(DESTDIR)$(BINDIR)/wg" - @install -v -d "$(DESTDIR)$(MANDIR)/man8" && install -m 0644 -v wg.8 "$(DESTDIR)$(MANDIR)/man8/wg.8" + @install -v -d "$(DESTDIR)$(MANDIR)/man8" && install -m 0644 -v man/wg.8 "$(DESTDIR)$(MANDIR)/man8/wg.8" @[ "$(WITH_BASHCOMPLETION)" = "yes" ] || exit 0; \ install -v -d "$(DESTDIR)$(BASHCOMPDIR)" && install -m 0644 -v completion/wg.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/wg" @[ "$(WITH_WGQUICK)" = "yes" ] || exit 0; \ - install -m 0755 -v wg-quick.bash "$(DESTDIR)$(BINDIR)/wg-quick" && install -m 0700 -v -d "$(DESTDIR)$(SYSCONFDIR)/wireguard" + install -m 0755 -v wg-quick/$(PLATFORM).bash "$(DESTDIR)$(BINDIR)/wg-quick" && install -m 0700 -v -d "$(DESTDIR)$(SYSCONFDIR)/wireguard" @[ "$(WITH_WGQUICK)" = "yes" ] || exit 0; \ - install -m 0644 -v wg-quick.8 "$(DESTDIR)$(MANDIR)/man8/wg-quick.8" + install -m 0644 -v man/wg-quick.8 "$(DESTDIR)$(MANDIR)/man8/wg-quick.8" @[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_BASHCOMPLETION)" = "yes" ] || exit 0; \ install -m 0644 -v completion/wg-quick.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/wg-quick" @[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_SYSTEMDUNITS)" = "yes" ] || exit 0; \ - install -v -d "$(DESTDIR)$(SYSTEMDUNITDIR)" && install -m 0644 -v wg-quick@.service "$(DESTDIR)$(SYSTEMDUNITDIR)/wg-quick@.service" + install -v -d "$(DESTDIR)$(SYSTEMDUNITDIR)" && install -m 0644 -v systemd/wg-quick@.service "$(DESTDIR)$(SYSTEMDUNITDIR)/wg-quick@.service" help: @cat INSTALL diff --git a/src/tools/wg-quick.8 b/src/tools/man/wg-quick.8 index 5e27d10..5e27d10 100644 --- a/src/tools/wg-quick.8 +++ b/src/tools/man/wg-quick.8 diff --git a/src/tools/wg.8 b/src/tools/man/wg.8 index 49dc15b..49dc15b 100644 --- a/src/tools/wg.8 +++ b/src/tools/man/wg.8 diff --git a/src/tools/wg-quick@.service b/src/tools/systemd/wg-quick@.service index ce6d70a..da5d787 100644 --- a/src/tools/wg-quick@.service +++ b/src/tools/systemd/wg-quick@.service @@ -6,8 +6,8 @@ Documentation=man:wg-quick(8) Documentation=man:wg(8) Documentation=https://www.wireguard.com/ Documentation=https://www.wireguard.com/quickstart/ -Documentation=https://git.zx2c4.com/WireGuard/about/src/tools/wg-quick.8 -Documentation=https://git.zx2c4.com/WireGuard/about/src/tools/wg.8 +Documentation=https://git.zx2c4.com/WireGuard/about/src/tools/man/wg-quick.8 +Documentation=https://git.zx2c4.com/WireGuard/about/src/tools/man/wg.8 [Service] Type=oneshot diff --git a/src/tools/wg-quick.bash b/src/tools/wg-quick/linux.bash index cd66b4d..cd66b4d 100755 --- a/src/tools/wg-quick.bash +++ b/src/tools/wg-quick/linux.bash |