1 | # $Header$ |
---|
2 | # |
---|
3 | # $Id$ |
---|
4 | # |
---|
5 | # $Log$ |
---|
6 | # Revision 1.1.1.1 2009/06/08 14:52:43 joel |
---|
7 | # Initial import. |
---|
8 | # |
---|
9 | # |
---|
10 | |
---|
11 | MAJOR = 115 |
---|
12 | |
---|
13 | CFLAGS += -DMAJOR_NUM=$(MAJOR) |
---|
14 | |
---|
15 | # Test Makefile |
---|
16 | |
---|
17 | ifneq ($(KERNELRELEASE),) |
---|
18 | obj-m := pcmmio.o |
---|
19 | else |
---|
20 | KERNELDIR ?= /lib/modules/$(shell uname -r)/build |
---|
21 | PWD := $(shell pwd) |
---|
22 | |
---|
23 | default: |
---|
24 | $(MAKE) -C $(KERNELDIR) M=$(PWD) modules |
---|
25 | endif |
---|
26 | |
---|
27 | mio_io.o: mio_io.c mio_io.h Makefile |
---|
28 | gcc -c $(CFLAGS) mio_io.c |
---|
29 | |
---|
30 | nodes: |
---|
31 | mknod pcmmio c $(MAJOR) 0 |
---|
32 | chmod a+rw pcmmio |
---|
33 | |
---|
34 | all: default nodes poll flash getvolt dacout getall repeat buffered dacbuff |
---|
35 | |
---|
36 | dacbuff: dacbuff.c mio_io.o mio_io.h Makefile kbhit.c |
---|
37 | gcc $(CFLAGS) -static dacbuff.c kbhit.c mio_io.o -o dacbuff |
---|
38 | chmod a+x dacbuff |
---|
39 | |
---|
40 | buffered: buffered.c mio_io.o mio_io.h Makefile kbhit.c |
---|
41 | gcc $(CFLAGS) -static buffered.c kbhit.c mio_io.o -o buffered |
---|
42 | chmod a+x buffered |
---|
43 | |
---|
44 | repeat: repeat.c mio_io.o mio_io.h Makefile kbhit.c |
---|
45 | gcc $(CFLAGS) -D_REENTRANT -static repeat.c kbhit.c mio_io.o -o repeat -lpthread |
---|
46 | chmod a+x repeat |
---|
47 | |
---|
48 | flash: flash.c mio_io.h kbhit.c mio_io.o Makefile |
---|
49 | gcc $(CFLAGS) -static flash.c kbhit.c mio_io.o -o flash |
---|
50 | chmod a+x flash |
---|
51 | |
---|
52 | getvolt: getvolt.c mio_io.h mio_io.o Makefile |
---|
53 | gcc $(CFLAGS) -static getvolt.c mio_io.o -o getvolt |
---|
54 | chmod a+x getvolt |
---|
55 | |
---|
56 | getall: getall.c mio_io.h mio_io.o Makefile |
---|
57 | gcc $(CFLAGS) -static getall.c mio_io.o -o getall |
---|
58 | chmod a+x getall |
---|
59 | |
---|
60 | dacout: dacout.c mio_io.h mio_io.o Makefile |
---|
61 | gcc $(CFLAGS) -static dacout.c mio_io.o -o dacout |
---|
62 | chmod a+x dacout |
---|
63 | |
---|
64 | poll: poll.c mio_io.o mio_io.h Makefile |
---|
65 | gcc $(CFLAGS) -D_REENTRANT -static poll.c mio_io.o -o poll -lpthread |
---|
66 | chmod a+x poll |
---|
67 | |
---|
68 | clean: |
---|
69 | rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions pcmmio |
---|
70 | |
---|
71 | |
---|