[package] uhttpd:
[openwrt.git] / package / uhttpd / src / Makefile
1 CGI_SUPPORT ?= 1
2 LUA_SUPPORT ?= 1
3 TLS_SUPPORT ?= 1
4
5 CFLAGS ?= -I./lua-5.1.4/src -I./cyassl-1.4.0/include -O0 -ggdb3
6 LDFLAGS ?= -L./lua-5.1.4/src -L./cyassl-1.4.0/src/.libs
7
8 CFLAGS += -Wall --std=gnu99
9
10 OBJ = uhttpd.o uhttpd-file.o uhttpd-utils.o
11 LIB = -Wl,--export-dynamic -lcrypt -ldl
12
13 TLSLIB =
14 LUALIB =
15
16
17 world: compile
18
19 ifeq ($(CGI_SUPPORT),1)
20 OBJ += uhttpd-cgi.o
21 CFLAGS += -DHAVE_CGI
22 endif
23
24 ifeq ($(LUA_SUPPORT),1)
25 CFLAGS += -DHAVE_LUA
26 LUALIB = uhttpd_lua.so
27
28 $(LUALIB): uhttpd-lua.c
29 $(CC) $(CFLAGS) $(LDFLAGS) $(FPIC) \
30 -shared -lm -llua -ldl \
31 -o $(LUALIB) uhttpd-lua.c
32 endif
33
34 ifeq ($(TLS_SUPPORT),1)
35 CFLAGS += -DHAVE_TLS
36 TLSLIB = uhttpd_tls.so
37
38 $(TLSLIB): uhttpd-tls.c
39 $(CC) $(CFLAGS) $(LDFLAGS) $(FPIC) \
40 -shared -lcyassl \
41 -o $(TLSLIB) uhttpd-tls.c
42 endif
43
44 %.o: %.c
45 $(CC) $(CFLAGS) -c -o $@ $<
46
47 compile: $(OBJ) $(TLSLIB) $(LUALIB)
48 $(CC) -o uhttpd $(LDFLAGS) $(LIB) $(OBJ)
49
50 clean:
51 rm -f *.o *.so uhttpd
52
This page took 0.040956 seconds and 5 git commands to generate.