Makefile
changeset 169 b3ecbec2c487
parent 167 37c65411b411
child 180 786d4cba38fb
equal deleted inserted replaced
168:8505cc1ad3ce 169:b3ecbec2c487
     1 #------------------------------------------------------------------------------
     1 #------------------------------------------------------------------------------
     2 #
     2 #
     3 #  Globales Makefile
     3 #  EtherCAT Makefile
     4 #
       
     5 #  IgH EtherCAT-Treiber
       
     6 #
     4 #
     7 #  $Id$
     5 #  $Id$
     8 #
     6 #
     9 #------------------------------------------------------------------------------
     7 #------------------------------------------------------------------------------
    10 
     8 
    11 ifneq ($(KERNELRELEASE),)
     9 ifneq ($(KERNELRELEASE),)
    12 
    10 
    13 #------------------------------------------------------------------------------
    11 #------------------------------------------------------------------------------
    14 # Kbuild-Abschnitt
    12 # kbuild section
    15 
    13 
    16 obj-m := master/ devices/
    14 obj-m := master/ devices/
    17 
    15 
    18 #------------------------------------------------------------------------------
    16 #------------------------------------------------------------------------------
    19 
    17 
    20 else
    18 else
    21 
    19 
    22 #------------------------------------------------------------------------------
    20 #------------------------------------------------------------------------------
    23 # Default-Abschnitt
    21 # default section
    24 
    22 
    25 ifneq ($(wildcard ethercat.conf),)
    23 ifneq ($(wildcard ethercat.conf),)
    26 include ethercat.conf
    24 include ethercat.conf
    27 else
    25 else
    28 KERNELDIR := /usr/src/linux
    26 KERNEL := `uname -r`
    29 INSTALLDIR := /opt/ethercat
    27 DEVICEINDEX := 99
    30 endif
    28 endif
       
    29 
       
    30 KERNELDIR := /lib/modules/$(KERNEL)/build
    31 
    31 
    32 modules:
    32 modules:
    33 	$(MAKE) -C $(KERNELDIR) M=`pwd`
    33 	$(MAKE) -C $(KERNELDIR) M=`pwd`
    34 
    34 
    35 clean:
    35 clean:
    36 	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
    36 	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
    37 
    37 
    38 install:
    38 install:
    39 	@./install.sh $(INSTALLDIR)
    39 	@./install.sh $(KERNEL) $(DEVICEINDEX)
    40 
    40 
    41 #------------------------------------------------------------------------------
    41 #------------------------------------------------------------------------------
    42 
    42 
    43 endif
    43 endif