examples/msr/Makefile
author Florian Pose <fp@igh-essen.com>
Thu, 03 Aug 2006 13:05:52 +0000
branchstable-1.0
changeset 1626 d849e3b7b202
parent 1621 4bbe090553f7
permissions -rw-r--r--
MERGE trunk -r492:493 -> branches/stable-1.0 (Init script identation.
1619
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
#------------------------------------------------------------------------------
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
#
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     3
#  Makefile
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
#
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     5
#  Sample module for use with IgH MSR library.
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     6
#
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     7
#  $Id$
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     8
#
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     9
#  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    10
#
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    11
#  This file is part of the IgH EtherCAT Master.
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    12
#
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    13
#  The IgH EtherCAT Master is free software; you can redistribute it
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    14
#  and/or modify it under the terms of the GNU General Public License
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    15
#  as published by the Free Software Foundation; either version 2 of the
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    16
#  License, or (at your option) any later version.
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    17
#
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    18
#  The IgH EtherCAT Master is distributed in the hope that it will be
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    19
#  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    20
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    21
#  GNU General Public License for more details.
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    22
#
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    23
#  You should have received a copy of the GNU General Public License
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    24
#  along with the IgH EtherCAT Master; if not, write to the Free Software
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    25
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    26
#
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    27
#  The right to use EtherCAT Technology is granted and comes free of
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    28
#  charge under condition of compatibility of product made by
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    29
#  Licensee. People intending to distribute/sell products based on the
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    30
#  code, have to sign an agreement to guarantee that products using
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    31
#  software based on IgH EtherCAT master stay compatible with the actual
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    32
#  EtherCAT specification (which are released themselves as an open
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
#  standard) as the (only) precondition to have the right to use EtherCAT
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    34
#  Technology, IP and trade marks.
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    35
#
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    36
#------------------------------------------------------------------------------
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    37
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    38
MODULE := ec_msr_sample
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    39
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    40
#------------------------------------------------------------------------------
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    41
#  kbuild section
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    42
#------------------------------------------------------------------------------
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    43
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    44
ifneq ($(KERNELRELEASE),)
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    45
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    46
obj-m := $(MODULE).o
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    47
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    48
$(MODULE)-objs := msr_sample.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    49
			rt_lib/msr-core/msr_lists.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    50
			rt_lib/msr-core/msr_main.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    51
			rt_lib/msr-core/msr_charbuf.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    52
			rt_lib/msr-core/msr_reg.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    53
			rt_lib/msr-core/msr_interpreter.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    54
			rt_lib/msr-core/msr_messages.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    55
			rt_lib/msr-core/msr_proc.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    56
			rt_lib/msr-core/msr_error_reg.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    57
			rt_lib/msr-utils/msr_utils.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    58
			rt_lib/msr-utils/msr_time.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    59
			rt_lib/msr-math/msr_base64.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    60
			rt_lib/msr-math/msr_hex_bin.o \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    61
			libm.o
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    62
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    63
EXTRA_CFLAGS := -I$(src)/rt_lib/msr-include -I/usr/realtime/include \
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    64
		-D_SIMULATION -mhard-float
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    65
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    66
#------------------------------------------------------------------------------
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    67
#  default section
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    68
#------------------------------------------------------------------------------
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    69
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    70
else
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    71
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    72
ifneq ($(wildcard kernel.conf),)
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    73
include kernel.conf
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    74
else
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    75
KERNEL := $(shell uname -r)
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    76
endif
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    77
1621
4bbe090553f7 MERGE trunk -r428:447 -> branches/stable-1.0 (Complete EEPROM data, unloading buxfix, variable data, bridging)
Florian Pose <fp@igh-essen.com>
parents: 1619
diff changeset
    78
KERNEL_DIR := /lib/modules/$(KERNEL)/build
4bbe090553f7 MERGE trunk -r428:447 -> branches/stable-1.0 (Complete EEPROM data, unloading buxfix, variable data, bridging)
Florian Pose <fp@igh-essen.com>
parents: 1619
diff changeset
    79
CURRENT_DIR := $(shell pwd)
1619
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    80
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    81
modules:
1621
4bbe090553f7 MERGE trunk -r428:447 -> branches/stable-1.0 (Complete EEPROM data, unloading buxfix, variable data, bridging)
Florian Pose <fp@igh-essen.com>
parents: 1619
diff changeset
    82
	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR)
1619
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    83
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    84
clean:
1621
4bbe090553f7 MERGE trunk -r428:447 -> branches/stable-1.0 (Complete EEPROM data, unloading buxfix, variable data, bridging)
Florian Pose <fp@igh-essen.com>
parents: 1619
diff changeset
    85
	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
1619
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    86
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    87
install:
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    88
	@./install.sh $(MODULE) $(KERNEL)
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    89
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    90
endif
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    91
0d4119024f55 MERGE -r361:425 trunk -> branches/stable-1.0: EoE, License, State machines.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    92
#------------------------------------------------------------------------------