mini/Makefile
changeset 9 144d220c8ca0
parent 5 6f2508af550c
child 10 67c739ece5d5
equal deleted inserted replaced
8:f2ebe943c686 9:144d220c8ca0
     6 #
     6 #
     7 #  $Id$
     7 #  $Id$
     8 #
     8 #
     9 #----------------------------------------------------------------
     9 #----------------------------------------------------------------
    10 
    10 
    11 EC_DIR = /vol/projekte/msr_messen_steuern_regeln/ethercat
    11 KERNEL_DIRS_FILE = ../kerneldirs.mk
    12 
    12 
    13 #KERNELDIR = $(EC_DIR)/linux-2.4.20.CX1100-rthal5-kdb
    13 ifeq ($(KERNEL_DIRS_FILE),$(wildcard $(KERNEL_DIRS_FILE)))
    14 KERNELDIR = $(EC_DIR)/linux-2.4.20-kdb
    14 include $(KERNEL_DIRS_FILE)
    15 #KERNELDIR = /usr/src/linux
    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
    16 
    24 
    17 CFLAGS = -O2 -Wall -Wuninitialized -D__KERNEL__ \
    25 CFLAGS = -O2 -Wall -Wuninitialized -D__KERNEL__ \
    18 	-DMODULE -I$(KERNELDIR)/include
    26 	-DMODULE -I$(KERNELDIR)/include
    19 
    27 
    20 MODULE = ec_mini_mod.o
    28 MODULE = ec_mini_mod.o
    21 
       
    22 SRC = ec_mini.c
    29 SRC = ec_mini.c
    23 OBJ = $(SRC:.c=.o)
    30 OBJ = $(SRC:.c=.o)
    24 
    31 
    25 #----------------------------------------------------------------
    32 #----------------------------------------------------------------
    26 
    33 
    27 all: .depend Makefile $(MODULE)
    34 all: .output_dirs .depend Makefile $(MODULE)
    28 
    35 
    29 $(MODULE): $(OBJ)
    36 $(MODULE): $(OBJ)
    30 	$(LD) -r $(OBJ) -o $@
    37 	$(LD) -r $(OBJ) -o $@
    31 
    38 
    32 #----------------------------------------------------------------
    39 .output_dirs:
       
    40 	@echo "x-- Directories -------------"
       
    41 	@echo "| Kernel $(KERNELDIR)"
       
    42 	@echo "| RTAI   $(RTAIDIR)"
       
    43 	@echo "| RT_lib $(RTLIBDIR)"
       
    44 	@echo "x----------------------------"
    33 
    45 
    34 depend .depend dep:
    46 depend .depend dep:
    35 	$(CC) $(CFLAGS) -M $(SRC) > .depend
    47 	$(CC) $(CFLAGS) -M $(SRC) > .depend
    36 
       
    37 ifeq (.depend,$(wildcard .depend))
       
    38 include .depend
       
    39 endif
       
    40 
       
    41 #----------------------------------------------------------------
       
    42 
    48 
    43 clean:
    49 clean:
    44 	rm -f *.o *~ core .depend
    50 	rm -f *.o *~ core .depend
    45 
    51 
    46 #----------------------------------------------------------------
    52 #----------------------------------------------------------------