|
1 #---------------------------------------------------------------- |
|
2 # |
|
3 # Makefile |
|
4 # |
|
5 # Kernel-Debugging über die serielle Schnittstelle |
|
6 # |
|
7 # $Id$ |
|
8 # |
|
9 #---------------------------------------------------------------- |
1 |
10 |
2 MSRDIR = /vol/projekte/msr_messen_steuern_regeln |
11 KERNEL_DIRS_FILE = ../kerneldirs.mk |
3 ECATDIR = $(MSRDIR)/ethercat |
|
4 |
12 |
5 KERNELDIR = $(ECATDIR)/linux-2.4.20.CX1100-rthal5-kdb |
13 ifeq ($(KERNEL_DIRS_FILE),$(wildcard $(KERNEL_DIRS_FILE))) |
6 RTAIDIR = $(MSRDIR)/linux/kernel/2.4.20/include/rtai-24.1.13 |
14 include $(KERNEL_DIRS_FILE) |
|
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 |
|
21 ifeq (.depend,$(wildcard .depend)) |
|
22 include .depend |
|
23 endif |
7 |
24 |
8 CFLAGS = -O2 -Wall -Wuninitialized -D__KERNEL__ -DMODULE \ |
25 CFLAGS = -O2 -Wall -Wuninitialized -D__KERNEL__ -DMODULE \ |
9 -I$(KERNELDIR)/include -D_RTAI -I$(RTAIDIR)/include -I$(RTLIBDIR)/msr-include |
26 -I$(KERNELDIR)/include -D_RTAI -I$(RTAIDIR)/include -I$(RTLIBDIR)/msr-include |
10 |
27 |
11 TARGET = sdbg |
28 MODULE = sdbg.o |
12 MODULE = $(TARGET).o |
29 SRC = rs232dbg.c aip_com.c |
|
30 OBJ = $(SRC:.c=.o) |
13 |
31 |
14 SRC = rs232dbg.c aip_com.c |
32 #---------------------------------------------------------------- |
15 |
33 |
16 ALLSRC = $(SRC) |
34 all: .output_dirs .depend $(MODULE) Makefile |
17 |
35 |
18 OBJS = $(ALLSRC:.c=.o) |
36 $(MODULE): $(OBJ) |
|
37 $(LD) -r $(OBJ) -o $@ |
19 |
38 |
20 all: .depend $(TARGET).o Makefile |
39 .c.o: |
|
40 $(CC) -c $(CFLAGS) $< -o $@ |
21 |
41 |
22 $(TARGET).o: $(SRC:.c=.o) $(RTSRC:.c=.o) |
42 .output_dirs: |
23 $(LD) -r $(OBJS) -o $@ $(LDFLAGS) |
43 @echo "x-- Directories -------------" |
|
44 @echo "| Kernel $(KERNELDIR)" |
|
45 @echo "| RTAI $(RTAIDIR)" |
|
46 @echo "| RT_lib $(RTLIBDIR)" |
|
47 @echo "x----------------------------" |
24 |
48 |
25 install: msr_modul.o |
49 depend .depend dep: |
26 lsmod | grep cif-rtai >/dev/null 2>&1 && sudo rmmod msr_modul || true |
50 $(CC) $(CFLAGS) -M $(SRC) > .depend |
27 sudo insmod msr_modul.o |
|
28 |
51 |
29 clean: |
52 clean: |
30 rm -f *.o *~ core .depend |
53 rm -f *.o *~ core .depend |
31 |
54 |
32 depend .depend dep: |
55 #---------------------------------------------------------------- |
33 $(CC) $(CFLAGS) -M *.c > $@ |
|
34 |
|
35 ifeq (.depend,$(wildcard .depend)) |
|
36 include .depend |
|
37 endif |
|