mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-11-24 07:20:52 +07:00
7efa3502dd
This adds the needed infra to cross-compile modules so we can test them in our testsuite. Right now we are only compiling mod-simple.ko for x86, x86_64 and sparc64. The makefiles are organized in a way it's easy to force a rebuild of a module by calling the Makefile.arch directly and that allows the rule in Makefile to not trigger in case we want to ship the modules pre-compiled.
15 lines
458 B
Makefile
15 lines
458 B
Makefile
ifeq ($(ARCH),)
|
|
$(error ARCH must be set to a valid architecture)
|
|
endif
|
|
|
|
default:
|
|
@cmp --quiet mod-simple.c mod-simple-$(ARCH).c || ( \
|
|
ln -sf mod-simple.c mod-simple-$(ARCH).c; \
|
|
/bin/false \
|
|
)
|
|
$(MAKE) -C $(KDIR_$(ARCH)) CROSS_COMPILE=$(CROSS_COMPILE_$(ARCH)) M=$$PWD KMOD_TESTSUITE_ARCH_BUILD=1
|
|
|
|
clean:
|
|
$(MAKE) -C $(KDIR_$(ARCH)) CROSS_COMPILE=$(CROSS_COMPILE_$(ARCH)) M=$$PWD KMOD_TESTSUITE_ARCH_BUILD=1 clean
|
|
rm -f mod-simple-$(ARCH).c
|