aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/crypto/Kbuild.include
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/Kbuild.include')
-rw-r--r--src/crypto/Kbuild.include11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/crypto/Kbuild.include b/src/crypto/Kbuild.include
index 4fde2e6..e93f3af 100644
--- a/src/crypto/Kbuild.include
+++ b/src/crypto/Kbuild.include
@@ -41,12 +41,11 @@ quiet_cmd_perlasm = PERLASM $@
cmd_perlasm = $(PERL) $< > $@
%.S: %.pl
$(call cmd,perlasm)
-ifeq ($(wildcard $(src)/compat/compat.h),)
-target_path_prefix := $(srctree)/$(src)
-else
-target_path_prefix := $(src)
-endif
-.SECONDARY: $(addprefix $(target_path_prefix)/,$(patsubst %.o,crypto/zinc/%.S,$(zinc-y)))
+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))
wireguard-y += $(addprefix crypto/zinc/,$(zinc-y))
ccflags-y += -I$(src)/crypto/include