kmod/testsuite/module-playground/Makefile.arch
Lucas De Marchi 7efa3502dd module-playground: allow to cross-compile modules
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.
2015-02-21 11:40:27 -02:00

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