bind gcc debug generation to_DEBUG
[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 += sha-1.c
43 endif
44
45 libwebsockets_la_CFLAGS=-Wall -std=gnu99 -pedantic -g
46 libwebsockets_la_LDFLAGS=
47
48 if DISABLE_DEBUG
49 libwebsockets_la_CFLAGS+= -O4
50 else
51 libwebsockets_la_CFLAGS+= -g
52 endif
53
54 if MINGW
55 libwebsockets_la_CFLAGS+= -w -I../win32port/win32helpers -I ../win32port/zlib/
56 libwebsockets_la_LDFLAGS+= -lm -luser32 -ladvapi32 -lkernel32 -lgcc
57 else
58 libwebsockets_la_CFLAGS+= -rdynamic -fPIC -Werror
59 libwebsockets_la_LDFLAGS+=  -version-info 1:0
60 endif
61
62 libwebsockets_la_CFLAGS+= -c \
63         -DINSTALL_DATADIR=\"@datadir@\" -DLWS_OPENSSL_CLIENT_CERTS=\"@clientcertdir@\"
64 if NO_EXTENSIONS
65 else
66 libwebsockets_la_LDFLAGS+= -lz
67 endif
68
69 all-local:
70          ../scripts/kernel-doc -html \
71                 libwebsockets.c \
72                 parsers.c \
73                 client-handshake.c \
74                 libwebsockets.h \
75                         > ../libwebsockets-api-doc.html
76