summaryrefslogtreecommitdiffhomepage
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
commit26befc0011fd1cbdbae3d416c37cdfd24c25ea39 (patch)
tree06e1eedb7d94c07c159d8e8b65e24177a9f87d64 /src
parentc96acaaa41f70d2693660cfe626c17f8dda01e76 (diff)
makefile: use immediate expansion and use correct template patterns
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
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