1 ################################################################# |
1 #---------------------------------------------------------------- |
2 # |
2 # |
3 # Makefile |
3 # Makefile |
4 # |
4 # |
5 # IgH EtherCAT-Treiber |
5 # IgH EtherCAT-Treiber |
6 # |
6 # |
7 # $Date$ |
7 # $Id$ |
8 # $Author$ |
|
9 # |
8 # |
10 ################################################################# |
9 #---------------------------------------------------------------- |
11 |
10 |
12 #KERNELDIR=/usr/src/linux |
11 KERNEL_DIRS_FILE = ../kerneldirs.mk |
13 #KERNELDIR=/home/rich/linux-2.4.20.CX1100-rthal5 |
|
14 #KERNELDIR=./linux-2.4.20.CX1100-rthal5 |
|
15 |
12 |
16 #IgH |
13 ifeq ($(KERNEL_DIRS_FILE),$(wildcard $(KERNEL_DIRS_FILE))) |
|
14 include $(KERNEL_DIRS_FILE) |
|
15 else |
17 KERNELDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/linux-2.4.20.CX1100-rthal5 |
16 KERNELDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/linux-2.4.20.CX1100-rthal5 |
18 RTAIDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/rtai-24.1.13 |
17 RTAIDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/rtai-24.1.13 |
19 RTLIBDIR = rt_lib |
18 RTLIBDIR = rt_lib |
|
19 endif |
20 |
20 |
21 #euler-nottuln |
21 ifeq (.depend,$(wildcard .depend)) |
22 #KERNELDIR = /usr/src/linux |
22 include .depend |
23 #RTAIDIR = /usr/src/rtai |
23 endif |
24 |
|
25 #patra |
|
26 #KERNELDIR = /usr/src/linux-2.4.20.CX1100-rthal5 |
|
27 #RTAIDIR = /usr/src/rtai-24.1.13 |
|
28 |
|
29 #include $(KERNELDIR)/.config |
|
30 |
|
31 ECAT_8139_OBJ = drv_8139too.o ec_device.o ec_master.o \ |
|
32 ec_slave.o ec_command.o ec_types.o |
|
33 |
|
34 |
24 |
35 CFLAGS = -O2 -Wall -Wuninitialized -D__KERNEL__ -DMODULE \ |
25 CFLAGS = -O2 -Wall -Wuninitialized -D__KERNEL__ -DMODULE \ |
36 -I$(KERNELDIR)/include -D_RTAI -I$(RTAIDIR)/include \ |
26 -I$(KERNELDIR)/include -D_RTAI -I$(RTAIDIR)/include \ |
37 -I$(RTLIBDIR)/msr-include |
27 -I$(RTLIBDIR)/msr-include |
38 |
28 |
39 ifdef CONFIG_SMP |
29 ifdef CONFIG_SMP |
40 CFLAGS += -D__SMP__ -DSMP |
30 CFLAGS += -D__SMP__ -DSMP |
41 endif |
31 endif |
42 |
32 |
43 ################################################################# |
33 MODULE = ecat_8139too.o |
|
34 OBJ = drv_8139too.o ec_device.o ec_master.o ec_slave.o ec_command.o ec_types.o |
|
35 SRC = $(OBJ:.o=.c) |
44 |
36 |
45 all: .depend ecat_8139too.o |
37 #---------------------------------------------------------------- |
46 |
38 |
47 ecat_8139too.o: $(ECAT_8139_OBJ) |
39 all: .output_dirs .depend $(MODULE) |
48 $(LD) -r $(ECAT_8139_OBJ) -o $@ |
40 |
|
41 $(MODULE): $(OBJ) |
|
42 $(LD) -r $(OBJ) -o $@ |
49 |
43 |
50 .c.o: |
44 .c.o: |
51 $(CC) $(CFLAGS) -c -o $@ $< |
45 $(CC) $(CFLAGS) -c $< -o $@ |
52 |
46 |
53 doc docs: |
47 doc docs: |
54 $(MAKE) -C .. doc |
48 $(MAKE) -C .. doc |
55 |
49 |
56 ################################################################# |
50 .output_dirs: |
|
51 @echo "x-- Directories -------------" |
|
52 @echo "| Kernel $(KERNELDIR)" |
|
53 @echo "| RTAI $(RTAIDIR)" |
|
54 @echo "| RT_lib $(RTLIBDIR)" |
|
55 @echo "x----------------------------" |
57 |
56 |
58 .depend: |
57 .depend: |
59 $(CC) $(CFLAGS) -M *.c > .depend |
58 $(CC) $(CFLAGS) -M $(SRC) > .depend |
60 |
|
61 ifeq (.depend,$(wildcard .depend)) |
|
62 include .depend |
|
63 endif |
|
64 |
|
65 ################################################################# |
|
66 |
59 |
67 clean: |
60 clean: |
68 rm -f *.o *~ core .depend |
61 rm -f *.o *~ core .depend |
69 |
62 |
70 ################################################################# |
63 #---------------------------------------------------------------- |
71 |
|