2016-08-24 17:44:41 +02:00
|
|
|
ifeq ($(KERNELRELEASE),)
|
|
|
|
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
|
|
|
|
PWD := $(shell pwd)
|
|
|
|
CFLAGS ?= -O3 -march=native
|
|
|
|
CFLAGS += -Wall -pedantic -std=gnu11
|
|
|
|
|
|
|
|
extract-keys: extract-keys.c config.h
|
|
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) -D_FILE_OFFSET_BITS=64 -o $@ -lresolv $<
|
|
|
|
|
|
|
|
config.o: config.c
|
|
|
|
$(MAKE) -C $(KERNELDIR) M=$(PWD) $@
|
|
|
|
objcopy -j '.rodata*' $@ $@
|
|
|
|
|
|
|
|
config: config.c config.o
|
|
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^
|
|
|
|
|
|
|
|
config.h: config
|
|
|
|
./$< > $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f extract-keys config config.h
|
|
|
|
$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
else
|
|
|
|
config-m := config.o
|
2017-02-20 21:55:44 +01:00
|
|
|
oldsrc := $(src)
|
|
|
|
src := $(src)/../../../src
|
|
|
|
include $(src)/compat/Kbuild.include
|
2018-12-16 00:50:39 +01:00
|
|
|
include $(src)/crypto/Kbuild.include
|
2017-02-20 21:55:44 +01:00
|
|
|
src := $(oldsrc)
|
2016-08-24 17:44:41 +02:00
|
|
|
endif
|