File: Makefile

package info (click to toggle)
opensips 2.2.2-3.1
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 31,160 kB
  • sloc: ansic: 334,348; xml: 91,231; perl: 6,659; sh: 5,148; sql: 4,175; makefile: 3,167; yacc: 2,499; python: 1,197; cpp: 611; php: 573
file content (46 lines) | stat: -rw-r--r-- 1,290 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# $Id: Makefile 5862 2009-07-15 10:06:05Z andreidragus $
#
# Memcached implementation for memcache API.
#
#
# WARNING: do not run this directly, it should be run by the master Makefile

include ../../Makefile.defs
auto_gen=
NAME=json.so

ifeq ($(CROSS_COMPILE),)
JSON_BUILDER = $(shell \
	if pkg-config --exists json; then \
		echo 'pkg-config json'; \
	elif pkg-config --exists json-c; then\
		echo 'pkg-config json-c'; \
	fi)

endif

ifeq ($(JSON_BUILDER),)
	DEFS += -I$(LOCALBASE)/include -I$(SYSBASE)/include
	LIBS += -L$(LOCALBASE)/lib -ljson
else
	JSON_PKG_VER = $(shell $(JSON_BUILDER) --modversion)
	JSON_PKG_MAJOR = $(shell \
		ver_tmp=`echo '$(JSON_PKG_VER)' | cut -f1 -d.`; \
		if [ -z "$$ver_tmp" ]; then ver_tmp=0; fi; \
		echo "$$ver_tmp";)
	JSON_PKG_MINOR = $(shell \
		ver_tmp=`echo '$(JSON_PKG_VER)' | cut -f2 -d.`; \
		if [ -z "$$ver_tmp" ]; then ver_tmp=0; fi; \
		echo "$$ver_tmp";)
	JSON_PKG_MICRO = $(shell \
		ver_tmp=`echo '$(JSON_PKG_VER)' | cut -f3 -d.`; \
		if [ -z "$$ver_tmp" ]; then ver_tmp=0; fi; \
		echo "$$ver_tmp";)
	DEFS += $(shell $(JSON_BUILDER) --cflags) \
		-DJSON_PKG_MAJOR=$(JSON_PKG_MAJOR) \
		-DJSON_PKG_MINOR=$(JSON_PKG_MINOR) \
		-DJSON_PKG_MICRO=$(JSON_PKG_MICRO)
	LIBS += $(shell $(JSON_BUILDER) --libs)
endif

include ../../Makefile.modules