This repository was archived by the owner on Nov 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathMakefile.unix
More file actions
99 lines (76 loc) · 3.32 KB
/
Copy pathMakefile.unix
File metadata and controls
99 lines (76 loc) · 3.32 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Programs
AWK ?= awk
CUT ?= cut
ERL ?= erl
GREP ?= grep
RM ?= rm -f
# Erlang paths.
ERLANG_ROOT_DIR ?= $(shell $(ERL) -noshell -eval 'io:format(code:root_dir())' -run erlang halt)
ERLANG_LIB_DIR_erl_interface ?= $(shell $(ERL) -noshell -eval 'io:format(code:lib_dir(erl_interface))' -run erlang halt)
# Compile/link flags.
EI_CPPFLAGS ?= -I$(ERLANG_ROOT_DIR)/usr/include \
-I$(ERLANG_LIB_DIR_erl_interface)/include
EI_LDFLAGS ?= -L$(ERLANG_LIB_DIR_erl_interface)/lib
EI_LIBS ?= -lei_st
EXPAT_CPPFLAGS ?= -I/usr/include
EXPAT_LDFLAGS ?= -L/usr/lib
EXPAT_LIBS ?= -lexpat
ZLIB_CPPFLAGS ?= -I/usr/include
ZLIB_LDFLAGS ?= -L/usr/lib
ZLIB_LIBS ?= -lz
OPENSSL_CPPFLAGS ?= -I/usr/include
OPENSSL_LDFLAGS ?= -L/usr/lib
OPENSSL_LIBS ?= -lssl -lcrypto
ifeq ($(shell uname), Darwin)
DYNAMIC_LIB_CFLAGS = -fPIC -bundle -flat_namespace -undefined suppress
else
DYNAMIC_LIB_CFLAGS = -Wall -fpic -shared
endif
DRIVERS = exmpp_xml_expat.so \
exmpp_stringprep.so \
exmpp_tls_openssl.so \
exmpp_compress_zlib.so
all: $(DRIVERS)
clean:
$(RM) $(DRIVERS)
$(RM) $(BUILT_SOURCES)
.PHONY: clean
# --------------------------------------------------------------------
# Supported port drivers.
# --------------------------------------------------------------------
# Generated headers.
BUILT_SOURCES = xmpp_nss.h xmpp_names.h xmpp_attrs.h
xmpp_nss.h: xmpp_nss.h.awk xmpp_nss.h.in
$(AWK) -f xmpp_nss.h.awk xmpp_nss.h.in > $@
xmpp_names.h: xmpp_names.h.awk xmpp_names.h.in
$(AWK) -f xmpp_names.h.awk xmpp_names.h.in > $@
xmpp_attrs.h: xmpp_attrs.h.awk xmpp_attrs.h.in
$(AWK) -f xmpp_attrs.h.awk xmpp_attrs.h.in > $@
# Expat port driver
exmpp_xml_expat_la_CPPFLAGS = -Icontrib \
$(EI_CPPFLAGS) \
$(EXPAT_CPPFLAGS)
exmpp_xml_expat_la_LDFLAGS = $(EI_LDFLAGS) $(EI_LIBS) \
$(EXPAT_LDFLAGS) $(EXPAT_LIBS)
exmpp_xml_expat_la_SOURCES = contrib/hashtable.c \
exmpp_xml_expat.c
exmpp_xml_expat.so: $(BUILT_SOURCES) $(exmpp_xml_expat_la_SOURCES)
$(CC) $(exmpp_xml_expat_la_CPPFLAGS) $(CPPFLAGS) $(DYNAMIC_LIB_CFLAGS) $(CFLAGS) $(exmpp_xml_expat_la_LDFLAGS) $(LDFLAGS) $(exmpp_xml_expat_la_SOURCES) -o $@
# Stringprep port driver.
exmpp_stringprep_la_CPPFLAGS = $(EI_CPPFLAGS)
exmpp_stringprep_la_LDFLAGS = $(EI_LDFLAGS) $(EI_LIBS)
exmpp_stringprep_la_SOURCES = exmpp_stringprep.c
exmpp_stringprep.so: $(exmpp_stringprep_la_SOURCES)
$(CC) $(exmpp_stringprep_la_CPPFLAGS) $(CPPFLAGS) $(DYNAMIC_LIB_CFLAGS) $(CFLAGS) $(exmpp_stringprep_la_LDFLAGS) $(LDFLAGS) $(exmpp_stringprep_la_SOURCES) -o $@
# OpenSSL TLS port driver.
exmpp_tls_openssl_la_CPPFLAGS = $(EI_CPPFLAGS)
exmpp_tls_openssl_la_LDFLAGS = $(EI_LDFLAGS) $(EI_LIBS)
exmpp_tls_openssl_la_SOURCES = exmpp_tls.c exmpp_tls_openssl.c
exmpp_tls_openssl.so: $(exmpp_tls_openssl_la_SOURCES)
$(CC) $(exmpp_tls_openssl_la_CPPFLAGS) $(CPPFLAGS) $(DYNAMIC_LIB_CFLAGS) $(CFLAGS) $(exmpp_tls_openssl_la_LDFLAGS) $(LDFLAGS) $(exmpp_tls_openssl_la_SOURCES) -o $@
# OpenSSL TLS port driver.
exmpp_compress_zlib_la_CPPFLAGS = $(EI_CPPFLAGS)
exmpp_compress_zlib_la_LDFLAGS = $(EI_LDFLAGS) $(EI_LIBS)
exmpp_compress_zlib_la_SOURCES = exmpp_compress_zlib.c
exmpp_compress_zlib.so: $(exmpp_compress_zlib_la_SOURCES)
$(CC) $(exmpp_compress_zlib_la_CPPFLAGS) $(CPPFLAGS) $(DYNAMIC_LIB_CFLAGS) $(CFLAGS) $(exmpp_compress_zlib_la_LDFLAGS) $(LDFLAGS) $(exmpp_compress_zlib_la_SOURCES) -o $@