devices/Makefile
author Florian Pose <fp@igh-essen.com>
Tue, 29 Aug 2006 16:17:31 +0000
changeset 352 3f79f0637c60
parent 287 529c27d9d4d7
permissions -rw-r--r--
Added PDO defines to ecdb.h
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
#------------------------------------------------------------------------------
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
#
272
efb1c792a6a4 Applied patches by Maximilian Schwerin.
Florian Pose <fp@igh-essen.com>
parents: 267
diff changeset
     3
#  Makefile
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
#
180
786d4cba38fb Advanced build system
Florian Pose <fp@igh-essen.com>
parents: 54
diff changeset
     5
#  IgH EtherCAT master device modules
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     6
#
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     7
#  $Id$
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     8
#
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
     9
#  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    10
#
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    11
#  This file is part of the IgH EtherCAT Master.
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    12
#
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    13
#  The IgH EtherCAT Master is free software; you can redistribute it
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    14
#  and/or modify it under the terms of the GNU General Public License
246
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    15
#  as published by the Free Software Foundation; either version 2 of the
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    16
#  License, or (at your option) any later version.
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    17
#
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    18
#  The IgH EtherCAT Master is distributed in the hope that it will be
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    19
#  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    20
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    21
#  GNU General Public License for more details.
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    22
#
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    23
#  You should have received a copy of the GNU General Public License
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    24
#  along with the IgH EtherCAT Master; if not, write to the Free Software
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    25
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 196
diff changeset
    26
#
246
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    27
#  The right to use EtherCAT Technology is granted and comes free of
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    28
#  charge under condition of compatibility of product made by
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    29
#  Licensee. People intending to distribute/sell products based on the
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    30
#  code, have to sign an agreement to guarantee that products using
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    31
#  software based on IgH EtherCAT master stay compatible with the actual
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    32
#  EtherCAT specification (which are released themselves as an open
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    33
#  standard) as the (only) precondition to have the right to use EtherCAT
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    34
#  Technology, IP and trade marks.
0bf7c769de06 Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    35
#
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    36
#------------------------------------------------------------------------------
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    37
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    38
#------------------------------------------------------------------------------
180
786d4cba38fb Advanced build system
Florian Pose <fp@igh-essen.com>
parents: 54
diff changeset
    39
#  kbuild section
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    40
272
efb1c792a6a4 Applied patches by Maximilian Schwerin.
Florian Pose <fp@igh-essen.com>
parents: 267
diff changeset
    41
ifneq ($(KERNELRELEASE),)
efb1c792a6a4 Applied patches by Maximilian Schwerin.
Florian Pose <fp@igh-essen.com>
parents: 267
diff changeset
    42
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    43
obj-m := ec_8139too.o
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    44
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    45
ec_8139too-objs := 8139too.o
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    46
267
88177083f137 Consistent Makefiles.
Florian Pose <fp@igh-essen.com>
parents: 246
diff changeset
    47
REV := $(shell svnversion $(src) 2>/dev/null || echo "unknown")
196
f8a1e9f364a3 Introduced version number define.
Florian Pose <fp@igh-essen.com>
parents: 192
diff changeset
    48
f8a1e9f364a3 Introduced version number define.
Florian Pose <fp@igh-essen.com>
parents: 192
diff changeset
    49
EXTRA_CFLAGS = -DEC_REV=$(REV) -DEC_USER=$(USER)
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    50
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    51
#------------------------------------------------------------------------------
272
efb1c792a6a4 Applied patches by Maximilian Schwerin.
Florian Pose <fp@igh-essen.com>
parents: 267
diff changeset
    52
#  default section
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    53
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    54
else
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    55
180
786d4cba38fb Advanced build system
Florian Pose <fp@igh-essen.com>
parents: 54
diff changeset
    56
ifneq ($(wildcard ../ethercat.conf),)
786d4cba38fb Advanced build system
Florian Pose <fp@igh-essen.com>
parents: 54
diff changeset
    57
include ../ethercat.conf
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    58
else
180
786d4cba38fb Advanced build system
Florian Pose <fp@igh-essen.com>
parents: 54
diff changeset
    59
KERNEL := $(shell uname -r)
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    60
endif
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    61
267
88177083f137 Consistent Makefiles.
Florian Pose <fp@igh-essen.com>
parents: 246
diff changeset
    62
KERNEL_DIR := /lib/modules/$(KERNEL)/build
88177083f137 Consistent Makefiles.
Florian Pose <fp@igh-essen.com>
parents: 246
diff changeset
    63
CURRENT_DIR := $(shell pwd)
281
c91bbf7bc52c Better modules_install targets.
Florian Pose <fp@igh-essen.com>
parents: 272
diff changeset
    64
INSTALL_MOD_DIR := ethercat/devices
180
786d4cba38fb Advanced build system
Florian Pose <fp@igh-essen.com>
parents: 54
diff changeset
    65
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    66
modules:
272
efb1c792a6a4 Applied patches by Maximilian Schwerin.
Florian Pose <fp@igh-essen.com>
parents: 267
diff changeset
    67
	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) modules
efb1c792a6a4 Applied patches by Maximilian Schwerin.
Florian Pose <fp@igh-essen.com>
parents: 267
diff changeset
    68
efb1c792a6a4 Applied patches by Maximilian Schwerin.
Florian Pose <fp@igh-essen.com>
parents: 267
diff changeset
    69
install: modules_install
efb1c792a6a4 Applied patches by Maximilian Schwerin.
Florian Pose <fp@igh-essen.com>
parents: 267
diff changeset
    70
efb1c792a6a4 Applied patches by Maximilian Schwerin.
Florian Pose <fp@igh-essen.com>
parents: 267
diff changeset
    71
modules_install:
281
c91bbf7bc52c Better modules_install targets.
Florian Pose <fp@igh-essen.com>
parents: 272
diff changeset
    72
	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) \
c91bbf7bc52c Better modules_install targets.
Florian Pose <fp@igh-essen.com>
parents: 272
diff changeset
    73
		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) modules_install
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    74
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    75
clean:
267
88177083f137 Consistent Makefiles.
Florian Pose <fp@igh-essen.com>
parents: 246
diff changeset
    76
	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
287
529c27d9d4d7 Removing "Modules.symvers" on make clean.
Florian Pose <fp@igh-essen.com>
parents: 281
diff changeset
    77
	@rm -f Modules.symvers
54
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    78
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    79
#------------------------------------------------------------------------------
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    80
7506e67dd122 Vereinheitlichte Schnittstellen, Include-Verzeichnis und Module getrennt.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    81
endif