Makefile
changeset 3 fc24e3b47731
parent 0 c9b8efdb5369
equal deleted inserted replaced
2:3345048104fc 3:fc24e3b47731
     4 # $make           	generates me8100.o which is the driver module
     4 # $make           	generates me8100.o which is the driver module
     5 # $make test8100   	generates the executable test8100
     5 # $make test8100   	generates the executable test8100
     6 # $make test8100i  	generates the executable test8100i
     6 # $make test8100i  	generates the executable test8100i
     7 # $make clean     	deletes all files including *.o and *~ 
     7 # $make clean     	deletes all files including *.o and *~ 
     8 
     8 
     9 me8100.o:me8100.c me8100.h
     9 # KERNEL_DIR should be set in environment
    10 	gcc -c me8100.c -Wall -O
    10 #KERNEL_DIR = /usr/src/linux
    11 
    11 
    12 test8100:test8100.o
    12 SUBDIRS = me8100_test_dio me8100_test_int
    13 	gcc -o test8100 test8100.o 
       
    14 
    13 
    15 test8100.o:test8100.c me8100.h
    14 CPPFLAGS += -I$(KERNEL_DIR)/include
    16 	gcc -c test8100.c -Wall -O
    15 CFLAGS += -O -Wall
    17 
    16 
    18 test8100i:test8100i.o
    17 .PHONY:	all clean
    19 	gcc -o test8100i test8100i.o 
       
    20 
    18 
    21 test8100i.o:test8100i.c me8100.h
    19 all:	me8100.o 
    22 	gcc -c test8100i.c -Wall -O
    20 	for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
       
    21 
       
    22 tags:	*.c *.h
       
    23 	ctags $^
       
    24 
       
    25 # Dependencies
       
    26 me8100.o: me8100.c me8100.h
    23 
    27 
    24 clean:
    28 clean:
    25 	rm -f *.o *~
    29 	rm -f *.o *~ tags
       
    30 	for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done