6 # |
6 # |
7 # $Id$ |
7 # $Id$ |
8 # |
8 # |
9 #---------------------------------------------------------------- |
9 #---------------------------------------------------------------- |
10 |
10 |
11 CONFIG_FILE = ../ethercat.conf |
11 ifneq ($(KERNELRELEASE),) |
12 |
12 |
13 ifeq ($(CONFIG_FILE),$(wildcard $(CONFIG_FILE))) |
13 #---------------------------------------------------------------- |
14 include $(CONFIG_FILE) |
14 # Kbuild-Abschnitt |
15 else |
|
16 KERNELDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/linux-2.4.20.CX1100-rthal5 |
|
17 RTAIDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/rtai-24.1.13 |
|
18 RTLIBDIR = rt_lib |
|
19 endif |
|
20 |
15 |
21 CFLAGS = -O2 -Wall -Wuninitialized -D__KERNEL__ \ |
16 obj-m := ec_mini_mod.o |
22 -DMODULE -I$(KERNELDIR)/include |
|
23 |
17 |
24 MODULE = ec_mini_mod.o |
18 ec_mini_mod-objs := ec_mini.o |
25 SRC = ec_mini.c |
|
26 OBJ = $(SRC:.c=.o) |
|
27 |
19 |
28 #---------------------------------------------------------------- |
20 #---------------------------------------------------------------- |
29 |
21 |
30 all: .output_dirs .depend Makefile $(MODULE) |
22 else |
31 |
23 |
32 $(MODULE): $(OBJ) |
24 #---------------------------------------------------------------- |
33 $(LD) -r $(OBJ) -o $@ |
25 # Default-Abschnitt |
34 |
26 |
35 .output_dirs: |
27 CONFIG_FILE = ../ethercat.conf |
36 @echo "x-- Directories -------------" |
28 PWD = $(shell pwd) |
37 @echo "| Kernel $(KERNELDIR)" |
|
38 @echo "| RTAI $(RTAIDIR)" |
|
39 @echo "| RT_lib $(RTLIBDIR)" |
|
40 @echo "x----------------------------" |
|
41 |
29 |
42 depend .depend dep: |
30 include $(CONFIG_FILE) # Für KERNELDIR |
43 $(CC) $(CFLAGS) -M $(SRC) > .depend |
31 |
|
32 default: |
|
33 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules |
44 |
34 |
45 clean: |
35 clean: |
46 rm -f *.o *~ core .depend |
36 $(MAKE) -C $(KERNELDIR) M=$(PWD) clean |
47 |
37 |
48 #---------------------------------------------------------------- |
38 #---------------------------------------------------------------- |
49 |
39 |
50 ifeq (.depend,$(wildcard .depend)) |
|
51 include .depend |
|
52 endif |
40 endif |
53 |
|
54 #---------------------------------------------------------------- |
|