drivers/Makefile
branchkernel2.6
changeset 22 e8c2cd004e0b
parent 16 f04e93b8af0f
child 27 d75ef6b46e33
equal deleted inserted replaced
21:ec912b010528 22:e8c2cd004e0b
     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 GCC_SYSTEMDIR = /usr/lib/gcc-lib/i486-suse-linux/3.3/include
       
    20 endif
       
    21 
    15 
    22 CFLAGS = -O2 -Wall -Wuninitialized -D__KERNEL__ \
    16 obj-m := 8139too-ecat.o
    23 	-DMODULE -I$(KERNELDIR)/include -nostdinc \
       
    24 	-isystem $(GCC_SYSTEMDIR)
       
    25 
    17 
    26 ifdef CONFIG_SMP
    18 8139too-ecat-objs := 8139too.o ec_device.o ec_master.o \
    27 	CFLAGS += -D__SMP__ -DSMP
    19 					ec_slave.o ec_command.o ec_types.o
    28 endif
       
    29 
       
    30 MODULE = ecat_8139too.o
       
    31 OBJ = drv_8139too.o ec_device.o ec_master.o \
       
    32 	ec_slave.o ec_command.o ec_types.o
       
    33 SRC = $(OBJ:.o=.c)
       
    34 
    20 
    35 #----------------------------------------------------------------
    21 #----------------------------------------------------------------
    36 
    22 
    37 all: .output_dirs depend $(MODULE)
    23 else
    38 
    24 
    39 $(MODULE): $(OBJ)
    25 #----------------------------------------------------------------
    40 	$(LD) -r $(OBJ) -o $@
    26 # Default-Abschnitt
    41 
    27 
    42 .c.o:
    28 CONFIG_FILE = ../ethercat.conf
    43 	$(CC) $(CFLAGS) -c $< -o $@
    29 PWD = $(shell pwd)
    44 
    30 
    45 doc docs:
    31 include $(CONFIG_FILE) # Für KERNELDIR
    46 	$(MAKE) -C .. doc
       
    47 
    32 
    48 .output_dirs:
    33 default:
    49 	@echo "x-- Directories -------------"
    34 	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
    50 	@echo "| Kernel $(KERNELDIR)"
       
    51 	@echo "| RTAI   $(RTAIDIR)"
       
    52 	@echo "| RT_lib $(RTLIBDIR)"
       
    53 	@echo "x----------------------------"
       
    54 
       
    55 .depend depend dep:
       
    56 	$(CC) $(CFLAGS) -M $(SRC) > .depend
       
    57 
    35 
    58 clean:
    36 clean:
    59 	rm -f *.o *~ core .depend
    37 	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
    60 
    38 
    61 #----------------------------------------------------------------
    39 #----------------------------------------------------------------
    62 
    40 
    63 ifeq (.depend,$(wildcard .depend))
       
    64 include .depend
       
    65 endif
    41 endif
    66 
       
    67 #----------------------------------------------------------------