]> rtime.felk.cvut.cz Git - CanFestival-3.git/blob - src/Makefile.in
Implemented EMCY objects.
[CanFestival-3.git] / src / Makefile.in
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
33
34 INCLUDES = -I../include -I../include/$(TARGET) -I../include/$(TIMERS_DRIVER) -I../drivers/$(TARGET)
35
36 OBJS = $(TARGET)_objacces.o $(TARGET)_lifegrd.o $(TARGET)_sdo.o\
37             $(TARGET)_pdo.o $(TARGET)_sync.o $(TARGET)_nmtSlave.o $(TARGET)_nmtMaster.o $(TARGET)_states.o $(TARGET)_timer.o $(TARGET)_dcf.o $(TARGET)_emcy.o
38
39 # # # # Target specific paramters # # # #
40
41 ifeq ($(TARGET),hcs12)
42 OPT_CFLAGS = -Os
43 PROGDEFINES = -mnoshort -Wall -Wmissing-prototypes -fno-strict-aliasing
44 endif
45
46 ifeq ($(TARGET),unix)
47 OPT_CFLAGS = -O2
48 endif
49
50 # # # # Options # # # # 
51
52 CFLAGS = SUB_OPT_CFLAGS
53
54 all: canfestival
55
56 canfestival: libcanfestival.a
57
58 libcanfestival.a: $(OBJS)
59         @echo " "
60         @echo "*********************************************"
61         @echo "**Building [libcanfestival.a]"
62         @echo "*********************************************"
63         $(BINUTILS_PREFIX)ar rc $@ $(OBJS)
64         $(BINUTILS_PREFIX)ranlib $@
65
66 $(TARGET)_%o: %c
67         @echo " "
68         @echo "*********************************************"
69         @echo "**Compiling $< -> $@"
70         @echo "*********************************************"
71         $(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
72
73 install: libcanfestival.a
74         mkdir -p $(PREFIX)/lib/
75         mkdir -p $(PREFIX)/include/canfestival
76         cp libcanfestival.a $(PREFIX)/lib/
77         cp ../include/*.h $(PREFIX)/include/canfestival
78
79 uninstall:
80         rm -f $(PREFIX)/lib/libcanfestival.a
81         rm -rf $(PREFIX)/include/canfestival
82
83 clean:
84         rm -f $(OBJS) libcanfestival.a
85
86 mrproper: clean
87