# Makefile adapted by Michael A. Smith - COP 5641 - Summer 2005 # # Comment/uncomment the following line to disable/enable debugging DIGIT_DELAY_VAL = -1 GROUP_DELAY_VAL = -1 TIME_DELAY_VAL = -1 SET_PARAM = -D # These are clearly not pertinent to the biopod (were for ledclock) # but they are left here for structure in case later we want to add # some. Remove before submission of course. DIGIT_DELAY = BIOPOD_DIGIT_DELAY GROUP_DELAY = BIOPOD_GROUP_DELAY TIME_DELAY = BIOPOD_TIME_DELAY NUM_TESTS = 1 EXEC0 = run EXEC1 = EXEC2 = EXECUTABLES = $(EXEC0) $(EXEC1) $(EXEC2) TESTER0 = bioread TESTER1 = biocntl TESTERS = $(TESTER0) $(TESTER1) TEST = DEBUG = y MOD = biopod DEBUG_OPT = -g -pedantic -Wshadow -Wpointer-arith -Wcast-qual\ -Wcast-align -Wwrite-strings -Wstrict-prototypes\ -Wredundant-decls -Wnested-externs -Winline \ -pedantic-errors -Wall -ansi -W -std=c99 C_EXT = c O_EXT = o TEST_BASE = $(MOD)$(TEST)test DRIVER = $(MOD) OBJECTS = $(DRIVER).$(O_EXT) # Add your debugging flag (or not) to CFLAGS ifeq ($(DEBUG),y) DEBFLAGS = -O -g -DBIOPOD_DEBUG -Wall # "-O" is needed to expand inlines else DEBFLAGS = -O2 endif # Adding any defined parameters PARAMS = ifneq ($(DIGIT_DELAY_VAL), -1) PARAMS += $(SET_PARAM) $(DIGIT_DELAY)=$(DIGIT_DELAY_VAL) endif ifneq ($(GROUP_DELAY_VAL), -1) PARAMS += $(SET_PARAM) $(GROUP_DELAY)=$(GROUP_DELAY_VAL) endif ifneq ($(TIME_DELAY_VAL), -1) PARAMS += $(SET_PARAM) $(TIME_DELAY)=$(TIME_DELAY_VAL) endif CFLAGS += $(DEBFLAGS) $(PARAMS) CFLAGS += -I.. ifneq ($(KERNELRELEASE),) # call from kernel build system obj-m := $(MOD).$(O_EXT) else KERNELDIR ?= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules endif clean: rm -rf *.o *~ core* .depend .*.cmd *.ko *.mod.c .tmp_versions \ \#*\# $(EXECUTABLES) $(TESTERS) depend .depend dep: $(CC) $(CFLAGS) -M *.c > .depend ifeq (.depend,$(wildcard .depend)) include .depend endif test: ./compileTests $(NUM_TESTS) gcc -o $(EXEC0) $(TEST_BASE)0.o # gcc -o $(EXEC1) $(TEST_BASE)1.o rm -rf *.o *~ core* .depend .*.cmd *.ko *.mod.c .tmp_versions \#*\# testers: gcc $(DEBUG_OPT) -c $(TESTER0).c gcc -o $(TESTER0) $(TESTER0).o gcc $(DEBUG_OPT) -c $(TESTER1).c gcc -o $(TESTER1) $(TESTER1).o rm -rf *.o *~ core* .depend .*.cmd *.ko *.mod.c .tmp_versions \#*\#