rtdm/Kbuild.in
author Florian Pose <fp@igh-essen.com>
Thu, 15 Sep 2011 15:56:49 +0200
changeset 2106 505871ced767
parent 2058 543c4ce9e86e
permissions -rw-r--r--
Minor: Fixed line breaks and spacing.
2054
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
     1
#------------------------------------------------------------------------------
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
     2
#
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
     3
#  $Id$
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
     4
#
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
     5
#  Copyright (C) 2006-2008  Florian Pose, Ingenieurgemeinschaft IgH
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
     6
#
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
     7
#  This file is part of the IgH EtherCAT Master.
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
     8
#
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
     9
#  The IgH EtherCAT Master is free software; you can redistribute it and/or
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    10
#  modify it under the terms of the GNU General Public License version 2, as
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    11
#  published by the Free Software Foundation.
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    12
#
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    13
#  The IgH EtherCAT Master is distributed in the hope that it will be useful,
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    14
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    15
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    16
#  Public License for more details.
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    17
#
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    18
#  You should have received a copy of the GNU General Public License along
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    19
#  with the IgH EtherCAT Master; if not, write to the Free Software
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    20
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    21
#
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    22
#  ---
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    23
#  
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    24
#  The license mentioned above concerns the source code only. Using the EtherCAT
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    25
#  technology and brand is only permitted in compliance with the industrial
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    26
#  property and similar rights of Beckhoff Automation GmbH.
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    27
#
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    28
#  ---
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    29
#
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    30
#  vi: syntax=make
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    31
#
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    32
#------------------------------------------------------------------------------
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    33
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    34
obj-m := ec_rtdm.o
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    35
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    36
ec_rtdm-objs := \
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    37
        module.o
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    38
2058
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    39
ifeq (@ENABLE_XENOMAI@,1)
2054
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    40
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    41
### Xenomai directory, xeno-config and library directory ###########
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    42
XENO_DIR          := @XENOMAI_DIR@
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    43
XENO_CONFIG       := $(XENO_DIR)/bin/xeno-config
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    44
XENO_LIB_DIR      := $(shell $(XENO_CONFIG) --library-dir)
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    45
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    46
REV := $(shell if test -s $(src)/../revision; then \
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    47
		cat $(src)/../revision; \
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    48
	else \
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    49
		hg id -i $(src)/.. 2>/dev/null || echo "unknown"; \
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    50
	fi)
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    51
2058
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    52
CFLAGS_module.o := -DREV=$(REV) -I$(XENO_DIR)/include -DENABLE_XENOMAI
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    53
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    54
endif
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    55
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    56
ifeq (@ENABLE_RTAI@,1)
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    57
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    58
### RTAI directory, rtai_config and library directory ###########
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    59
RTAI_DIR          := @RTAI_DIR@
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    60
RTAI_CONFIG       := $(RTAI_DIR)/bin/rtai-config
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    61
RTAI_LIB_DIR      := $(shell $(RTAI_CONFIG) --library-dir)
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    62
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    63
REV := $(shell if test -s $(src)/../revision; then \
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    64
		cat $(src)/../revision; \
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    65
	else \
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    66
		hg id -i $(src)/.. 2>/dev/null || echo "unknown"; \
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    67
	fi)
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    68
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    69
CFLAGS_module.o := -DREV=$(REV) -I$(RTAI_DIR)/include -DENABLE_RTAI
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    70
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    71
endif
543c4ce9e86e Working RTAI RTDM module
Andreas Stewering-Bone <ab@igh-essen.com>
parents: 2054
diff changeset
    72
2054
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    73
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    74
KBUILD_EXTRA_SYMBOLS := \
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    75
        @abs_top_builddir@/$(LINUX_SYMVERS) \
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    76
        @abs_top_builddir@/master/$(LINUX_SYMVERS)
3417bbc4ad2f First working RTDM Version,
Andreas Stewering-Bone <ab@igh-essen.com>
parents:
diff changeset
    77
#------------------------------------------------------------------------------