aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-12-16 00:50:39 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-12-18 14:41:48 +0100
commit622cef6f81a297b51728fd47c9ae8986bd5a4c76 (patch)
tree6765f60843bbc1c076438b0ad9813f1201ba9400 /src
parentnetns: nmap != ncat (diff)
downloadwireguard-monolithic-historical-622cef6f81a297b51728fd47c9ae8986bd5a4c76.tar.xz
wireguard-monolithic-historical-622cef6f81a297b51728fd47c9ae8986bd5a4c76.zip
makefile: use immediate expansion and use correct template patterns
Diffstat (limited to 'src')
-rw-r--r--src/compat/Kbuild.include2
-rw-r--r--src/crypto/Kbuild.include12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/compat/Kbuild.include b/src/compat/Kbuild.include
index 530f71d..2164dbf 100644
--- a/src/compat/Kbuild.include
+++ b/src/compat/Kbuild.include
@@ -2,7 +2,7 @@
#
# Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
-kbuild-dir ?= $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
+kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
ccflags-y += -include $(kbuild-dir)/compat/compat.h
asflags-y += -include $(kbuild-dir)/compat/compat-asm.h
diff --git a/src/crypto/Kbuild.include b/src/crypto/Kbuild.include
index e93f3af..460684d 100644
--- a/src/crypto/Kbuild.include
+++ b/src/crypto/Kbuild.include
@@ -39,13 +39,13 @@ zinc-$(CONFIG_ZINC_ARCH_ARM) += curve25519/curve25519-arm.o
quiet_cmd_perlasm = PERLASM $@
cmd_perlasm = $(PERL) $< > $@
-%.S: %.pl
- $(call cmd,perlasm)
-kbuild-dir ?= $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
-targets += $(patsubst $(kbuild-dir)/%.pl,%.S,$(wildcard $(patsubst %.o,$(kbuild-dir)/crypto/zinc/%.pl,$(zinc-y) $(zinc-m) $(zinc-))))
+$(obj)/%.S: $(src)/%.pl FORCE
+ $(call if_changed,perlasm)
+kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
+targets := $(patsubst $(kbuild-dir)/%.pl,%.S,$(wildcard $(patsubst %.o,$(kbuild-dir)/crypto/zinc/%.pl,$(zinc-y) $(zinc-m) $(zinc-))))
-# Old kernels don't have targets, so use SECONDARY manually, which requires the full path
-.SECONDARY: $(addprefix $(kbuild-dir)/,$(targets))
+# Old kernels don't set this, which causes trouble.
+.SECONDARY:
wireguard-y += $(addprefix crypto/zinc/,$(zinc-y))
ccflags-y += -I$(src)/crypto/include