1 | SRCS= string.c shttpd.c log.c auth.c md5.c cgi.c config.c io_ssi.c \ |
---|
2 | io_file.c io_socket.c io_ssl.c io_emb.c io_dir.c io_cgi.c |
---|
3 | HDRS= defs.h llist.h shttpd.h std_includes.h io.h md5.h ssl.h \ |
---|
4 | compat_unix.h compat_win32.h compat_rtems.h config.h |
---|
5 | OBJS= $(SRCS:%.c=%.o) |
---|
6 | PROG= shttpd |
---|
7 | |
---|
8 | # Possible flags: (in brackets are rough numbers for 'gcc -O2' on i386) |
---|
9 | # -DHAVE_MD5 - use system md5 library (-2kb) |
---|
10 | # -DNDEBUG - strip off all debug code (-5kb) |
---|
11 | # -D_DEBUG - build debug version (very noisy) (+6kb) |
---|
12 | # -DNO_CGI - disable CGI support (-5kb) |
---|
13 | # -DNO_SSL - disable SSL functionality (-2kb) |
---|
14 | # -DNO_AUTH - disable authorization support (-4kb) |
---|
15 | # -DCONFIG=\"file\" - use `file' as the default config file |
---|
16 | # -DNO_SSI - disable SSI support (-4kb) |
---|
17 | |
---|
18 | # XXX Note for the windows users. In order to build shttpd, MSVS6 is needed. |
---|
19 | # Follow these steps: |
---|
20 | # 1. Add c:\path_to_msvs6\bin to the system Path environment variable. |
---|
21 | # 2. Add two new system environment variables: |
---|
22 | # LIB=c:\path_to_msvs6\lib |
---|
23 | # INCLUDE=c:\path_to_msvs6\include |
---|
24 | # 3. start console, go to shttpd-VERSION\src\ directory |
---|
25 | # 4. type "nmake msvc" |
---|
26 | # 5. go to shttpd-VERSION\examples , type "nmake msvc" |
---|
27 | |
---|
28 | |
---|
29 | VC6= ..\..\.. # MSVC installation path |
---|
30 | CL_FLAGS= /MD /TC /nologo /DNDEBUG /Os # MSVC compiler flags |
---|
31 | |
---|
32 | all: |
---|
33 | @echo "make (unix|msvc|mingw|rtems)" |
---|
34 | @echo on Linux, do \'LIBS=-ldl make unix\' |
---|
35 | |
---|
36 | .c.o: |
---|
37 | $(CC) -c $(CFLAGS) $< -o $@ |
---|
38 | |
---|
39 | unix: $(OBJS) |
---|
40 | $(AR) -r lib$(PROG).a $(OBJS) && ranlib lib$(PROG).a |
---|
41 | $(CC) $(CFLAGS) compat_unix.c standalone.c \ |
---|
42 | -o $(PROG) $(LIBS) -L. -l$(PROG) |
---|
43 | |
---|
44 | rtems: |
---|
45 | $(CC) -c $(CFLAGS) -DEMBEDDED $(SRCS) compat_rtems.c |
---|
46 | $(AR) -r lib$(PROG).a *.o && ranlib lib$(PROG).a |
---|
47 | |
---|
48 | #cl $(SRCS) compat_win32.c /c $(CL_FLAGS) /DEMBEDDED |
---|
49 | #lib *.obj /out:shttpd.lib |
---|
50 | |
---|
51 | msvc: |
---|
52 | $(VC6)\bin\cl /I $(VC6)\include \ |
---|
53 | $(SRCS) compat_win32.c standalone.c $(CL_FLAGS) \ |
---|
54 | /link /out:$(PROG).exe /LIBPATH:$(VC6)\lib ws2_32.lib user32.lib |
---|
55 | |
---|
56 | mingw: |
---|
57 | $(CC) -c $(CFLAGS) -DEMBEDDED $(SRCS) compat_win32.c |
---|
58 | $(AR) -r lib$(PROG).a *.o && ranlib lib$(PROG).a |
---|
59 | $(CC) $(CFLAGS) $(SRCS) compat_win32.c standalone.c \ |
---|
60 | -o $(PROG) $(LIBS) -lws2_32 -lcomdlg32 -lcomctl32 |
---|
61 | |
---|
62 | man: |
---|
63 | cat shttpd.1 | tbl | groff -man -Tascii | col -b > shttpd.1.txt |
---|
64 | cat shttpd.1 | tbl | groff -man -Tascii | less |
---|
65 | |
---|
66 | clean: |
---|
67 | rm -rf *.o *.core $(PROG) lib$(PROG).a |
---|