author | Christian Taedcke |
Fri, 28 Jan 2011 14:51:18 +0100 | |
changeset 657 | c0e68a63f600 |
parent 629 | b9274b595650 |
child 658 | 7758d60e9260 |
permissions | -rw-r--r-- |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
1 |
#! gmake |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
2 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
3 |
# |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
4 |
# Copyright (C) 2006 Laurent Bessard |
629 | 5 |
# |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
6 |
# This file is part of canfestival, a library implementing the canopen |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
7 |
# stack |
629 | 8 |
# |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
9 |
# This library is free software; you can redistribute it and/or |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
10 |
# modify it under the terms of the GNU Lesser General Public |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
11 |
# License as published by the Free Software Foundation; either |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
12 |
# version 2.1 of the License, or (at your option) any later version. |
629 | 13 |
# |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
14 |
# This library is distributed in the hope that it will be useful, |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
15 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
16 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
17 |
# Lesser General Public License for more details. |
629 | 18 |
# |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
19 |
# You should have received a copy of the GNU Lesser General Public |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
20 |
# License along with this library; if not, write to the Free Software |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
21 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
629 | 22 |
# |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
23 |
|
391
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
24 |
#ifneq ($(KERNELRELEASE),) |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
25 |
# Kbuild part of Makefile |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
26 |
obj-m := libcanfestival_$(TARGET).o |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
27 |
libcanfestival_$(TARGET)-objs := $(OBJS) |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
28 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
29 |
#else |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
30 |
# Normal Makefile |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
31 |
CC = SUB_CC |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
32 |
OPT_CFLAGS = -O2 |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
33 |
PROG_CFLAGS = SUB_PROG_CFLAGS |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
34 |
OS_NAME = SUB_OS_NAME |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
35 |
ARCH_NAME = SUB_ARCH_NAME |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
36 |
PREFIX = SUB_PREFIX |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
37 |
TARGET = SUB_TARGET |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
38 |
CAN_DRIVER = SUB_CAN_DRIVER |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
39 |
TIMERS_DRIVER = SUB_TIMERS_DRIVER |
145
e747d2e26af0
Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents:
94
diff
changeset
|
40 |
ENABLE_DLL_DRIVERS = SUB_ENABLE_DLL_DRIVERS |
354 | 41 |
BINUTILS_PREFIX = SUB_BINUTILS_PREFIX |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
42 |
|
145
e747d2e26af0
Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents:
94
diff
changeset
|
43 |
INCLUDES = -I../../include -I../../include/$(TARGET) -I../../include/$(TIMERS_DRIVER) |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
44 |
|
145
e747d2e26af0
Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents:
94
diff
changeset
|
45 |
OBJS = $(TARGET).o |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
46 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
47 |
# add timers driver if any |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
48 |
ifneq ($(TIMERS_DRIVER),timers_) |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
49 |
OBJS += ../$(TIMERS_DRIVER)/$(TIMERS_DRIVER).o |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
50 |
endif |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
51 |
|
145
e747d2e26af0
Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents:
94
diff
changeset
|
52 |
SRC_HFILES = ../../include/$(TARGET)/applicfg.h ../../include/$(TARGET)/canfestival.h |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
53 |
|
145
e747d2e26af0
Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents:
94
diff
changeset
|
54 |
TARGET_HFILES = $(PREFIX)/include/$(TARGET)/applicfg.h $(PREFIX)/include/$(TARGET)/canfestival.h |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
55 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
56 |
all: driver |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
57 |
|
391
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
58 |
ifeq ($(TIMERS_DRIVER), timers_kernel) |
629 | 59 |
USE_KERNEL_TIMER = true |
60 |
endif |
|
61 |
ifeq ($(TIMERS_DRIVER), timers_kernel_xeno) |
|
62 |
USE_KERNEL_TIMER = true |
|
63 |
endif |
|
64 |
||
65 |
ifeq ($(USE_KERNEL_TIMER), true) |
|
391
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
66 |
OBJS := $(shell echo $(OBJS) | sed "s:$(TARGET)_::g") |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
67 |
EXTRA_CFLAGS := $(shell echo $(INCLUDES) | sed "s:-I:-I$(src)/:g") |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
68 |
EXTRA_CFLAGS += $(PROG_CFLAGS) |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
69 |
KERNELDIR := SUB_KERNELDIR |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
70 |
export TARGET |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
71 |
export OBJS |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
72 |
export EXTRA_CFLAGS |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
73 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
74 |
driver: libcanfestival_$(TARGET) |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
75 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
76 |
libcanfestival_$(TARGET): |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
77 |
@echo Building [libcanfestival_$(TARGET).o] |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
78 |
$(MAKE) -C $(KERNELDIR) M=$(shell pwd) modules |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
79 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
80 |
clean: |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
81 |
$(MAKE) -C $(KERNELDIR) M=$(shell pwd) clean |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
82 |
rm -f Module.symvers |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
83 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
84 |
install: |
629 | 85 |
|
391
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
86 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
87 |
else |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
88 |
CFLAGS = SUB_OPT_CFLAGS |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
89 |
|
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
90 |
driver: $(OBJS) |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
91 |
|
145
e747d2e26af0
Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents:
94
diff
changeset
|
92 |
%o: %c |
e747d2e26af0
Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents:
94
diff
changeset
|
93 |
$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $< |
e747d2e26af0
Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents:
94
diff
changeset
|
94 |
|
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
95 |
#../$(TIMERS_DRIVER)/$(TIMERS_DRIVER).o: |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
96 |
# $(MAKE) -C ../$(TIMERS_DRIVER) driver |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
97 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
98 |
#../$(CAN_DRIVER)/$(CAN_DRIVER).o: |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
99 |
# $(MAKE) -C ../$(CAN_DRIVER) driver |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
100 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
101 |
libcanfestival_$(TARGET).a: $(OBJS) |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
102 |
@echo Building [libcanfestival_$(TARGET).a] |
354 | 103 |
$(BINUTILS_PREFIX)ar rc $@ $(OBJS) |
104 |
$(BINUTILS_PREFIX)ranlib $@ |
|
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
105 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
106 |
install: libcanfestival_$(TARGET).a |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
107 |
mkdir -p $(PREFIX)/lib/ |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
108 |
mkdir -p $(PREFIX)/include/canfestival |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
109 |
cp libcanfestival_$(TARGET).a $(PREFIX)/lib/ |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
110 |
cp $(SRC_HFILES) $(PREFIX)/include/canfestival |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
111 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
112 |
uninstall: |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
113 |
rm -f $(PREFIX)/lib/libcanfestival_$(TARGET).a |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
114 |
rm -f $(TARGET_HFILES) |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
115 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
116 |
clean: |
145
e747d2e26af0
Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents:
94
diff
changeset
|
117 |
rm -f $(OBJS) |
40
ddeeb217ed71
Updated configure and fixes in Makefiles.in for cygwin compiling.
etisserant
parents:
24
diff
changeset
|
118 |
rm -f libcanfestival_$(TARGET).a |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
119 |
|
391
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
120 |
endif |
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
121 |
mrproper: clean |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff
changeset
|
122 |
|
391
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
354
diff
changeset
|
123 |
#endif |