6 CFLAGS ?= -I./lua-5.1.4/src $(TLS_CFLAGS) -O0 -ggdb3
7 LDFLAGS ?= -L./lua-5.1.4/src
9 CFLAGS += -Wall --std=gnu99
11 ifeq ($(UHTTPD_TLS),openssl)
12 TLS_LDFLAGS ?= -L./openssl-0.9.8m -lssl
13 TLS_CFLAGS ?= -I./openssl-0.9.8m/include -DTLS_IS_OPENSSL
15 TLS_LDFLAGS ?= -L./cyassl-1.4.0/src/.libs -lcyassl
16 TLS_CFLAGS ?= -I./cyassl-1.4.0/include -DTLS_IS_CYASSL
19 OBJ := uhttpd.o uhttpd-file.o uhttpd-utils.o
20 LIB := -Wl,--export-dynamic -lcrypt -ldl
25 HAVE_SHADOW=$(shell echo 'int main(void){ return !getspnam("root"); }' | \
26 $(CC) -include shadow.h -xc -o/dev/null - 2>/dev/null && echo yes)
28 ifeq ($(HAVE_SHADOW),yes)
29 CFLAGS += -DHAVE_SHADOW
32 ifeq ($(TLS_SUPPORT),1)
36 ifeq ($(CGI_SUPPORT),1)
40 ifeq ($(LUA_SUPPORT),1)
47 ifeq ($(CGI_SUPPORT),1)
51 ifeq ($(LUA_SUPPORT),1)
52 LUALIB := uhttpd_lua.so
54 $(LUALIB): uhttpd-lua.c
55 $(CC) $(CFLAGS) $(LDFLAGS) $(FPIC) \
56 -shared -lm -llua -ldl \
57 -o $(LUALIB) uhttpd-lua.c
60 ifeq ($(TLS_SUPPORT),1)
61 TLSLIB := uhttpd_tls.so
63 $(TLSLIB): uhttpd-tls.c
64 $(CC) $(CFLAGS) $(LDFLAGS) $(FPIC) \
65 -shared $(TLS_LDFLAGS) \
66 -o $(TLSLIB) uhttpd-tls.c
70 $(CC) $(CFLAGS) -c -o $@ $<
72 compile: $(OBJ) $(TLSLIB) $(LUALIB)
73 $(CC) -o uhttpd $(LDFLAGS) $(OBJ) $(LIB)