# # ATNF DataSet device driver gmake description file # # ----------------------------------------------------------------------------- # - Define macros # --------------- AMOD = ds-spinlock_support APROG = dsspeed AFN = dscomm #include ~smagri/proj/dsdd/debug_info OTHER_ARG = -Ddevice_port_ttys2 OTHER_ARG_amod = OTHER_ARG_aprog = dscomm.o OTHER_ARG_afn = -DDEBUG_DSCOMM KERNELDIR ?= /usr/src/linux-headers-$(shell uname -r) PWD := $(shell pwd) obj-m := ds.o CC = gcc CFLAGS_module = -Iinclude -I/lib/modules/`uname -r`/build/include \ -O2 -DMODULE -D__KERNEL__ $(OTHER_ARG) -Wall -c CFLAGS_amod = -Iinclude -O2 -DMODULE -D__KERNEL__ $(OTHER_ARG_amod) -Wall -c # For kernel modules in 2.6.x, can't have -ansi or -pedantic for? # CFLAGS gets picked up automatically by the 2.6.x build process # on Suse10.1 with kernel 2.6.16.13-4-default # CFLAGS = 'nothing' wasn't even allowed #CFLAGS = -Iinclude -I/lib/modules/`uname -r`/build/include \ -O2 -DMODULE -D__KERNEL__ $(OTHER_ARG) -Wall -c #CFLAGS = -Iinclude -O -Wall -ansi -pedantic # debugging: #CFLAGS = -Iinclude -O -Wall -pedantic -g CFLAGS += -I$(LDDINC) CFLAGS_fn = -Iinclude -O -Wall -ansi -pedantic -c # debugging: #CFLAGS_fn = -Iinclude -O -Wall -pedantic -g -c CFLAGS_app = -Iinclude -O -Wall -ansi -pedantic # ----------------------------------------------------------------------------- # - Targets, prerequisites and their build rules # ---------------------------------------------- # To compile the DataSet Device Driver Module for kernel 2.6.x module: echo $(obj-m) $(MAKE) -C $(KERNELDIR) M=$(PWD) LDDINC=$(PWD)/include modules # To compile the DataSet Device Driver Module for kernel <=2.4.x module_2.4: ${CC} ${CFLAGS_module} ds.c -o ds.o #include ~smagri/proj/dsdd/debug_targets # ----------------------------------------------------------------------------- # - misc commands # --------------- # \rm ds.o dsapp? clean: \rm -rf ds.o ds.ko .ds* .tmp* ds.mod.* clean1: \rm dscomm.o generic.o dsapp