refactor and introduce without server configure option
[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                                 extension.c \
10                                 extension-deflate-stream.c extension-deflate-stream.h \
11                                 extension-deflate-frame.c extension-deflate-frame.h\
12                                 private-libwebsockets.h
13
14 if NO_DAEMONIZE
15 else
16 dist_libwebsockets_la_SOURCES+= daemonize.c
17 endif
18
19 if NO_CLIENT
20 else
21 dist_libwebsockets_la_SOURCES+= client.c \
22                                 client-parser.c \
23                                 client-handshake.c
24 endif
25
26 if NO_SERVER
27 else
28 dist_libwebsockets_la_SOURCES+= server.c \
29                                 server-handshake.c
30 endif
31
32 if USE_BUILTIN_GETIFADDRS
33 dist_libwebsockets_la_SOURCES += getifaddrs.c
34 endif
35
36 if LIBCRYPTO
37 else
38 dist_libwebsockets_la_SOURCES += md5.c sha-1.c
39 endif
40
41 libwebsockets_la_CFLAGS=-Wall -std=gnu99 -pedantic -g
42 libwebsockets_la_LDFLAGS=
43
44 if MINGW
45 libwebsockets_la_CFLAGS+= -w -I../win32port/win32helpers -I ../win32port/zlib/
46 libwebsockets_la_LDFLAGS+= -lm -luser32 -ladvapi32 -lkernel32 -lgcc
47 else
48 libwebsockets_la_CFLAGS+= -rdynamic -fPIC -Werror
49 libwebsockets_la_LDFLAGS+=  -version-info 1:0
50 endif
51
52 libwebsockets_la_CFLAGS+= -c \
53         -DINSTALL_DATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
54 libwebsockets_la_LDFLAGS+= -lz
55
56 all-local:
57          ../scripts/kernel-doc -html \
58                 libwebsockets.c \
59                 parsers.c \
60                 client-handshake.c \
61                 libwebsockets.h \
62                         > ../libwebsockets-api-doc.html
63