Root/package/uhttpd/src/Makefile

1CGI_SUPPORT ?= 1
2LUA_SUPPORT ?= 1
3TLS_SUPPORT ?= 1
4
5CFLAGS ?= -I./lua-5.1.4/src -I./cyassl-1.4.0/include -O0 -ggdb3
6LDFLAGS ?= -L./lua-5.1.4/src -L./cyassl-1.4.0/src/.libs
7
8CFLAGS += -Wall --std=gnu99
9
10OBJ = uhttpd.o uhttpd-file.o uhttpd-utils.o
11LIB = -Wl,--export-dynamic -lcrypt -ldl
12
13TLSLIB =
14LUALIB =
15
16
17world: compile
18
19ifeq ($(CGI_SUPPORT),1)
20  OBJ += uhttpd-cgi.o
21  CFLAGS += -DHAVE_CGI
22endif
23
24ifeq ($(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
32endif
33
34ifeq ($(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
42endif
43
44%.o: %.c
45    $(CC) $(CFLAGS) -c -o $@ $<
46
47compile: $(OBJ) $(TLSLIB) $(LUALIB)
48    $(CC) -o uhttpd $(LDFLAGS) $(LIB) $(OBJ)
49
50clean:
51    rm -f *.o *.so uhttpd
52
53

Archive Download this file



interactive