target: Make profiling function more readable
[openocd.git] / testing / build.test2 / Makefile
1 # -*- mode: makefile -*-
2 #========================================
3 # DO NOT DELETE THE LINE BELOW
4 _default: default
5 # DO NOT DELETE THE LINE_ABOVE
6 #========================================
7
8 #========================================
9 #
10 # There are no user configurable options here.
11 #
12 # All user configurable options are in local.uses
13 #
14 include ./local.uses
15 #
16 #========================================
17
18 #========================================
19 # This is the USB driver for the FTDI2XX chips.
20 # It is a "closed" solution from FTDICHIP.COM
21 # Some claim it is faster then the open/free
22 # solution: win32-libusb+libftdi.
23 #
24 ftd2xx.download:
25 mkdir -p ${VIRGINS}
26 wget -O ${FTD2XX_ZIPFILE_LOCAL} \
27 ${FTD2XX_ZIPFILE_URL}
28
29 ftd2xx.unpack:
30 rm -rf ${FTD2XX_WIN32_DIR}
31 mkdir -p ${FTD2XX_WIN32_DIR}
32 cd ${FTD2XX_WIN32_DIR} && unzip \
33 ${FTD2XX_ZIPFILE_LOCAL}
34
35 ftd2xx.build:
36 @echo "Nothing to do for: $@"
37
38 ftd2xx.configure:
39 @echo "Nothing to do for: $@"
40
41 ftd2xx.install:
42 @echo "Nothing to do for: $@"
43
44 clean::
45 rm -rf ${FTD2XX_WIN32_DIR}
46
47 ftd2xx.all: ftd2xx.unpack ftd2xx.configure \
48 ftd2xx.build ftd2xx.install
49
50
51 #========================================-
52 # LIBFTDI - requires LIBCONFUSE..
53 # So we handle it here :-(
54
55 libconfuse.download:
56 mkdir -p virgins
57 wget -O ${LIBCONFUSE_TARFILE_LOCAL} \
58 ${LIBCONFUSE_TARFILE_URL}
59
60 libconfuse.unpack:
61 tar xfz ${LIBCONFUSE_TARFILE_LOCAL}
62
63 clean::
64 rm -rf ${LIBCONFUSE_SRC_DIR}
65
66 libconfuse.configure:
67 rm -rf ${LIBCONFUSE_BUILD_DIR}
68 mkdir -p ${LIBCONFUSE_BUILD_DIR}
69 cd ${LIBCONFUSE_BUILD_DIR} && \
70 ${LIBCONFUSE_SRC_DIR}/configure \
71 --prefix=${PREFIX}
72
73 clean::
74 rm -rf ${LIBCONFUSE_BUILD_DIR}
75
76 libconfuse.build:
77 cd ${LIBCONFUSE_BUILD_DIR} && ${MAKE}
78
79 libconfuse.install:
80 cd ${LIBCONFUSE_BUILD_DIR} && ${MAKE} install
81
82 libconfuse.all: libconfuse.unpack libconfuse.configure \
83 libconfuse.build libconfuse.install
84
85 #========================================
86 # LIBFTDI - the open source (and free)
87 # alternative to (closed) FTD2XX drivers.
88
89 libftdi.download:
90 mkdir -p virgins
91 wget -O ${LIBFTDI_TARFILE_LOCAL} \
92 ${LIBFTDI_TARFILE_URL}
93
94 libftdi.unpack:
95 tar xfz ${LIBFTDI_TARFILE_LOCAL}
96
97 clean::
98 rm -rf ${LIBFTDI_SRC_DIR}
99
100 libftdi.configure:
101 rm -rf ${LIBFTDI_BUILD_DIR}
102 mkdir -p ${LIBFTDI_BUILD_DIR}
103 cd ${LIBFTDI_BUILD_DIR} && \
104 ${LIBFTDI_SRC_DIR}/configure \
105 --prefix=${PREFIX}
106
107 clean::
108 rm -rf ${LIBFTDI_BUILD_DIR}
109
110 libftdi.build:
111 cd ${LIBFTDI_BUILD_DIR} && ${MAKE}
112
113 libftdi.install:
114 cd ${LIBFTDI_BUILD_DIR} && ${MAKE} install
115
116 libftdi.all: libftdi.unpack libftdi.configure \
117 libftdi.build libftdi.install
118
119 #========================================
120 # Openocd...
121
122 openocd.bootstrap:
123 cd ${OPENOCD_SRC_DIR} && bash ./bootstrap
124
125 openocd.configure:
126 rm -rf ${OPENOCD_BUILD_DIR}
127 mkdir -p ${OPENOCD_BUILD_DIR}
128 cd ${OPENOCD_BUILD_DIR} && ${OPENOCD_SRC_DIR}/configure \
129 --prefix=${INSTALL_DIR} \
130 ${OPENOCD_CONFIG_OPTIONS}
131
132 openocd.build:
133 cd ${OPENOCD_BUILD_DIR} && ${MAKE}
134
135 openocd.docs:
136 cd ${OPENOCD_BUILD_DIR}/docs && ${MAKE}
137
138 openocd.docs.pdf:
139 cd ${OPENOCD_BUILD_DIR}/docs && ${MAKE} pdf
140
141 openocd.docs.html:
142 cd ${OPENOCD_BUILD_DIR}/docs && ${MAKE} html
143
144 # fixme:
145 # need to add a "make one huge html file target"
146
147 openocd.install:
148 cd ${OPENOCD_BUILD_DIR} && ${MAKE} install
149
150 #========================================
151 # The world...
152
153 # Manual step.
154 download.all: \
155 ftd2xx.download \
156 libconfuse.download \
157 libftdi.download
158
159 ifeq (x"${FT2232_DRIVER}",x"ftd2xx")
160 prebuild: ftd2xx.all
161 endif
162
163 ifeq (x"${FT2232_DRIVER}",x"libftdi")
164 prebuild: libconfuse.all libftdi.all
165 endif
166
167 remake: \
168 openocd.bootstrap \
169 openocd.configure \
170 openocd.build \
171 openocd.install
172
173 initial.build : download.all prebuild remake
174
175 all:
176 @echo ""
177 @echo " This makefile does not support an 'all' target"
178 @echo ""
179 @echo " If this is your *FIRST* time building... "
180 @echo " Then use this command: \"make initial.build\""
181 @echo ""
182 @echo " The \"default\" target is for openocd developers"
183 @echo " and rebuilds openocd completely.."
184 @echo ""
185
186 default:
187 test -d ${OPENOCD_SRC_DIR} || (echo "Where is: The OPENOCD source?"; exit 1)
188 ${MAKE} remake
189
190 whatis_%:
191 @echo ""
192 @echo "Makevariable: $* => ${${*}}"
193 @echo ""