1 # Comment/uncomment the following line to disable/enable debugging |
1 #------------------------------------------------------------------------------ |
2 #DEBUG = y |
2 # |
3 |
3 # Makefile Echtzeitmodule |
4 |
4 # |
5 # Add your debugging flag (or not) to CFLAGS |
5 # $Id$ |
6 ifeq ($(DEBUG),y) |
6 # |
7 DEBFLAGS = -O -g -DSHORT_DEBUG # "-O" is needed to expand inlines |
7 #------------------------------------------------------------------------------ |
8 else |
|
9 DEBFLAGS = -O2 |
|
10 endif |
|
11 |
|
12 CFLAGS += $(DEBFLAGS) |
|
13 CFLAGS += -I.. |
|
14 |
|
15 RTLIB = /vol/projekte/msr_messen_steuern_regeln/linux/kernel_space/rt_lib-4.0.0-2.6krnl |
|
16 |
|
17 #Suchpfad für die Dateien aus dem RT-Lib-Verzeichnis |
|
18 VPATH := $(RTLIB)/msr-core:$(RTLIB)/msr-control:$(RTLIB)/msr-hwdriver:$(RTLIB)/msr-math:$(RTLIB)/msr-misc:$(RTLIB)/msr-utils |
|
19 |
|
20 #Datei aus dem RT-Libverzeichnis für dies Projekt |
|
21 RTSRC := msr_main.o msr_lists.o msr_charbuf.o msr_reg.o msr_interpreter.o msr_utils.o msr_messages.o msr_functiongen.o msr_base64.o msr_watchdog.o msr_proc.o msr_error_reg.o |
|
22 |
8 |
23 ifneq ($(KERNELRELEASE),) |
9 ifneq ($(KERNELRELEASE),) |
24 # call from kernel build system |
|
25 |
10 |
26 |
11 #------------------------------------------------------------------------------ |
27 EXTRA_CFLAGS := -I$(RTLIB)/msr-include -D_SIMULATION -I/usr/include -mhard-float |
12 # Kbuild-Abschnitt |
28 |
|
29 #EXTRA_LDFLAGS := -L/usr/lib -lm |
|
30 |
|
31 msr_modul-y := msr_module.o \ |
|
32 msr_jitter.o \ |
|
33 rt_lib/msr-core/msr_lists.o \ |
|
34 rt_lib/msr-core/msr_main.o \ |
|
35 rt_lib/msr-core/msr_charbuf.o \ |
|
36 rt_lib/msr-core/msr_reg.o \ |
|
37 rt_lib/msr-core/msr_interpreter.o \ |
|
38 rt_lib/msr-core/msr_messages.o \ |
|
39 rt_lib/msr-core/msr_proc.o \ |
|
40 rt_lib/msr-core/msr_error_reg.o \ |
|
41 rt_lib/msr-utils/msr_utils.o \ |
|
42 rt_lib/msr-math/msr_base64.o \ |
|
43 libm.o |
|
44 |
|
45 |
13 |
46 obj-m := msr_modul.o |
14 obj-m := msr_modul.o |
47 |
15 |
|
16 msr_modul-objs := msr_module.o \ |
|
17 msr_jitter.o \ |
|
18 rt_lib/msr-core/msr_lists.o \ |
|
19 rt_lib/msr-core/msr_main.o \ |
|
20 rt_lib/msr-core/msr_charbuf.o \ |
|
21 rt_lib/msr-core/msr_reg.o \ |
|
22 rt_lib/msr-core/msr_interpreter.o \ |
|
23 rt_lib/msr-core/msr_messages.o \ |
|
24 rt_lib/msr-core/msr_proc.o \ |
|
25 rt_lib/msr-core/msr_error_reg.o \ |
|
26 rt_lib/msr-utils/msr_utils.o \ |
|
27 rt_lib/msr-math/msr_base64.o \ |
|
28 libm.o |
48 |
29 |
|
30 EXTRA_CFLAGS := -I $(src)/rt_lib/msr-include -D_SIMULATION \ |
|
31 -I/usr/include -mhard-float |
|
32 |
|
33 #------------------------------------------------------------------------------ |
49 |
34 |
50 else |
35 else |
51 |
36 |
52 |
37 #------------------------------------------------------------------------------ |
53 KERNELDIR := /lib/modules/$(shell uname -r)/build |
38 # Default-Abschnitt |
54 PWD := $(shell pwd) |
|
55 |
|
56 |
|
57 |
|
58 |
39 |
59 default: |
40 default: |
60 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules |
41 $(MAKE) -C .. |
|
42 |
|
43 clean: |
|
44 $(MAKE) -C .. clean |
|
45 |
|
46 #------------------------------------------------------------------------------ |
61 |
47 |
62 endif |
48 endif |
63 |
|
64 |
|
65 clean: |
|
66 rm -f core .depend |
|
67 rm -rf .tmp_versions |
|
68 find -L -maxdepth 3 -name "*.o" -exec rm {} \; |
|
69 find -L -maxdepth 3 -name "*~" -exec rm {} \; |
|
70 find -L -maxdepth 3 -name "*.cmd" -exec rm {} \; |
|
71 find -L -maxdepth 3 -name "*.ko" -exec rm {} \; |
|
72 find -L -maxdepth 3 -name "*.mod.c" -exec rm {} \; |
|
73 |
|
74 depend .depend dep: |
|
75 $(CC) $(CFLAGS) -M *.c > .depend |
|
76 |
|
77 |
|
78 |
|
79 ifeq (.depend,$(wildcard .depend)) |
|
80 include .depend |
|
81 endif |
|