Blame test/testmod/Makefile

Packit c71e3f
BUILD ?= /lib/modules/$(shell uname -r)/build
Packit c71e3f
Packit c71e3f
testmod.ko: testmod_drv.c
Packit c71e3f
	patch < patch
Packit c71e3f
	KCFLAGS="-ffunction-sections -fdata-sections" $(MAKE) -C $(BUILD) M=$(PWD) testmod.ko
Packit c71e3f
	strip --keep-file-symbols -d testmod_drv.o
Packit c71e3f
	cp testmod_drv.o testmod_drv.o.patched
Packit c71e3f
	patch -R < patch
Packit c71e3f
	KCFLAGS="-ffunction-sections -fdata-sections" $(MAKE) -C $(BUILD) M=$(PWD) testmod.ko
Packit c71e3f
	strip --keep-file-symbols -d testmod_drv.o
Packit c71e3f
	cp testmod_drv.o testmod_drv.o.orig
Packit c71e3f
	$(MAKE) -C $(BUILD) M=$(PWD) clean
Packit c71e3f
	$(MAKE) -C $(BUILD) M=$(PWD) testmod.ko
Packit c71e3f
Packit c71e3f
all: testmod.ko
Packit c71e3f
Packit c71e3f
clean:
Packit c71e3f
	$(MAKE) -C $(BUILD) M=$(PWD) clean
Packit c71e3f
	rm *.orig *.patched
Packit c71e3f
Packit c71e3f
# kbuild rules
Packit c71e3f
obj-m := testmod.o
Packit c71e3f
testmod-y := testmod_drv.o