diff --git a/Makefile b/Makefile index d7037266c26886b92cf19143cccae3d2a1a99c8a..c0248076ea6c50b83b50cda3a08562923a7a1e36 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,11 @@ # #---------------------------------------------------------------- -KERNEL_DIRS_FILE = kerneldirs.mk +CONFIG_FILE = ethercat.conf + +ifeq ($(CONFIG_FILE),$(wildcard $(CONFIG_FILE))) +include $(CONFIG_FILE) +endif #---------------------------------------------------------------- @@ -20,23 +24,38 @@ doc docs: .drivers: $(MAKE) -C drivers +ifeq ($(MAKE_RT),yes) .rt: $(MAKE) -C rt +else +.rt: + @echo "Skipping Real-Time." +endif +ifeq ($(MAKE_RS232),yes) .rs232dbg: $(MAKE) -C rs232dbg +else +.rs232dbg: + @echo "Skipping rs232dbg." +endif .mini: $(MAKE) -C mini -kerneldirs: - @echo "# EtherCAT Standard-Kernel-Verzeichnisse" > $(KERNEL_DIRS_FILE) - @echo >> $(KERNEL_DIRS_FILE) - @echo "KERNELDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/linux-2.4.20.CX1100-rthal5" >> $(KERNEL_DIRS_FILE) - @echo "RTAIDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/rtai-24.1.13" >> $(KERNEL_DIRS_FILE) - @echo "RTLIBDIR = rt_lib" >> $(KERNEL_DIRS_FILE) - @echo >> $(KERNEL_DIRS_FILE) - @echo "$(KERNEL_DIRS_FILE) erstellt." +config $(CONFIG_FILE): + @echo "# EtherCAT Konfigurationsdatei" > $(CONFIG_FILE) + @echo >> $(CONFIG_FILE) + @echo "KERNELDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/linux-2.4.20.CX1100-rthal5" >> $(CONFIG_FILE) + @echo "RTAIDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/rtai-24.1.13" >> $(CONFIG_FILE) + @echo "RTLIBDIR = rt_lib" >> $(CONFIG_FILE) + @echo >> $(CONFIG_FILE) + @echo "GCC_SYSTEMDIR = /usr/lib/gcc-lib/i486-suse-linux/3.3/include" >> $(CONFIG_FILE) + @echo >> $(CONFIG_FILE) + @echo "MAKE_RT = yes" >> $(CONFIG_FILE) + @echo "MAKE_RS232 = yes" >> $(CONFIG_FILE) + @echo >> $(CONFIG_FILE) + @echo "$(CONFIG_FILE) erstellt." clean: $(MAKE) -C rt clean diff --git a/drivers/Makefile b/drivers/Makefile index e763d914c784979425b6f1d624eb5cb38ca618f9..1d99d00c86ab0dc207f4d67e82685c7369210839 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -8,18 +8,20 @@ # #---------------------------------------------------------------- -KERNEL_DIRS_FILE = ../kerneldirs.mk +CONFIG_FILE = ../ethercat.conf -ifeq ($(KERNEL_DIRS_FILE),$(wildcard $(KERNEL_DIRS_FILE))) -include $(KERNEL_DIRS_FILE) +ifeq ($(CONFIG_FILE),$(wildcard $(CONFIG_FILE))) +include $(CONFIG_FILE) else KERNELDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/linux-2.4.20.CX1100-rthal5 RTAIDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/rtai-24.1.13 -RTLIBDIR = rt_lib +RTLIBDIR = rt_lib +GCC_SYSTEMDIR = /usr/lib/gcc-lib/i486-suse-linux/3.3/include endif CFLAGS = -O2 -Wall -Wuninitialized -D__KERNEL__ \ - -DMODULE -I$(KERNELDIR)/include + -DMODULE -I$(KERNELDIR)/include -nostdinc \ + -isystem $(GCC_SYSTEMDIR) ifdef CONFIG_SMP CFLAGS += -D__SMP__ -DSMP diff --git a/mini/Makefile b/mini/Makefile index 39d4561b3c1377eb061fe05a0af3dad3c9e3f9fb..bab508d6406f1d461ed032d89db3e517f979c4ae 100644 --- a/mini/Makefile +++ b/mini/Makefile @@ -8,14 +8,14 @@ # #---------------------------------------------------------------- -KERNEL_DIRS_FILE = ../kerneldirs.mk +CONFIG_FILE = ../ethercat.conf -ifeq ($(KERNEL_DIRS_FILE),$(wildcard $(KERNEL_DIRS_FILE))) -include $(KERNEL_DIRS_FILE) +ifeq ($(CONFIG_FILE),$(wildcard $(CONFIG_FILE))) +include $(CONFIG_FILE) else KERNELDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/linux-2.4.20.CX1100-rthal5 RTAIDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/rtai-24.1.13 -RTLIBDIR = rt_lib +RTLIBDIR = rt_lib endif CFLAGS = -O2 -Wall -Wuninitialized -D__KERNEL__ \ diff --git a/rs232dbg/Makefile b/rs232dbg/Makefile index f7a7e16bccac64bac0da3ea2c4a957dcd923111f..af82a892f5658fd68aa3d5fcc75560ecdb4e7b00 100644 --- a/rs232dbg/Makefile +++ b/rs232dbg/Makefile @@ -8,14 +8,14 @@ # #---------------------------------------------------------------- -KERNEL_DIRS_FILE = ../kerneldirs.mk +CONFIG_FILE = ../kerneldirs.mk -ifeq ($(KERNEL_DIRS_FILE),$(wildcard $(KERNEL_DIRS_FILE))) -include $(KERNEL_DIRS_FILE) +ifeq ($(CONFIG_FILE),$(wildcard $(CONFIG_FILE))) +include $(CONFIG_FILE) else KERNELDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/linux-2.4.20.CX1100-rthal5 RTAIDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/rtai-24.1.13 -RTLIBDIR = rt_lib +RTLIBDIR = rt_lib endif CFLAGS = -O2 -Wall -Wuninitialized -D__KERNEL__ -DMODULE \ diff --git a/rt/Makefile b/rt/Makefile index 610b2163a589bf35818ef89dc5f8b061f5267564..dad5b39db83328f3eb419adea3f60c658573ad95 100644 --- a/rt/Makefile +++ b/rt/Makefile @@ -8,14 +8,14 @@ # #---------------------------------------------------------------- -KERNEL_DIRS_FILE = ../kerneldirs.mk +CONFIG_FILE = ../ethercat.conf -ifeq ($(KERNEL_DIRS_FILE),$(wildcard $(KERNEL_DIRS_FILE))) -include $(KERNEL_DIRS_FILE) +ifeq ($(CONFIG_FILE),$(wildcard $(CONFIG_FILE))) +include $(CONFIG_FILE) else KERNELDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/linux-2.4.20.CX1100-rthal5 RTAIDIR = /vol/projekte/msr_messen_steuern_regeln/linux/kernel/2.4.20/include/rtai-24.1.13 -RTLIBDIR = rt_lib +RTLIBDIR = rt_lib endif CFLAGS = -O2 -Wall -Wuninitialized -D__KERNEL__ -DMODULE -DSERIALDEBUG -DMSR_NO_PROC -I$(KERNELDIR)/include -D_RTAI -I$(RTAIDIR)/include -I$(RTLIBDIR)/msr-include