initial capture of my stuff
[rrq/thttpd.git] / Makefile
1 # Generated automatically from Makefile.in by configure.
2 # Makefile.in for thttpd
3 #
4 # Copyright © 1995,1998 by Jef Poskanzer <jef@mail.acme.com>.
5 # All rights reserved.
6 #
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions
9 # are met:
10 # 1. Redistributions of source code must retain the above copyright
11 #    notice, this list of conditions and the following disclaimer.
12 # 2. Redistributions in binary form must reproduce the above copyright
13 #    notice, this list of conditions and the following disclaimer in the
14 #    documentation and/or other materials provided with the distribution.
15
16 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 # ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 # SUCH DAMAGE.
27
28 # Various configurable paths (remember to edit Makefile.in, not Makefile)
29
30 # Top level hierarchy.
31 prefix = /usr/local
32 exec_prefix = ${prefix}
33 # Pathname of directory to install the binary.
34 BINDIR = ${exec_prefix}/sbin
35 # Pathname of directory to install the man page.
36 MANDIR = /usr/local/man
37 # Pathname of directory to install the CGI programs.
38 WEBDIR = $(prefix)/www
39
40 # CONFIGURE: The group that the web directory belongs to.  This is so that
41 # the makeweb program can be installed set-group-id to that group, and make
42 # subdirectories.  If you're not going to use makeweb, ignore this.
43 WEBGROUP =      www
44
45 # CONFIGURE: Directory for CGI executables.
46 CGIBINDIR =     $(WEBDIR)/cgi-bin
47
48 # You shouldn't need to edit anything below here.
49
50 CC =            gcc
51 CCOPT =         -O2
52 DEFS =           -DHAVE__PROGNAME=1 -DHAVE_FCNTL_H=1 -DHAVE_GRP_H=1 -DHAVE_MEMORY_H=1 -DHAVE_PATHS_H=1 -DHAVE_POLL_H=1 -DHAVE_SYS_POLL_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_DIRENT_H=1 -DHAVE_LIBCRYPT=1 -DHAVE_STRERROR=1 -DHAVE_WAITPID=1 -DHAVE_VSNPRINTF=1 -DHAVE_DAEMON=1 -DHAVE_SETSID=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_SIGSET=1 -DHAVE_ATOLL=1 -DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_MMAP=1 -DHAVE_SELECT=1 -DHAVE_POLL=1 -DHAVE_TM_GMTOFF=1 -DHAVE_INT64T=1 -DHAVE_SOCKLENT=1 
53 INCLS =         -I.
54 CFLAGS =        $(CCOPT) $(DEFS) $(INCLS)
55 LDFLAGS =       
56 LIBS =          -lcrypt 
57 NETLIBS =       
58 INSTALL =       /usr/bin/install -c
59
60
61
62 .c.o:
63         @rm -f $@
64         $(CC) $(CFLAGS) -c $*.c
65
66 SRC =           thttpd.c libhttpd.c fdwatch.c mmc.c timers.c match.c tdate_parse.c
67
68 OBJ =           $(SRC:.c=.o) 
69
70 ALL =           thttpd
71
72 GENHDR =        mime_encodings.h mime_types.h
73
74 CLEANFILES =    $(ALL) $(OBJ) $(GENSRC) $(GENHDR)
75
76 #SUBDIRS =      cgi-src extras
77
78 all:            this subdirs
79 this:           $(ALL)
80
81 thttpd: $(OBJ)
82         @rm -f $@
83         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(NETLIBS)
84
85 mime_encodings.h:       mime_encodings.txt
86         rm -f mime_encodings.h
87         sed < mime_encodings.txt > mime_encodings.h \
88           -e 's/#.*//' -e 's/[  ]*$$//' -e '/^$$/d' \
89           -e 's/[       ][      ]*/", 0, "/' -e 's/^/{ "/' -e 's/$$/", 0 },/'
90
91 mime_types.h:   mime_types.txt
92         rm -f mime_types.h
93         sed < mime_types.txt > mime_types.h \
94           -e 's/#.*//' -e 's/[  ]*$$//' -e '/^$$/d' \
95           -e 's/[       ][      ]*/", 0, "/' -e 's/^/{ "/' -e 's/$$/", 0 },/'
96
97
98 subdirs:
99         for i in $(SUBDIRS) ; do ( \
100             cd $$i ; \
101             pwd ; \
102             $(MAKE) $(MFLAGS) \
103                 WEBDIR=$(WEBDIR) \
104                 CGIBINDIR=$(CGIBINDIR) \
105                 MANDIR=$(MANDIR) \
106                 WEBGROUP=$(WEBGROUP) \
107         ) ; done
108
109
110 install:        installthis install-man # installsubdirs
111
112 installthis:
113         -mkdir -p $(DESTDIR)$(BINDIR)
114         $(INSTALL) -m 555 -o bin -g bin thttpd $(DESTDIR)$(BINDIR)
115
116 install-man:
117         -mkdir -p $(DESTDIR)$(MANDIR)/man8
118         $(INSTALL) -m 444 -o bin -g bin thttpd.8 $(DESTDIR)$(MANDIR)/man8
119
120 installsubdirs:
121         for i in $(SUBDIRS) ; do ( \
122             cd $$i ; \
123             pwd ; \
124             $(MAKE) $(MFLAGS) \
125                 WEBDIR=$(WEBDIR) \
126                 CGIBINDIR=$(CGIBINDIR) \
127                 MANDIR=$(MANDIR) \
128                 WEBGROUP=$(WEBGROUP) \
129                 install \
130         ) ; done
131
132
133 clean:          cleansubdirs
134         rm -f $(CLEANFILES)
135
136 distclean:      distcleansubdirs
137         rm -f $(CLEANFILES) Makefile config.cache config.log config.status tags
138
139 cleansubdirs:
140         for i in $(SUBDIRS) ; do ( \
141             cd $$i ; \
142             pwd ; \
143             $(MAKE) $(MFLAGS) clean \
144         ) ; done
145
146 distcleansubdirs:
147         for i in $(SUBDIRS) ; do ( \
148             cd $$i ; \
149             pwd ; \
150             $(MAKE) $(MFLAGS) distclean \
151         ) ; done
152
153 tags:
154         ctags -wtd *.c *.h
155
156 tar:
157         @name=`sed -n -e '/SERVER_SOFTWARE/!d' -e 's,.*thttpd/,thttpd-,' -e 's, .*,,p' version.h` ; \
158           rm -rf $$name ; \
159           mkdir $$name ; \
160           tar cf - `cat FILES` | ( cd $$name ; tar xfBp - ) ; \
161           chmod 644 $$name/Makefile.in $$name/config.h $$name/mime_encodings.txt $$name/mime_types.txt ; \
162           chmod 755 $$name/cgi-bin $$name/cgi-src $$name/contrib $$name/contrib/redhat-rpm $$name/extras $$name/scripts ; \
163           tar cf $$name.tar $$name ; \
164           rm -rf $$name ; \
165           gzip $$name.tar
166
167 thttpd.o:       config.h version.h libhttpd.h fdwatch.h mmc.h timers.h match.h
168 libhttpd.o:     config.h version.h libhttpd.h mime_encodings.h mime_types.h \
169                 mmc.h timers.h match.h tdate_parse.h
170 fdwatch.o:      fdwatch.h
171 mmc.o:          mmc.h libhttpd.h
172 timers.o:       timers.h
173 match.o:        match.h
174 tdate_parse.o:  tdate_parse.h