# GNU make Makefile for Wormhole driver for Linux # # 6/01/99 Mark Taylor Initial creation # # Notes: 1. see info make nodes: General Search, Commands/Search, # Writing Shell Commands With Directory Search # # requires: # # Comment/uncomment the following line to disable/enable debugging DEBUG = y # Change it here or specify it on the "make" commandline INCLUDEDIR = /usr/include ifeq ($(DEBUG),y) DEBFLAGS = -O -g -DSCULL_DEBUG # "-O" is needed to expand inlines else DEBFLAGS = -O2 endif CFLAGS = -D__KERNEL__ -DMODULE -Wall $(DEBFLAGS) CFLAGS += -I$(INCLUDEDIR) # Extract version number from headers. VER = $(shell awk -F\" '/REL/ {print $$2}' $(INCLUDEDIR)/linux/version.h) TARGET = worm OBJS = $(TARGET).o SRC = worm.c dtstmp.c all: .depend $(TARGET).o $(TARGET).o: $(SRC:.c=.o) $(LD) -r $^ -o $@ install: # mkdir -p /lib/modules/$(VER)/misc /lib/modules/misc # install -c $(TARGET).o /lib/modules/$(VER)/misc # install -c $(TARGET).o /lib/modules/misc # # for Mandrake Linux 7.0 cp worm /lib/modules/2.2.14-15mdk/misc/worm.o clean: rm -f *.o *~ core .depend # stamp: # create the header file dtstmp.h echo \ "// dtstmp.h Makefile generated built on time for Linux modules" \ > dtstmp.h echo "extern char *date_stamp;" >> dtstmp.h echo "extern char *show_version();" >> dtstmp.h # create dtstmp.c file echo \ "// dtstmp.c Makefile generated built on time for Linux modules" \ > dtstmp.c echo "char *date_stamp = \"`date` \" ;" >> dtstmp.c echo "char *show_version() { return date_stamp; }" >> dtstmp.c depend .depend dep: $(CC) $(CFLAGS) -M *.c > $@ ifeq (.depend,$(wildcard .depend)) include .depend endif