author | groke6 |
Tue, 08 Jan 2008 10:47:10 +0100 | |
changeset 349 | 1e6dd4ef46b9 |
parent 343 | 118c1cabd0b0 |
child 391 | 7802a7d5584f |
permissions | -rw-r--r-- |
0 | 1 |
#! gmake |
2 |
||
3 |
# |
|
4 |
# Copyright (C) 2006 Laurent Bessard |
|
5 |
# |
|
6 |
# This file is part of canfestival, a library implementing the canopen |
|
7 |
# stack |
|
8 |
# |
|
9 |
# This library is free software; you can redistribute it and/or |
|
10 |
# modify it under the terms of the GNU Lesser General Public |
|
11 |
# License as published by the Free Software Foundation; either |
|
12 |
# version 2.1 of the License, or (at your option) any later version. |
|
13 |
# |
|
14 |
# This library is distributed in the hope that it will be useful, |
|
15 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 |
# Lesser General Public License for more details. |
|
18 |
# |
|
19 |
# You should have received a copy of the GNU Lesser General Public |
|
20 |
# License along with this library; if not, write to the Free Software |
|
21 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
22 |
# |
|
23 |
||
24 |
CC = SUB_CC |
|
25 |
PROG_CFLAGS = SUB_PROG_CFLAGS |
|
26 |
OS_NAME = SUB_OS_NAME |
|
27 |
ARCH_NAME = SUB_ARCH_NAME |
|
28 |
PREFIX = SUB_PREFIX |
|
29 |
BINUTILS_PREFIX = SUB_BINUTILS_PREFIX |
|
30 |
TARGET = SUB_TARGET |
|
31 |
CAN_DRIVER = SUB_CAN_DRIVER |
|
32 |
TIMERS_DRIVER = SUB_TIMERS_DRIVER |
|
343 | 33 |
ENABLE_LSS = SUB_ENABLE_LSS |
0 | 34 |
|
191 | 35 |
INCLUDES = -I../include -I../include/$(TARGET) -I../include/$(TIMERS_DRIVER) -I../drivers/$(TARGET) |
0 | 36 |
|
37 |
OBJS = $(TARGET)_objacces.o $(TARGET)_lifegrd.o $(TARGET)_sdo.o\ |
|
284 | 38 |
$(TARGET)_pdo.o $(TARGET)_sync.o $(TARGET)_nmtSlave.o $(TARGET)_nmtMaster.o $(TARGET)_states.o $(TARGET)_timer.o $(TARGET)_dcf.o $(TARGET)_emcy.o |
0 | 39 |
|
343 | 40 |
|
41 |
ifeq ($(ENABLE_LSS),1) |
|
42 |
OBJS += $(TARGET)_lss.o |
|
43 |
endif |
|
44 |
||
0 | 45 |
# # # # Target specific paramters # # # # |
46 |
||
47 |
ifeq ($(TARGET),hcs12) |
|
48 |
OPT_CFLAGS = -Os |
|
49 |
PROGDEFINES = -mnoshort -Wall -Wmissing-prototypes -fno-strict-aliasing |
|
50 |
endif |
|
51 |
||
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
3
diff
changeset
|
52 |
ifeq ($(TARGET),unix) |
0 | 53 |
OPT_CFLAGS = -O2 |
54 |
endif |
|
55 |
||
56 |
# # # # Options # # # # |
|
57 |
||
58 |
CFLAGS = SUB_OPT_CFLAGS |
|
59 |
||
60 |
all: canfestival |
|
61 |
||
62 |
canfestival: libcanfestival.a |
|
63 |
||
64 |
libcanfestival.a: $(OBJS) |
|
65 |
@echo " " |
|
66 |
@echo "*********************************************" |
|
67 |
@echo "**Building [libcanfestival.a]" |
|
68 |
@echo "*********************************************" |
|
69 |
$(BINUTILS_PREFIX)ar rc $@ $(OBJS) |
|
70 |
$(BINUTILS_PREFIX)ranlib $@ |
|
71 |
||
72 |
$(TARGET)_%o: %c |
|
73 |
@echo " " |
|
74 |
@echo "*********************************************" |
|
75 |
@echo "**Compiling $< -> $@" |
|
76 |
@echo "*********************************************" |
|
77 |
$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $< |
|
78 |
||
79 |
install: libcanfestival.a |
|
80 |
mkdir -p $(PREFIX)/lib/ |
|
81 |
mkdir -p $(PREFIX)/include/canfestival |
|
82 |
cp libcanfestival.a $(PREFIX)/lib/ |
|
83 |
cp ../include/*.h $(PREFIX)/include/canfestival |
|
84 |
||
85 |
uninstall: |
|
86 |
rm -f $(PREFIX)/lib/libcanfestival.a |
|
87 |
rm -rf $(PREFIX)/include/canfestival |
|
88 |
||
89 |
clean: |
|
90 |
rm -f $(OBJS) libcanfestival.a |
|
91 |
||
92 |
mrproper: clean |
|
93 |