6 CFLAGS ?
= -I.
/lua-5.1
.4/src
-I
$(TLS_INCLUDE_DIR
) -O0
-ggdb3
7 LDFLAGS ?
= -L.
/lua-5.1
.4/src
-L
$(TLS_LIB_DIR
)
9 CFLAGS
+= -Wall
--std
=gnu99
11 ifeq ($(UHTTPD_TLS
),openssl
)
13 TLS_INCLUDE_DIR
:= .
/openssl-0.9
.8m
/include
14 TLS_LIB_DIR
:= .
/openssl-0.9
.8m
16 TLS_LDFLAGS
:= -lcyassl
17 TLS_INCLUDE_DIR
:= .
/cyassl-1.4
.0/include
18 TLS_LIB_DIR
:= .
/cyassl-1.4
.0/src
/.libs
21 OBJ
:= uhttpd.o uhttpd-file.o uhttpd-utils.o
22 LIB
:= -Wl
,--export-dynamic
-lcrypt
-ldl
27 HAVE_SHADOW
=$(shell echo
'int main(void){ return !getspnam("root"); }' | \
28 $(CC
) -include shadow.h
-xc
-o
/dev
/null
- 2>/dev
/null
&& echo yes
)
30 ifeq ($(HAVE_SHADOW
),yes
)
31 CFLAGS
+= -DHAVE_SHADOW
36 ifeq ($(CGI_SUPPORT
),1)
41 ifeq ($(LUA_SUPPORT
),1)
43 LUALIB
:= uhttpd_lua.so
45 $(LUALIB
): uhttpd-lua.c
46 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(FPIC
) \
47 -shared
-lm
-llua
-ldl \
48 -o
$(LUALIB
) uhttpd-lua.c
51 ifeq ($(TLS_SUPPORT
),1)
53 TLSLIB
:= uhttpd_tls.so
55 $(TLSLIB
): uhttpd-tls.c
56 $(CC
) $(CFLAGS
) $(LDFLAGS
) $(FPIC
) \
57 -shared
$(TLS_LDFLAGS
) \
58 -o
$(TLSLIB
) uhttpd-tls.c
62 $(CC
) $(CFLAGS
) -c
-o
$@
$<
64 compile
: $(OBJ
) $(TLSLIB
) $(LUALIB
)
65 $(CC
) -o uhttpd
$(LDFLAGS
) $(LIB
) $(OBJ
)