Makefiles nochmals verbessert.
authorFlorian Pose <fp@igh-essen.com>
Fri, 06 Jan 2006 10:17:35 +0000
changeset 46 f2d7a73d2f32
parent 45 f525f7db2d90
child 47 ad5f969f263b
Makefiles nochmals verbessert.
Makefile
mini/Makefile
rt/Makefile
--- a/Makefile	Fri Jan 06 09:49:26 2006 +0000
+++ b/Makefile	Fri Jan 06 10:17:35 2006 +0000
@@ -1,4 +1,4 @@
-#----------------------------------------------------------------
+#------------------------------------------------------------------------------
 #
 #  Globales Makefile
 #
@@ -6,27 +6,30 @@
 #
 #  $Id$
 #
-#----------------------------------------------------------------
+#------------------------------------------------------------------------------
 
-CONFIG_FILE = ethercat.conf
+ifneq ($(KERNELRELEASE),)
 
-ifeq ($(CONFIG_FILE),$(wildcard $(CONFIG_FILE)))
-include $(CONFIG_FILE)
-endif
+#------------------------------------------------------------------------------
+# Kbuild-Abschnitt
 
-obj-m := drivers/ mini/
+obj-m := drivers/ rt/ mini/
 
-ifeq ($(MAKE_RT),yes)
-obj-m += rt/
-endif
+#------------------------------------------------------------------------------
 
-#----------------------------------------------------------------
+else
 
-all:
+#------------------------------------------------------------------------------
+# Default-Abschnitt
+
+include ethercat.conf
+
+modules:
 	$(MAKE) -C $(KERNELDIR) M=`pwd` modules
 
 clean:
 	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
+	rm -rvf */.tmp_versions
 
 doc docs:
 	doxygen Doxyfile
@@ -43,3 +46,5 @@
 	@echo "$(CONFIG_FILE) erstellt."
 
 #----------------------------------------------------------------
+
+endif
--- a/mini/Makefile	Fri Jan 06 09:49:26 2006 +0000
+++ b/mini/Makefile	Fri Jan 06 10:17:35 2006 +0000
@@ -24,17 +24,11 @@
 #----------------------------------------------------------------
 # Default-Abschnitt
 
-CONFIG_FILE = ../ethercat.conf
-PWD = $(shell pwd)
-
-
-include $(CONFIG_FILE) # Für KERNELDIR
-
-default:
-	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+modules:
+	$(MAKE) -C ..
 
 clean:
-	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
+	$(MAKE) -C .. clean
 
 #----------------------------------------------------------------
 
--- a/rt/Makefile	Fri Jan 06 09:49:26 2006 +0000
+++ b/rt/Makefile	Fri Jan 06 10:17:35 2006 +0000
@@ -1,81 +1,48 @@
-# Comment/uncomment the following line to disable/enable debugging
-#DEBUG = y
-
-
-# Add your debugging flag (or not) to CFLAGS
-ifeq ($(DEBUG),y)
-  DEBFLAGS = -O -g -DSHORT_DEBUG # "-O" is needed to expand inlines
-else
-  DEBFLAGS = -O2
-endif
-
-CFLAGS += $(DEBFLAGS)
-CFLAGS += -I.. 
-
-RTLIB = /vol/projekte/msr_messen_steuern_regeln/linux/kernel_space/rt_lib-4.0.0-2.6krnl
-
-#Suchpfad für die Dateien aus dem RT-Lib-Verzeichnis
-VPATH := $(RTLIB)/msr-core:$(RTLIB)/msr-control:$(RTLIB)/msr-hwdriver:$(RTLIB)/msr-math:$(RTLIB)/msr-misc:$(RTLIB)/msr-utils
-
-#Datei aus dem RT-Libverzeichnis für dies Projekt
-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
+#------------------------------------------------------------------------------
+#
+# Makefile Echtzeitmodule
+#
+# $Id$
+#
+#------------------------------------------------------------------------------
 
 ifneq ($(KERNELRELEASE),)
-# call from kernel build system
 
-
-EXTRA_CFLAGS := -I$(RTLIB)/msr-include -D_SIMULATION -I/usr/include -mhard-float
-
-#EXTRA_LDFLAGS :=  -L/usr/lib -lm
-
-msr_modul-y := msr_module.o \
-	msr_jitter.o \
-	rt_lib/msr-core/msr_lists.o \
-	rt_lib/msr-core/msr_main.o \
-	rt_lib/msr-core/msr_charbuf.o \
-	rt_lib/msr-core/msr_reg.o \
-	rt_lib/msr-core/msr_interpreter.o \
-	rt_lib/msr-core/msr_messages.o \
-	rt_lib/msr-core/msr_proc.o \
-	rt_lib/msr-core/msr_error_reg.o \
-	rt_lib/msr-utils/msr_utils.o \
-	rt_lib/msr-math/msr_base64.o \
-	libm.o 
-
+#------------------------------------------------------------------------------
+# Kbuild-Abschnitt
 
 obj-m	:= msr_modul.o
 
+msr_modul-objs := msr_module.o \
+		msr_jitter.o \
+		rt_lib/msr-core/msr_lists.o \
+		rt_lib/msr-core/msr_main.o \
+		rt_lib/msr-core/msr_charbuf.o \
+		rt_lib/msr-core/msr_reg.o \
+		rt_lib/msr-core/msr_interpreter.o \
+		rt_lib/msr-core/msr_messages.o \
+		rt_lib/msr-core/msr_proc.o \
+		rt_lib/msr-core/msr_error_reg.o \
+		rt_lib/msr-utils/msr_utils.o \
+		rt_lib/msr-math/msr_base64.o \
+		libm.o
 
+EXTRA_CFLAGS := -I $(src)/rt_lib/msr-include -D_SIMULATION \
+		-I/usr/include -mhard-float
+
+#------------------------------------------------------------------------------
 
 else
 
-
-KERNELDIR := /lib/modules/$(shell uname -r)/build
-PWD       := $(shell pwd)
-
-
-
+#------------------------------------------------------------------------------
+# Default-Abschnitt
 
 default:
-	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+	$(MAKE) -C ..
+
+clean:
+	$(MAKE) -C .. clean
+
+#------------------------------------------------------------------------------
 
 endif
-
-
-clean:
-	rm -f core .depend
-	rm -rf .tmp_versions
-	find -L -maxdepth 3 -name "*.o" -exec rm {} \;	
-	find -L -maxdepth 3 -name "*~" -exec rm {} \;	
-	find -L -maxdepth 3 -name "*.cmd" -exec rm {} \;	
-	find -L -maxdepth 3 -name "*.ko" -exec rm {} \;	
-	find -L -maxdepth 3 -name "*.mod.c" -exec rm {} \;	
-
-depend .depend dep:
-	$(CC) $(CFLAGS) -M *.c > .depend
-
-
-
-ifeq (.depend,$(wildcard .depend))
-include .depend
-endif