kpatch/kmod/Makefile
Chris J Arges e9b9654602 Makefile: add BUILDMOD parameter to select building kmod core
In some cases when packaging it may not be useful to build kmod/core at
package build time (for example if using DKMS). Add a parameter 'BUILDMOD'
that when set to 'yes' will build kmod/core.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
2016-02-10 09:55:45 -06:00

27 lines
527 B
Makefile

include ../Makefile.inc
all: clean
ifeq ($(BUILDMOD),yes)
$(MAKE) -C core
endif
install:
ifeq ($(BUILDMOD),yes)
$(INSTALL) -d $(MODULESDIR)/$(shell uname -r)
$(INSTALL) -m 644 core/kpatch.ko $(MODULESDIR)/$(shell uname -r)
$(INSTALL) -m 644 core/Module.symvers $(MODULESDIR)/$(shell uname -r)
endif
$(INSTALL) -d $(DATADIR)/patch
$(INSTALL) -m 644 patch/* $(DATADIR)/patch
uninstall:
ifeq ($(BUILDMOD),yes)
$(RM) -R $(MODULESDIR)
endif
$(RM) -R $(DATADIR)
clean:
ifeq ($(BUILDMOD),yes)
$(MAKE) -C core clean
endif