Debian Codegraph @

Makefile

raw ◀ ▶
2 Debian patches touch this file
1 # Hiredis Makefile
2 # Copyright (C) 2010-2011 Salvatore Sanfilippo <antirez at gmail dot com>
3 # Copyright (C) 2010-2011 Pieter Noordhuis <pcnoordhuis at gmail dot com>
4 #
5 # SPDX-FileCopyrightText: 2024 Hiredict Contributors
6 # SPDX-FileCopyrightText: 2024 Salvatore Sanfilippo <antirez at gmail dot com>
7 # SPDX-FileCopyrightText: 2024 Pieter Noordhuis <pcnoordhuis at gmail dot com>
8 #
9 # SPDX-License-Identifier: BSD-3-Clause
10 # SPDX-License-Identifier: LGPL-3.0-or-later
11
12 OBJ=alloc.o net.o hiredict.o sds.o async.o read.o sockcompat.o
13 EXAMPLES=hiredict-example hiredict-example-libevent hiredict-example-libev hiredict-example-glib hiredict-example-push hiredict-example-poll
14 TESTS=hiredict-test
15 LIBNAME=libhiredict
16 PKGCONFNAME=hiredict.pc
17 SHIM_PKGCONFNAME=shim/hiredis.pc
18
19 HIREDICT_MAJOR=$(shell grep HIREDICT_MAJOR hiredict.h | awk '{print $$3}')
20 HIREDICT_MINOR=$(shell grep HIREDICT_MINOR hiredict.h | awk '{print $$3}')
21 HIREDICT_PATCH=$(shell grep HIREDICT_PATCH hiredict.h | awk '{print $$3}')
22 HIREDICT_SONAME=$(shell grep HIREDICT_SONAME hiredict.h | awk '{print $$3}')
23
24 HIREDICT_VERSION=$(HIREDICT_MAJOR).$(HIREDICT_MINOR).$(HIREDICT_PATCH)
25
26 # Installation related variables and target
27 PREFIX?=/usr/local
28 INCLUDE_PATH?=include/hiredict
29 SHIM_INCLUDE_PATH?=include/hiredis
30 LIBRARY_PATH?=lib
31 PKGCONF_PATH?=pkgconfig
•32 CMAKE_PATH?=cmake/Hiredict
33 INSTALL_INCLUDE_PATH= $(DESTDIR)$(PREFIX)/$(INCLUDE_PATH)
34 SHIM_INSTALL_INCLUDE_PATH= $(DESTDIR)$(PREFIX)/$(SHIM_INCLUDE_PATH)
35 INSTALL_LIBRARY_PATH= $(DESTDIR)$(PREFIX)/$(LIBRARY_PATH)
36 INSTALL_PKGCONF_PATH= $(INSTALL_LIBRARY_PATH)/$(PKGCONF_PATH)
•37 INSTALL_CMAKE_PATH= $(INSTALL_LIBRARY_PATH)/$(CMAKE_PATH)
38
39 # redict-server configuration used for testing
40 REDICT_PORT=56379
41 REDICT_SERVER=redict-server
42 define REDICT_TEST_CONFIG
43 daemonize yes
44 pidfile /tmp/hiredict-test-redict.pid
45 port $(REDICT_PORT)
46 bind 127.0.0.1
47 unixsocket /tmp/hiredict-test-redict.sock
48 endef
49 export REDICT_TEST_CONFIG
50
51 # Fallback to gcc when $CC is not in $PATH.
52 CC:=$(shell sh -c 'type $${CC%% *} >/dev/null 2>/dev/null && echo $(CC) || echo gcc')
53 CXX:=$(shell sh -c 'type $${CXX%% *} >/dev/null 2>/dev/null && echo $(CXX) || echo g++')
54 OPTIMIZATION?=-O3
55 WARNINGS=-Wall -Wextra -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers
56 USE_WERROR?=1
57 ifeq ($(USE_WERROR),1)
58 WARNINGS+=-Werror
59 endif
60 DEBUG_FLAGS?= -g -ggdb
61 REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CPPFLAGS) $(CFLAGS) $(WARNINGS) $(DEBUG_FLAGS) $(PLATFORM_FLAGS)
62 REAL_LDFLAGS=$(LDFLAGS)
63
64 DYLIBSUFFIX=so
65 STLIBSUFFIX=a
66 DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDICT_SONAME)
67 DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDICT_MAJOR)
68 DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX)
69
70 DYLIB_MAKE_CMD=$(CC) $(PLATFORM_FLAGS) -shared -Wl,-soname,$(DYLIB_MINOR_NAME)
71 STLIBNAME=$(LIBNAME).$(STLIBSUFFIX)
72 STLIB_MAKE_CMD=$(AR) rcs
73
74 #################### SSL variables start ####################
75 SSL_OBJ=ssl.o
76 SSL_LIBNAME=libhiredict_ssl
77 SSL_PKGCONFNAME=hiredict_ssl.pc
78 SSL_SHIM_PKGCONFNAME=shim/hiredis_ssl.pc
79 SSL_INSTALLNAME=install-ssl
80 SSL_DYLIB_MINOR_NAME=$(SSL_LIBNAME).$(DYLIBSUFFIX).$(HIREDICT_SONAME)
81 SSL_DYLIB_MAJOR_NAME=$(SSL_LIBNAME).$(DYLIBSUFFIX).$(HIREDICT_MAJOR)
82 SSL_DYLIBNAME=$(SSL_LIBNAME).$(DYLIBSUFFIX)
83 SSL_STLIBNAME=$(SSL_LIBNAME).$(STLIBSUFFIX)
84 SSL_DYLIB_MAKE_CMD=$(CC) $(PLATFORM_FLAGS) -shared -Wl,-soname,$(SSL_DYLIB_MINOR_NAME)
•85 CMAKECONFNAME=HiredictConfig.cmake
86 CMAKEVERSNAME=HiredictConfigVersion.cmake
87
88 USE_SSL?=0
89 ifeq ($(USE_SSL),1)
90 # This is required for test.c only
91 CFLAGS+=-DHIREDICT_TEST_SSL
92 EXAMPLES+=hiredict-example-ssl hiredict-example-libevent-ssl
93 SSL_STLIB=$(SSL_STLIBNAME)
94 SSL_DYLIB=$(SSL_DYLIBNAME)
95 SSL_PKGCONF=$(SSL_PKGCONFNAME)
96 SSL_SHIM_PKGCONF=$(SSL_SHIM_PKGCONFNAME)
97 SSL_INSTALL=$(SSL_INSTALLNAME)
98 else
99 SSL_STLIB=
100 SSL_DYLIB=
101 SSL_PKGCONF=
102 SSL_SHIM_PKGCONF=
103 SSL_INSTALL=
104 endif
105 ##################### SSL variables end #####################
106
107
108 # Platform-specific overrides
109 uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
110
111 # This is required for test.c only
112 ifeq ($(TEST_ASYNC),1)
113 export CFLAGS+=-DHIREDICT_TEST_ASYNC
114 endif
115
116 ifeq ($(USE_SSL),1)
117 ifndef OPENSSL_PREFIX
118 ifeq ($(uname_S),Darwin)
119 SEARCH_PATH1=/opt/homebrew/opt/openssl
120 SEARCH_PATH2=/usr/local/opt/openssl
121
122 ifneq ($(wildcard $(SEARCH_PATH1)),)
123 OPENSSL_PREFIX=$(SEARCH_PATH1)
124 else ifneq ($(wildcard $(SEARCH_PATH2)),)
125 OPENSSL_PREFIX=$(SEARCH_PATH2)
126 endif
127 endif
128 endif
129
130 ifdef OPENSSL_PREFIX
131 CFLAGS+=-I$(OPENSSL_PREFIX)/include
132 SSL_LDFLAGS+=-L$(OPENSSL_PREFIX)/lib
133 endif
134
135 SSL_LDFLAGS+=-lssl -lcrypto
136 endif
137
138 ifeq ($(uname_S),FreeBSD)
139 LDFLAGS+=-lm
140 IS_GCC=$(shell sh -c '$(CC) --version 2>/dev/null |egrep -i -c "gcc"')
141 ifeq ($(IS_GCC),1)
142 REAL_CFLAGS+=-pedantic
143 endif
144 else
145 REAL_CFLAGS+=-pedantic
146 endif
147
148 ifeq ($(uname_S),SunOS)
149 IS_SUN_CC=$(shell sh -c '$(CC) -V 2>&1 |egrep -i -c "sun|studio"')
150 ifeq ($(IS_SUN_CC),1)
151 SUN_SHARED_FLAG=-G
152 else
153 SUN_SHARED_FLAG=-shared
154 endif
155 REAL_LDFLAGS+= -ldl -lnsl -lsocket
156 DYLIB_MAKE_CMD=$(CC) $(SUN_SHARED_FLAG) -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS)
157 SSL_DYLIB_MAKE_CMD=$(CC) $(SUN_SHARED_FLAG) -o $(SSL_DYLIBNAME) -h $(SSL_DYLIB_MINOR_NAME) $(LDFLAGS) $(SSL_LDFLAGS)
158 endif
159 ifeq ($(uname_S),Darwin)
160 DYLIBSUFFIX=dylib
161 DYLIB_MINOR_NAME=$(LIBNAME).$(HIREDICT_SONAME).$(DYLIBSUFFIX)
162 DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
163 SSL_DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(SSL_DYLIB_MINOR_NAME) -o $(SSL_DYLIBNAME) $(LDFLAGS) $(SSL_LDFLAGS)
164 DYLIB_PLUGIN=-Wl,-undefined -Wl,dynamic_lookup
165 endif
166
•167 all: dynamic static pkgconfig
168
169 dynamic: $(DYLIBNAME) $(SSL_DYLIB)
170
171 static: $(STLIBNAME) $(SSL_STLIB)
172
173 pkgconfig: $(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(SSL_PKGCONF) $(SSL_SHIM_PKGCONF)
174
175 # Deps (use make dep to generate this)
176 alloc.o: alloc.c fmacros.h alloc.h
177 async.o: async.c fmacros.h alloc.h async.h hiredict.h read.h sds.h net.h dict.c dict.h win32.h async_private.h
178 dict.o: dict.c fmacros.h alloc.h dict.h
179 hiredict.o: hiredict.c fmacros.h hiredict.h read.h sds.h alloc.h net.h async.h win32.h
180 net.o: net.c fmacros.h net.h hiredict.h read.h sds.h alloc.h sockcompat.h win32.h
181 read.o: read.c fmacros.h alloc.h read.h sds.h win32.h
182 sds.o: sds.c sds.h sdsalloc.h alloc.h
183 sockcompat.o: sockcompat.c sockcompat.h
•184 test.o: test.c
185
186 $(DYLIBNAME): $(OBJ)
187 $(DYLIB_MAKE_CMD) -o $(DYLIBNAME) $(OBJ) $(REAL_LDFLAGS)
188
189 $(STLIBNAME): $(OBJ)
190 $(STLIB_MAKE_CMD) $(STLIBNAME) $(OBJ)
191
192 #################### SSL building rules start ####################
193 $(SSL_DYLIBNAME): $(SSL_OBJ)
194 $(SSL_DYLIB_MAKE_CMD) $(DYLIB_PLUGIN) -o $(SSL_DYLIBNAME) $(SSL_OBJ) $(REAL_LDFLAGS) $(LDFLAGS) $(SSL_LDFLAGS)
195
196 $(SSL_STLIBNAME): $(SSL_OBJ)
197 $(STLIB_MAKE_CMD) $(SSL_STLIBNAME) $(SSL_OBJ)
198
199 $(SSL_OBJ): ssl.c hiredict.h read.h sds.h alloc.h async.h win32.h async_private.h
200 #################### SSL building rules end ####################
201
202 # Binaries:
203 hiredict-example-libevent: examples/example-libevent.c adapters/libevent.h $(STLIBNAME)
204 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. $< -levent $(STLIBNAME) $(REAL_LDFLAGS)
205
206 hiredict-example-libevent-ssl: examples/example-libevent-ssl.c adapters/libevent.h $(STLIBNAME) $(SSL_STLIBNAME)
207 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. $< -levent $(STLIBNAME) $(SSL_STLIBNAME) $(REAL_LDFLAGS) $(SSL_LDFLAGS)
208
209 hiredict-example-libev: examples/example-libev.c adapters/libev.h $(STLIBNAME)
210 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. $< -lev $(STLIBNAME) $(REAL_LDFLAGS)
211
212 hiredict-example-libhv: examples/example-libhv.c adapters/libhv.h $(STLIBNAME)
213 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. $< -lhv $(STLIBNAME) $(REAL_LDFLAGS)
214
215 hiredict-example-glib: examples/example-glib.c adapters/glib.h $(STLIBNAME)
216 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. $< $(shell pkg-config --cflags --libs glib-2.0) $(STLIBNAME) $(REAL_LDFLAGS)
217
218 hiredict-example-ivykis: examples/example-ivykis.c adapters/ivykis.h $(STLIBNAME)
219 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. $< -livykis $(STLIBNAME) $(REAL_LDFLAGS)
220
221 hiredict-example-macosx: examples/example-macosx.c adapters/macosx.h $(STLIBNAME)
222 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. $< -framework CoreFoundation $(STLIBNAME) $(REAL_LDFLAGS)
223
224 hiredict-example-ssl: examples/example-ssl.c $(STLIBNAME) $(SSL_STLIBNAME)
225 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. $< $(STLIBNAME) $(SSL_STLIBNAME) $(REAL_LDFLAGS) $(SSL_LDFLAGS)
226
227 hiredict-example-poll: examples/example-poll.c adapters/poll.h $(STLIBNAME)
228 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. $< $(STLIBNAME) $(REAL_LDFLAGS)
229
230 ifndef AE_DIR
231 hiredict-example-ae:
232 @echo "Please specify AE_DIR (e.g. <redict repository>/src)"
233 @false
234 else
235 hiredict-example-ae: examples/example-ae.c adapters/ae.h $(STLIBNAME)
236 $(CC) -o examples/$@ $(REAL_CFLAGS) $(REAL_LDFLAGS) -I. -I$(AE_DIR) $< $(AE_DIR)/ae.o $(AE_DIR)/zmalloc.o $(AE_DIR)/../deps/jemalloc/lib/libjemalloc.a -pthread $(STLIBNAME)
237 endif
238
239 ifndef LIBUV_DIR
240 # dynamic link libuv.so
241 hiredict-example-libuv: examples/example-libuv.c adapters/libuv.h $(STLIBNAME)
242 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. -I$(LIBUV_DIR)/include $< -luv -lpthread -lrt $(STLIBNAME) $(REAL_LDFLAGS)
243 else
244 # use user provided static lib
245 hiredict-example-libuv: examples/example-libuv.c adapters/libuv.h $(STLIBNAME)
246 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. -I$(LIBUV_DIR)/include $< $(LIBUV_DIR)/.libs/libuv.a -lpthread -lrt $(STLIBNAME) $(REAL_LDFLAGS)
247 endif
248
249 ifeq ($(and $(QT_MOC),$(QT_INCLUDE_DIR),$(QT_LIBRARY_DIR)),)
250 hiredict-example-qt:
251 @echo "Please specify QT_MOC, QT_INCLUDE_DIR AND QT_LIBRARY_DIR"
252 @false
253 else
254 hiredict-example-qt: examples/example-qt.cpp adapters/qt.h $(STLIBNAME)
255 $(QT_MOC) adapters/qt.h -I. -I$(QT_INCLUDE_DIR) -I$(QT_INCLUDE_DIR)/QtCore | \
256 $(CXX) -x c++ -o qt-adapter-moc.o -c - $(REAL_CFLAGS) -I. -I$(QT_INCLUDE_DIR) -I$(QT_INCLUDE_DIR)/QtCore
257 $(QT_MOC) examples/example-qt.h -I. -I$(QT_INCLUDE_DIR) -I$(QT_INCLUDE_DIR)/QtCore | \
258 $(CXX) -x c++ -o qt-example-moc.o -c - $(REAL_CFLAGS) -I. -I$(QT_INCLUDE_DIR) -I$(QT_INCLUDE_DIR)/QtCore
259 $(CXX) -o examples/$@ $(REAL_CFLAGS) $(REAL_LDFLAGS) -I. -I$(QT_INCLUDE_DIR) -I$(QT_INCLUDE_DIR)/QtCore -L$(QT_LIBRARY_DIR) qt-adapter-moc.o qt-example-moc.o $< -pthread $(STLIBNAME) -lQtCore
260 endif
261
262 hiredict-example: examples/example.c $(STLIBNAME)
263 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. $< $(STLIBNAME) $(REAL_LDFLAGS)
264
265 hiredict-example-push: examples/example-push.c $(STLIBNAME)
266 $(CC) -o examples/$@ $(REAL_CFLAGS) -I. $< $(STLIBNAME) $(REAL_LDFLAGS)
267
268 examples: $(EXAMPLES)
269
270 TEST_LIBS = $(STLIBNAME) $(SSL_STLIB)
271 TEST_LDFLAGS = $(SSL_LDFLAGS)
272 ifeq ($(USE_SSL),1)
273 TEST_LDFLAGS += -pthread
274 endif
275 ifeq ($(TEST_ASYNC),1)
276 TEST_LDFLAGS += -levent
277 endif
278
•279 hiredict-test: test.o
280 $(CC) -o $@ $(REAL_CFLAGS) $(shell pkgconf --cflags hiredict hiredict_ssl) -I. $^ $(REAL_LDFLAGS) $(shell pkgconf --libs hiredict hiredict_ssl) $(TEST_LDFLAGS)
281
282 hiredict-%: %.o $(STLIBNAME)
283 $(CC) $(REAL_CFLAGS) -o $@ $< $(TEST_LIBS) $(REAL_LDFLAGS)
284
285 test: hiredict-test
286 ./hiredict-test
287
288 check: hiredict-test
289 TEST_SSL=$(USE_SSL) ./test.sh
290
291 .c.o:
292 $(CC) -std=c99 -c $(REAL_CFLAGS) $<
293
294 clean:
295 rm -rf $(DYLIBNAME) $(STLIBNAME) $(SSL_DYLIBNAME) $(SSL_STLIBNAME) $(TESTS) \
296 $(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(SSL_PKGCONFNAME) $(SSL_SHIM_PKGCONFNAME) \
297 examples/hiredict-example* *.o *.gcda *.gcno *.gcov
•298 rm -f $(CMAKECONFNAME) $(CMAKEVERSNAME)
299
300 dep:
301 $(CC) $(CPPFLAGS) $(CFLAGS) -MM *.c
302
303 INSTALL?= cp -pPR
304
305 %.pc: %.pc.in
306 @echo "Generating $@ for pkgconfig..."
307 @sed -e 's#@PREFIX@#$(PREFIX)#' \
308 -e 's#@LIBDIR@#$(LIBRARY_PATH)#' \
309 -e 's#@PROJECT_VERSION@#$(HIREDICT_VERSION)#' \
310 "$<" > "$@"
311
•312 $(CMAKECONFNAME): $(CMAKECONFNAME).in
313 cp $(CMAKECONFNAME).in $(CMAKECONFNAME)
314
315 $(CMAKEVERSNAME): $(CMAKEVERSNAME).in
316 sed -e "s,@HIREDICT_VERSION@,$(HIREDICT_MAJOR).$(HIREDICT_MINOR).$(HIREDICT_PATCH),g" \
317 $(CMAKEVERSNAME).in >$(CMAKEVERSNAME)
318
319 install: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(SSL_INSTALL) $(CMAKECONFNAME) $(CMAKEVERSNAME)
320 mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_INCLUDE_PATH)/adapters $(INSTALL_LIBRARY_PATH) $(SHIM_INSTALL_INCLUDE_PATH) $(SHIM_INSTALL_INCLUDE_PATH)/adapters
321 $(INSTALL) hiredict.h async.h read.h sds.h alloc.h sockcompat.h $(INSTALL_INCLUDE_PATH)
322 $(INSTALL) shim/hiredis.h shim/async.h shim/read.h shim/sds.h shim/alloc.h shim/sockcompat.h $(SHIM_INSTALL_INCLUDE_PATH)
323 $(INSTALL) adapters/*.h $(INSTALL_INCLUDE_PATH)/adapters
324 $(INSTALL) shim/adapters/*.h $(SHIM_INSTALL_INCLUDE_PATH)/adapters
325 $(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME)
326 cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIBNAME) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME)
327 $(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH)
328 mkdir -p $(INSTALL_PKGCONF_PATH)
329 $(INSTALL) $(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(INSTALL_PKGCONF_PATH)
•330 mkdir -p $(INSTALL_CMAKE_PATH)
331 $(INSTALL) $(CMAKECONFNAME) $(INSTALL_CMAKE_PATH)
332 $(INSTALL) $(CMAKEVERSNAME) $(INSTALL_CMAKE_PATH)
333
334 install-ssl: $(SSL_DYLIBNAME) $(SSL_STLIBNAME) $(SSL_PKGCONFNAME) $(SSL_SHIM_PKGCONFNAME)
335 mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH) $(SHIM_INSTALL_INCLUDE_PATH)
336 $(INSTALL) hiredict_ssl.h $(INSTALL_INCLUDE_PATH)
337 $(INSTALL) shim/hiredis_ssl.h $(SHIM_INSTALL_INCLUDE_PATH)
338 $(INSTALL) $(SSL_DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(SSL_DYLIB_MINOR_NAME)
339 cd $(INSTALL_LIBRARY_PATH) && ln -sf $(SSL_DYLIB_MINOR_NAME) $(SSL_DYLIBNAME) && ln -sf $(SSL_DYLIB_MINOR_NAME) $(SSL_DYLIB_MAJOR_NAME)
340 $(INSTALL) $(SSL_STLIBNAME) $(INSTALL_LIBRARY_PATH)
341 mkdir -p $(INSTALL_PKGCONF_PATH)
342 $(INSTALL) $(SSL_PKGCONFNAME) $(SSL_SHIM_PKGCONFNAME) $(INSTALL_PKGCONF_PATH)
343
344 32bit:
345 @echo ""
346 @echo "WARNING: if this fails under Linux you probably need to install libc6-dev-i386"
347 @echo ""
348 $(MAKE) CFLAGS="-m32" LDFLAGS="-m32"
349
350 32bit-vars:
351 $(eval CFLAGS=-m32)
352 $(eval LDFLAGS=-m32)
353
354 gprof:
355 $(MAKE) CFLAGS="-pg" LDFLAGS="-pg"
356
357 gcov:
358 $(MAKE) CFLAGS+="-fprofile-arcs -ftest-coverage" LDFLAGS="-fprofile-arcs"
359
360 coverage: gcov
361 make check
362 mkdir -p tmp/lcov
363 lcov -d . -c --exclude '/usr*' -o tmp/lcov/hiredict.info
364 lcov -q -l tmp/lcov/hiredict.info
365 genhtml --legend -q -o tmp/lcov/report tmp/lcov/hiredict.info
366
367 noopt:
368 $(MAKE) OPTIMIZATION=""
369
370 .PHONY: all test check clean dep install 32bit 32bit-vars gprof gcov noopt