e4f9ce01749f7b14065292212962392528d73590
[profile/ivi/libwebsockets.git] / lib / Makefile.am
1 @applyhash@
2
3 lib_LTLIBRARIES=libwebsockets.la
4 include_HEADERS=libwebsockets.h
5 dist_libwebsockets_la_SOURCES=libwebsockets.c \
6                                 parsers.c \
7                                 handshake.c \
8                                 libwebsockets.h \
9                                 base64-decode.c \
10                                 output.c \
11                                 private-libwebsockets.h
12
13 if NO_EXTENSIONS
14 else
15 dist_libwebsockets_la_SOURCES+= extension.c \
16                                 extension-deflate-stream.c extension-deflate-stream.h \
17                                 extension-deflate-frame.c extension-deflate-frame.h
18 endif
19
20 if NO_DAEMONIZE
21 else
22 dist_libwebsockets_la_SOURCES+= daemonize.c
23 endif
24
25 if NO_CLIENT
26 else
27 dist_libwebsockets_la_SOURCES+= client.c \
28                                 client-parser.c \
29                                 client-handshake.c
30 endif
31
32 if NO_SERVER
33 else
34 dist_libwebsockets_la_SOURCES+= server.c \
35                                 server-handshake.c
36 endif
37
38 if USE_BUILTIN_GETIFADDRS
39 dist_libwebsockets_la_SOURCES += getifaddrs.c
40 endif
41
42 if LIBCRYPTO
43 else
44 dist_libwebsockets_la_SOURCES += sha-1.c
45 endif
46
47 libwebsockets_la_CFLAGS=-Wall -std=gnu99 -pedantic
48 libwebsockets_la_LDFLAGS=
49
50 # uncomment below and use cat ./lib/.libs/*.su | sort -k2g | tac
51 # to get a worst-first list of static stack usage if you have gcc 4.6+
52 #libwebsockets_la_CFLAGS+= -fstack-usage
53
54 if USE_CYASSL
55 libwebsockets_la_LDFLAGS+= -lcyassl
56 endif
57
58 if DISABLE_DEBUG
59 libwebsockets_la_CFLAGS+= -O4
60 else
61 libwebsockets_la_CFLAGS+= -O0 -g
62 endif
63
64 if MINGW
65 libwebsockets_la_CFLAGS+= -w -I../win32port/win32helpers -I ../win32port/zlib/
66 libwebsockets_la_LDFLAGS+= -lm -luser32 -ladvapi32 -lkernel32 -lgcc
67 else
68 libwebsockets_la_CFLAGS+= -rdynamic -fPIC -Werror
69 # notice http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html has rules for how to bump this
70 libwebsockets_la_LDFLAGS+=  -version-info 3:0:0
71 endif
72
73 libwebsockets_la_CFLAGS+= -c \
74         -DINSTALL_DATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
75 if NO_EXTENSIONS
76 else
77 libwebsockets_la_LDFLAGS+= -lz
78 endif
79
80 all-local:
81          ../scripts/kernel-doc -html \
82                 *.c \
83                 libwebsockets.h \
84                         > ../libwebsockets-api-doc.html
85          ../scripts/kernel-doc -text \
86                 *.c \
87                 libwebsockets.h \
88                         > ../libwebsockets-api-doc.txt
89