zlib not needed if no extensions
[profile/ivi/libwebsockets.git] / lib / Makefile.am
1 lib_LTLIBRARIES=libwebsockets.la
2 include_HEADERS=libwebsockets.h
3 dist_libwebsockets_la_SOURCES=libwebsockets.c \
4                                 parsers.c \
5                                 handshake.c \
6                                 libwebsockets.h \
7                                 base64-decode.c \
8                                 output.c \
9                                 private-libwebsockets.h
10
11 if NO_EXTENSIONS
12 else
13 dist_libwebsockets_la_SOURCES+= extension.c \
14                                 extension-deflate-stream.c extension-deflate-stream.h \
15                                 extension-deflate-frame.c extension-deflate-frame.h
16 endif
17
18 if NO_DAEMONIZE
19 else
20 dist_libwebsockets_la_SOURCES+= daemonize.c
21 endif
22
23 if NO_CLIENT
24 else
25 dist_libwebsockets_la_SOURCES+= client.c \
26                                 client-parser.c \
27                                 client-handshake.c
28 endif
29
30 if NO_SERVER
31 else
32 dist_libwebsockets_la_SOURCES+= server.c \
33                                 server-handshake.c
34 endif
35
36 if USE_BUILTIN_GETIFADDRS
37 dist_libwebsockets_la_SOURCES += getifaddrs.c
38 endif
39
40 if LIBCRYPTO
41 else
42 dist_libwebsockets_la_SOURCES += md5.c sha-1.c
43 endif
44
45 libwebsockets_la_CFLAGS=-Wall -std=gnu99 -pedantic -g
46 libwebsockets_la_LDFLAGS=
47
48 if MINGW
49 libwebsockets_la_CFLAGS+= -w -I../win32port/win32helpers -I ../win32port/zlib/
50 libwebsockets_la_LDFLAGS+= -lm -luser32 -ladvapi32 -lkernel32 -lgcc
51 else
52 libwebsockets_la_CFLAGS+= -rdynamic -fPIC -Werror
53 libwebsockets_la_LDFLAGS+=  -version-info 1:0
54 endif
55
56 libwebsockets_la_CFLAGS+= -c \
57         -DINSTALL_DATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
58 if NO_EXTENSIONS
59 else
60 libwebsockets_la_LDFLAGS+= -lz
61 endif
62
63 all-local:
64          ../scripts/kernel-doc -html \
65                 libwebsockets.c \
66                 parsers.c \
67                 client-handshake.c \
68                 libwebsockets.h \
69                         > ../libwebsockets-api-doc.html
70