CC = gcc CFLAGS = -O2 -Wall LEX=flex # Note: LFLAGS might not be needed... YMWV LFLAGS= -l # You might want to enable this define depending on your flex. See parsesym.c #YYTEXT_PTR= -DYYTEXT_PTR BINDIR = /sbin KSYMS = /usr/src/linux/kernel/ksyms.c TESTDEFS = -D__KERNEL__ -D__GENKSYMS__ -DCONFIG_MODVERSIONS -I/usr/src/linux/include all: genksyms genksyms: symlex.o parsesym.o $(CC) $(CFLAGS) -o genksyms symlex.o parsesym.o symlex.o: symlex.c $(CC) -c -O2 $(YYTEXT_PTR) symlex.c symlex.c: symlex.l $(LEX) $(LFLAGS) symlex.l mv lex.yy.c symlex.c symlex.o parsesym.o: lexsyms.h parsesym.o: crc32.tab crc32.tab: makecrc32 ./makecrc32 > crc32.tab install-binaries: genksyms install -c -s genksyms $(BINDIR) install-docs: install -m 644 genksyms.8 /usr/man/man8 install: install-binaries install-docs clean: rm -f *.o crc32.tab symlex.c rm -f makecrc32 genksyms test: genksyms gcc -E $(TESTDEFS) $(KSYMS) | ./genksyms VERSIONHEADERS @echo "If the test failed, check LFLAGS and/or YYTEXT_PTR in the Makefile" testall: genksyms gcc -E $(TESTDEFS) /usr/src/linux/kernel/*.c | ./genksyms VERSIONHEADERS dump: genksyms gcc -E $(TESTDEFS) $(KSYMS) | ./genksyms -D > check_dump debug: genksyms gcc -E $(TESTDEFS) $(KSYMS) | ./genksyms -dd > check_debug input: gcc -E $(TESTDEFS) $(KSYMS) > check_input