added solaris-dist
[privoxy.git] / GNUmakefile.in
1 # Note:  Makefile is built automatically from Makefile.in
2 #
3 # $Id: GNUmakefile.in,v 1.34 2002/03/27 10:30:11 swa Exp $
4 #
5 # Written by and Copyright (C) 2001 the SourceForge
6 # Privoxy team. http://www.privoxy.org/
7 #
8 # Based on the Internet Junkbuster originally written
9 # by and Copyright (C) 1997 Anonymous Coders and 
10 # Junkbusters Corporation.  http://www.junkbusters.com
11 #
12 # This program is free software; you can redistribute it 
13 # and/or modify it under the terms of the GNU General
14 # Public License as published by the Free Software
15 # Foundation; either version 2 of the License, or (at
16 # your option) any later version.
17 #
18 # This program is distributed in the hope that it will
19 # be useful, but WITHOUT ANY WARRANTY; without even the
20 # implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE.  See the GNU General Public
22 # License for more details.
23 #
24 # The GNU General Public License should be included with
25 # this file.  If not, you can view it at
26 # http://www.gnu.org/copyleft/gpl.html
27 # or write to the Free Software Foundation, Inc., 59
28 # Temple Place - Suite 330, Boston, MA  02111-1307, USA.
29 #
30
31 #############################################################################
32 # Version number (for RPM)
33 #############################################################################
34
35 VERSION_MAJOR = @VERSION_MAJOR@
36 VERSION_MINOR = @VERSION_MINOR@
37 VERSION_POINT = @VERSION_POINT@
38 CODE_STATUS   = @CODE_STATUS@
39 VERSION       = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_POINT)
40 # will automatically be postfixed with -$(RPM_PACKAGEV) in the SPECfile
41 RPM_VERSION   = $(VERSION)
42 RPM_PACKAGEV  = @VERSION_RPM_PACKAGE@
43
44
45 #############################################################################
46 # Directories for "make install"
47 #############################################################################
48
49 DEST        = @sysconfdir@/privoxy
50 SBIN_DEST   = @sbindir@
51 MAN_DEST    = @mandir@
52
53
54 #############################################################################
55 # Build tools
56 #############################################################################
57
58 PROGRAM    = privoxy@EXEEXT@
59 CC         = @CC@
60 ECHO       = echo
61 GZIP_PROG  = gzip
62 INSTALL    = cp -f
63 LD         = @CC@
64 RM         = rm -f
65 STRIP_PROG = strip
66 SED        = sed
67 CAT        = cat
68 RPM        = rpm
69 MV         = mv
70 TAR        = tar
71 MAKE       = make
72 LN         = ln
73 WDUMP      = @WDUMP@ -dump
74 JADEBIN    = @JADEBIN@
75 DB         = $(JADEBIN) -t sgml -ihtml -D.. -d ldpOK.dsl\#html
76 DB2HTML    = @DB2HTML@
77 DKPREFIX   = @DKPREFIX@
78 MAN2HTML   = @MAN2HTML@
79
80 # Program to do LF->CRLF
81 #
82 # The sed version should be the most portable, but it doesn't for for me,
83 # the other two do.  FIXME.
84 #   - Jon
85 #DOSFILTER  = $(SED) -e $$'s,$$,\r,'
86 #DOSFILTER  = gawk -v ORS='\r\n' '{print $0;}'
87 DOSFILTER  = perl -p -e 's/\n/\r\n/'
88
89 #############################################################################
90 # Setup for make distribution rh and suse for now 
91 #############################################################################
92
93 TAR_ARCH = /tmp/privoxy-$(RPM_VERSION).tar.gz
94 RPM_BASE = @RPM_BASE@
95
96 #############################################################################
97 # Filenames and libraries
98 #############################################################################
99
100 C_SRC  = actions.c cgi.c cgiedit.c cgisimple.c deanimate.c encode.c \
101          errlog.c filters.c gateway.c jbsockets.c jcc.c killpopup.c \
102          list.c loadcfg.c loaders.c miscutil.c parsers.c ssplit.c \
103          urlmatch.c
104
105 C_OBJS = $(C_SRC:.c=.@OBJEXT@)
106 C_HDRS = $(C_SRC:.c=.h) project.h actionlist.h
107
108 CONFIG_FILES = config \
109                 default.action \
110                 basic.action intermediate.action advanced.action \
111                 default.filter \
112                 templates/*
113
114 DOC_FILES = AUTHORS LICENSE README ChangeLog doc/text/* privoxy.1
115
116 W32_SRC   = @WIN_ONLY@w32log.c w32taskbar.c win32.c
117 W32_FILES = @WIN_ONLY@w32.res
118 W32_OBJS  = @WIN_ONLY@$(W32_SRC:.c=.@OBJEXT@) $(W32_FILES)
119 W32_HDRS  = @WIN_ONLY@w32log.h w32taskbar.h win32.h w32res.h
120 W32_LIB   = @WIN_ONLY@-lwsock32 -lcomctl32
121 W32_INIS  = @WIN_ONLY@config.txt trust.txt
122
123 PCRS_SRC     = @STATIC_PCRS_ONLY@pcrs.c
124 PCRS_OBJS    = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=.@OBJEXT@)
125 PCRS_HDRS    = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=.h)
126
127 PCRE_SRC     = @STATIC_PCRE_ONLY@pcre/get.c pcre/maketables.c pcre/study.c pcre/pcre.c
128 PCRE_OBJS    = @STATIC_PCRE_ONLY@$(PCRE_SRC:.c=.@OBJEXT@)
129 PCRE_HDRS    = @STATIC_PCRE_ONLY@pcre/config.h pcre/chartables.c pcre/internal.h pcre/pcre.h
130
131 # No REGEX (Either because dynamically linked pcreposix, or no regex at all):
132 REGEX_SRC    =
133 # GNU REGEX:
134 @GNU_REGEX_ONLY@REGEX_SRC    = gnu_regex.c
135 # PCRE REGEX:
136 @PCRE_REGEX_ONLY@@STATIC_PCRE_ONLY@REGEX_SRC = pcre/pcreposix.c
137
138 REGEX_OBJS   = $(REGEX_SRC:.c=.@OBJEXT@)
139 REGEX_HDRS   = $(REGEX_SRC:.c=.h)
140
141 # Dependencies introduced by #include "project.h".
142 PROJECT_H_DEPS = project.h $(REGEX_HDRS) $(PCRS_HDRS) @STATIC_PCRE_ONLY@pcre/pcre.h
143
144 # Socket libraries for platforms that need them explicitly defined
145 SOCKET_LIB   = @SOCKET_LIB@
146
147 # PThreads library, if needed.
148 PTHREAD_LIB  = @PTHREAD_ONLY@@PTHREAD_LIB@
149
150 SRCS         = $(C_SRC)  $(W32_SRC)  $(PCRS_SRC)  $(PCRE_SRC)  $(REGEX_SRC)
151 OBJS         = $(C_OBJS) $(W32_OBJS) $(PCRS_OBJS) $(PCRE_OBJS) $(REGEX_OBJS)
152 HDRS         = $(C_HDRS) $(W32_HDRS) $(PCRS_HDRS) $(PCRE_OBJS) $(REGEX_HDRS)
153 LIBS         = @LIBS@ $(W32_LIB) $(SOCKET_LIB) $(PTHREAD_LIB)
154
155
156 #############################################################################
157 # Compiler switches
158 #############################################################################
159
160 # The flag "-mno-win32" can be used by Cygwin to emulate a un?x type build.
161 # The flag "-mwindows -mno-cygwin" will cause Cygwin to use MingW32 for a
162 # Win32 GUI build.
163 # The flag "-pthread" is required if using Pthreads under Linux (and
164 # possibly other OSs).
165 SPECIAL_CFLAGS = @SPECIAL_CFLAGS@
166
167 # Add your flags here 
168 OTHER_CFLAGS =   
169
170 CFLAGS = @CFLAGS@ @CPPFLAGS@ $(OTHER_CFLAGS) $(SPECIAL_CFLAGS) -Wall \
171          @STATIC_PCRE_ONLY@ -Ipcre 
172
173 LDFLAGS = $(DEBUG_CFLAGS) $(SPECIAL_CFLAGS)
174
175
176 #############################################################################
177 # Build section.
178 #
179 # There should NOT be any targets above this line.
180 #############################################################################
181 all: $(PROGRAM)
182
183
184 #############################################################################
185 # Phony targets
186 #############################################################################
187 .PHONY: all inifiles redhat-dist redhat-upload solaris-dist suse-dist \
188 suse-upload win-dist tarball-dist dok redhat-dok webserver clean clobber tags \
189 install
190
191
192 #############################################################################
193 # Define this explicitly because Solaris is broken!
194 #############################################################################
195 %.o: %.c
196         $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
197
198
199 #############################################################################
200 # Win32 config files
201 #############################################################################
202
203 inifiles: $(W32_INIS)
204
205 config.txt: config
206         $(SED) -e 's!\trustfile trust!trustfile trust.txt!' \
207                -e 's!\jarfile jarfile!jarfile jar.log!' \
208                -e 's!\logfile logfile!logfile privoxy.log!' \
209                -e 's!#Win32-only: !!' \
210                < $< | \
211                $(DOSFILTER) > $@
212         # LF to CRLF in default.action
213         $(DOSFILTER) <default.action >default.action.txt && mv default.action.txt default.action
214         # LF to CRLF in default.filter
215         $(DOSFILTER) <default.filter >default.filter.txt && mv default.filter.txt default.filter
216
217 trust.txt: trust
218         $(DOSFILTER) < $< > $@ 
219
220 re_filterfile.txt: re_filterfile
221         $(DOSFILTER) < $< > $@ 
222
223
224 #############################################################################
225 # redhat distribution alpha and x86
226 #############################################################################
227
228 redhat-dist:
229         for dir in RPMS SRPMS BUILD SOURCES SPECS; do \
230                 if [ ! -w $(RPM_BASE)/$$dir ]; then \
231                         $(ECHO) "$(RPM_BASE)/$$dir is not writable for you. Maybe try as root."; \
232                         $(ECHO) "Or add a suitable path to .rpmmacros like."; \
233                         $(ECHO) "%_topdir /home/foo/rpm-build"; \
234                         exit 1; \
235                 fi; \
236         done; \
237
238         $(MAKE) clobber
239         if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi
240
241         TMPFILE=$$(mktemp -q /tmp/$(PROGRAM).XXXXXX); \
242         if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \
243              -e 's/^\(Release:\).*/\1 $(RPM_PACKAGEV)/g' \
244               privoxy-rh.spec > $$TMPFILE ; then \
245       $(MV) -f $$TMPFILE privoxy-rh.spec; \
246    else \
247       $(ECHO) "Could not set version info in specfile."; \
248       exit 1;\
249    fi
250
251         $(TAR) --exclude "CVS" --exclude "privoxy-suse.spec" -czf $(TAR_ARCH) .
252         $(RPM) --clean -ta  $(TAR_ARCH)
253         if [ -f $(TAR_ARCH) ]; then  $(RM) $(TAR_ARCH); fi
254
255 #
256 # anonymously ncftps the rpms to sourceforge
257 #
258 redhat-upload:
259         ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/SRPMS/privoxy-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm
260 # better should use `arch` here instead of ix86 to support other platforms too
261         ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/RPMS/*/privoxy-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm
262         @$(ECHO) -------------------------------------------------------
263         @$(ECHO) Now goto
264         @$(ECHO) http://sourceforge.net/project/admin/editpackages.php?group_id=11118
265         @$(ECHO) ... and release the files.
266         @$(ECHO) -------------------------------------------------------
267      # w3m http://sourceforge.net/project/admin/editpackages.php?group_id=11118
268
269 #############################################################################
270 # sun solaris  distribution
271 #############################################################################
272
273 solaris-dist:
274         @$(ECHO) ""
275         @$(ECHO) "You have run autoconf && autoheader && ./configure right?"
276         @$(ECHO) ""
277         $(MAKE) $(PROGRAM)
278         $(STRIP_PROG) $(PROGRAM)
279         $(LN) -s current ../privoxy-$(VERSION)-$(CODE_STATUS)
280 # add program
281         $(TAR) -C.. -cvhf privoxy-solaris-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$(PROGRAM)
282 # add config files
283         for foo in $(CONFIG_FILES); do \
284                 $(TAR) -C.. --exclude "CVS" --exclude "#*" --exclude ".#*" --exclude ".cvsignore" -uvhf privoxy-solaris-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo; \
285         done; 
286 # add documentation
287         for foo in $(DOC_FILES); do \
288                 $(TAR) -C.. --exclude "CVS" --exclude "#*" --exclude ".#*" --exclude ".cvsignore" -uvhf privoxy-solaris-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo; \
289         done; 
290 # and zip the archive
291         $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)
292         $(GZIP_PROG) privoxy-solaris-$(VERSION)-$(CODE_STATUS)-src.tar
293         @$(ECHO) Distribution with binary created.
294
295 # anonymously ncftps the tarball to sourceforge
296 solaris-upload:
297         ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming privoxy-solaris-$(VERSION)-$(CODE_STATUS)-src.tar.gz
298         @$(ECHO) -------------------------------------------------------
299         @$(ECHO) Now goto
300         @$(ECHO) http://sourceforge.net/project/admin/editpackages.php?group_id=11118
301         @$(ECHO) ... and release the files.
302         @$(ECHO) -------------------------------------------------------
303
304
305 solaris-clean:
306         $(RM) privoxy-solaris-$(VERSION)-$(CODE_STATUS)-src.tar*
307
308 #############################################################################
309 # hpux distribution
310 #############################################################################
311 hpux-dist:
312         @$(ECHO) coming soon. 
313 hpux-upload:
314         @$(ECHO) coming soon. 
315
316 #############################################################################
317 # debian distribution
318 #############################################################################
319 debian-dist:
320         @$(ECHO) coming soon. 
321 debian-upload:
322         @$(ECHO) coming soon. 
323
324 #############################################################################
325 # macosx distribution
326 #############################################################################
327 macosx-dist:
328         @$(ECHO) coming soon. 
329 macosx-upload:
330         @$(ECHO) coming soon. 
331
332 #############################################################################
333 # amiga distribution
334 #############################################################################
335 amiga-dist:
336         @$(ECHO) coming soon. 
337 amiga-upload:
338         @$(ECHO) coming soon. 
339
340 #############################################################################
341 # freebsd distribution
342 #############################################################################
343 freebsd-dist:
344         @$(ECHO) coming soon. 
345 freebsd-upload:
346         @$(ECHO) coming soon. 
347
348 #############################################################################
349 # suse distribution. works fine. no need to be root. 
350 #############################################################################
351 suse-dist:
352         for dir in RPMS SRPMS BUILD SOURCES SPECS; do \
353                 if [ ! -w $(RPM_BASE)/$$dir ]; then \
354                         $(ECHO) "$(RPM_BASE)/$$dir is not writable for you. Maybe try as root."; \
355                         $(ECHO) "Or add a suitable path to .rpmmacros like."; \
356                         $(ECHO) "%_topdir /home/foo/rpm-build"; \
357                         exit 1; \
358                 fi; \
359         done; \
360
361         $(MAKE) clobber
362         if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi
363
364         TMPFILE=$$(mktemp -q /tmp/$(PROGRAM).XXXXXX); \
365         if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSIO)/g' \
366              -e 's/^\(Release:\).*/\1 $(RPM_PACKAGEV)/g' \
367               privoxy-suse.spec > $$TMPFILE ; then \
368       $(MV) -f $$TMPFILE privoxy-suse.spec; \
369    else \
370       $(ECHO) "Could not set version info in specfile."; \
371       exit 1;\
372    fi
373
374         $(TAR) --exclude "CVS" --exclude "privoxy-rh.spec" -czf $(TAR_ARCH) .
375         $(RPM) --clean -ta  $(TAR_ARCH)
376         if [ -f $(TAR_ARCH) ]; then  $(RM) $(TAR_ARCH); fi
377
378 #
379 # anonymously ncftps the rpms to sourceforge
380 #
381 suse-upload:
382         ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/SRPMS/privoxy-suse-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm
383 # better should use `arch` here instead of ix86 to support other platforms too
384         ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/RPMS/*/privoxy-suse-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm
385         @$(ECHO) -------------------------------------------------------
386         @$(ECHO) Now goto
387         @$(ECHO) http://sourceforge.net/project/admin/editpackages.php?group_id=11118
388         @$(ECHO) ... and release the files.
389         @$(ECHO) -------------------------------------------------------
390
391 # handle with care. use with root.
392 suse-clean:
393         rpm -e junkbuster-suse || true
394         rm -rf /etc/junkbuster
395         rm -rf /etc/rc.d/junkbuster*
396         rm -rf /var/run/junkbuster.pid 
397         rm -rf /var/log/junkbuster
398         rm -f /etc/init.d/junkbuster
399         rm -f /usr/sbin/junkbuster
400         rm -f /usr/sbin/rcjunkbuster
401         rm -f /usr/share/man/man1/junkbuster.1.gz
402         rpm -e privoxy-suse || true
403         rm -rf /etc/privoxy
404         rm -rf /etc/rc.d/privoxy*
405         rm -rf /var/run/privoxy.pid 
406         rm -rf /var/log/privoxy
407         rm -f /etc/init.d/privoxy
408         rm -f /usr/sbin/privoxy
409         rm -f /usr/sbin/rcprivoxy
410         rm -f /usr/share/man/man1/privoxy.1.gz
411
412 #############################################################################
413 # Windows distribution
414 #############################################################################
415 win-dist:
416         $(ECHO) Not implemented.
417
418
419 #############################################################################
420 # Tarball distribution
421 #############################################################################
422 tarball-dist: clobber
423         $(LN) -s current ../privoxy-$(VERSION)-$(CODE_STATUS)
424         $(TAR) -C.. --exclude "CVS" --exclude "#*" --exclude ".#*" --exclude ".cvsignore" -cvhzf privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz privoxy-$(VERSION)-$(CODE_STATUS)
425         $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)
426         @$(ECHO) Tarball (without any binary) created.
427
428 # anonymously ncftps the tarball to sourceforge
429 tarball-upload:
430         ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz
431         @$(ECHO) -------------------------------------------------------
432         @$(ECHO) Now goto
433         @$(ECHO) http://sourceforge.net/project/admin/editpackages.php?group_id=11118
434         @$(ECHO) ... and release the files.
435         @$(ECHO) -------------------------------------------------------
436
437 # handle with care
438 tarball-clean:
439         $(RM) privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz
440
441 #############################################################################
442 #
443 # Documentation
444 #
445 # converts doc/source/*.sgml into html, text and man pages
446 #
447 #############################################################################
448 dok: doc/source/ldpOK.dsl man2html-swa
449         mkdir -p doc/text doc/man
450 #  user manual
451         rm -rf doc/webserver/user-manual
452         cd doc/source && $(DB2HTML) -s ldpOK.dsl user-manual.sgml && mv user-manual ../webserver
453         cd doc/source && $(DB2HTML) -s ldpOK.dsl --nochunks user-manual.sgml > tmp.html && lynx -dump tmp.html > ../text/user-manual.txt && rm -rf tmp.html user-manual
454 ##  developer manual
455         rm -rf doc/webserver/developer-manual
456         cd doc/source && $(DB2HTML) -s ldpOK.dsl developer-manual.sgml && mv developer-manual ../webserver
457         cd doc/source && $(DB2HTML) -s ldpOK.dsl --nochunks developer-manual.sgml > tmp.html && lynx -dump tmp.html > ../text/developer-manual.txt && rm -rf tmp.html developer-manual
458 ##  faq
459         rm -rf doc/webserver/faq
460         cd doc/source && $(DB2HTML) -s ldpOK.dsl faq.sgml && mv faq ../webserver
461         cd doc/source && $(DB2HTML) -s ldpOK.dsl --nochunks faq.sgml > tmp.html && lynx -dump tmp.html > ../text/faq.txt && rm -rf tmp.html faq
462
463 man2html-swa:
464         if [ "$(MAN2HTML)" != "false" ]; then \
465                 mkdir -p doc/webserver/man-page; \
466                 $(ECHO) "<html><head><title>Privoxy|Doc/Man page</title><link rel=\"stylesheet\" type=\"text/css\" href=\"../p_web.css\"></head><body><H2>NAME</H2>" > doc/webserver/man-page/privoxy-man-page.html; \
467                 man ./privoxy.1 | $(MAN2HTML) -bare \
468                  >> doc/webserver/man-page/privoxy-man-page.html; \
469                 $(ECHO) "</body></html>" >> doc/webserver/man-page/privoxy-man-page.html; \
470         fi
471
472 redhat-dok: doc/source/ldpOK.dsl man2html
473         mkdir -p doc/text doc/man doc/source/user-manual \
474           doc/source/developer-manual doc/source/faq
475 ##  user manual
476         rm -rf doc/webserver/user-manual
477         cd doc/source/user-manual && $(DB) ../user-manual.sgml && cd .. &&\
478           mv user-manual ../webserver
479         cd doc/source && $(DB) -V nochunks user-manual.sgml > tmp.html && \
480           $(WDUMP) tmp.html > ../text/user-manual.txt && rm -rf tmp.html \
481           user-manual
482 ##  developer manual
483         rm -rf doc/webserver/developer-manual
484         cd doc/source/developer-manual && $(DB) ../developer-manual.sgml &&\
485           cd .. && mv developer-manual ../webserver
486         cd doc/source && $(DB) -V nochunks developer-manual.sgml > tmp.html && \
487           $(WDUMP) tmp.html > ../text/developer-manual.txt && rm -rf tmp.html \
488           developer-manual
489 ##  faq
490         rm -rf doc/webserver/faq
491         cd doc/source/faq && $(DB) ../faq.sgml && cd .. && mv faq ../webserver
492         cd doc/source && $(DB) -V nochunks faq.sgml > tmp.html && $(WDUMP) \
493           tmp.html > ../text/faq.txt && rm -rf tmp.html faq
494
495 doc/source/ldpOK.dsl:
496         if [ "$(DKPREFIX)" != "none" ]; then \
497                 sed -e "s@/usr/share/sgml/docbook/dsssl-stylesheets@$(DKPREFIX)@g" doc/source/ldp.dsl > doc/source/ldpOK.dsl; \
498         else \
499                 cp doc/source/ldp.dsl doc/source/ldpOK.dsl; \
500         fi
501
502 man2html:
503         if [ "$(MAN2HTML)" != "false" ]; then \
504                 $(MAN2HTML) privoxy.1 |grep -v "^Content-type" > doc/webserver/man-page/privoxy-man-page.html; \
505         fi
506
507 #############################################################################
508 #
509 # Webserver
510 #
511 # moves dokumentation to webserver
512 #
513 #############################################################################
514 webserver:
515         @$(ECHO) -------------------------------------------------------
516         @$(ECHO) You have run make dok/redhat-dok before, right?
517         @$(ECHO) Note that this command scps all stuff to the webserver,
518         @$(ECHO) it will not remove obsolete documents.
519         @$(ECHO) -------------------------------------------------------
520         chmod -R a+r doc/webserver
521         find doc/webserver -type d -exec chmod a+rx {} \;
522         cd doc/webserver && scp -Cr . ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
523
524 #############################################################################
525 # Source file dependencies
526 #############################################################################
527
528 actions.@OBJEXT@:   actions.c   actions.h   config.h $(PROJECT_H_DEPS) errlog.h jcc.h list.h loaders.h miscutil.h actionlist.h
529 cgi.@OBJEXT@:       cgi.c       cgi.h       config.h $(PROJECT_H_DEPS) cgiedit.h cgisimple.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h
530 cgiedit.@OBJEXT@:   cgiedit.c   cgiedit.h   config.h $(PROJECT_H_DEPS) cgi.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h
531 cgisimple.@OBJEXT@: cgisimple.c cgisimple.h config.h $(PROJECT_H_DEPS) cgi.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h
532 deanimate.@OBJEXT@: deanimate.c deanimate.h config.h $(PROJECT_H_DEPS)
533 encode.@OBJEXT@:    encode.c    encode.h    config.h
534 errlog.@OBJEXT@:    errlog.c    errlog.h    config.h $(PROJECT_H_DEPS) @WIN_ONLY@w32log.h
535 filters.@OBJEXT@:   filters.c   filters.h   config.h $(PROJECT_H_DEPS) errlog.h encode.h gateway.h jbsockets.h jcc.h loadcfg.h parsers.h ssplit.h cgi.h deanimate.h @WIN_ONLY@win32.h 
536 gateway.@OBJEXT@:   gateway.c   gateway.h   config.h $(PROJECT_H_DEPS) errlog.h jbsockets.h jcc.h loadcfg.h
537 jbsockets.@OBJEXT@: jbsockets.c jbsockets.h config.h $(PROJECT_H_DEPS) filters.h
538 jcc.@OBJEXT@:       jcc.c       jcc.h       config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h killpopup.h loadcfg.h loaders.h miscutil.h parsers.h @WIN_ONLY@w32log.h win32.h cgi.h
539 killpopup.@OBJEXT@: killpopup.c killpopup.h config.h $(PROJECT_H_DEPS) jcc.h loadcfg.h
540 list.@OBJEXT@:      list.c      list.h      config.h $(PROJECT_H_DEPS) list.h miscutil.h
541 loadcfg.@OBJEXT@:   loadcfg.c   loadcfg.h   config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h jcc.h killpopup.h loaders.h miscutil.h parsers.h @WIN_ONLY@w32log.h win32.h
542 loaders.@OBJEXT@:   loaders.c   loaders.h   config.h $(PROJECT_H_DEPS) errlog.h encode.h filters.h gateway.h jcc.h loadcfg.h miscutil.h parsers.h ssplit.h
543 miscutil.@OBJEXT@:  miscutil.c  miscutil.h  config.h
544 parsers.@OBJEXT@:   parsers.c   parsers.h   config.h $(PROJECT_H_DEPS) errlog.h encode.h filters.h jbsockets.h jcc.h loadcfg.h loaders.h miscutil.h ssplit.h
545 ssplit.@OBJEXT@:    ssplit.c    ssplit.h    config.h miscutil.h
546 urlmatch.@OBJEXT@:  urlmatch.c  urlmatch.h  config.h $(PROJECT_H_DEPS) errlog.h miscutil.h ssplit.h
547
548 # GNU regex
549 gnu_regex.@OBJEXT@: gnu_regex.c gnu_regex.h config.h
550
551 # PCRS
552 pcrs.@OBJEXT@: pcrs.c pcre/pcre.h pcrs.h
553
554 # PCRE
555 pcre/get.@OBJEXT@:        pcre/get.c        pcre/config.h pcre/internal.h pcre/pcre.h
556 pcre/maketables.@OBJEXT@: pcre/maketables.c pcre/config.h pcre/internal.h pcre/pcre.h
557 pcre/pcre.@OBJEXT@:       pcre/pcre.c       pcre/config.h pcre/internal.h pcre/pcre.h pcre/chartables.c 
558 pcre/pcreposix.@OBJEXT@:  pcre/pcreposix.c  pcre/config.h pcre/internal.h pcre/pcre.h pcre/pcreposix.h
559 pcre/study.@OBJEXT@:      pcre/study.c      pcre/config.h pcre/internal.h pcre/pcre.h
560
561 # An auxiliary program makes the PCRE default character table source
562
563 pcre/chartables.c:   pcre/dftables@EXEEXT@
564                 pcre/dftables@EXEEXT@ >pcre/chartables.c
565
566 pcre/dftables@EXEEXT@:       pcre/dftables.c pcre/maketables.c pcre/pcre.h pcre/internal.h pcre/config.h
567                 $(CC) -o pcre/dftables@EXEEXT@ $(CFLAGS) pcre/dftables.c
568
569 # Win32
570 w32log.@OBJEXT@: w32log.c errlog.h config.h jcc.h loadcfg.h miscutil.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h w32taskbar.h win32.h
571 w32taskbar.@OBJEXT@: w32taskbar.c config.h w32log.h w32taskbar.h
572 win32.@OBJEXT@: win32.c config.h jcc.h loadcfg.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h win32.h
573
574 w32.res: w32.rc w32res.h icons/ico00001.ico icons/ico00002.ico icons/ico00003.ico icons/ico00004.ico icons/ico00005.ico icons/ico00006.ico icons/ico00007.ico icons/ico00008.ico icons/idle.ico icons/privoxy.ico config.h
575         windres -D__MINGW32__=0.2 -O coff -i $< -o $@
576
577 # AmigaOS
578 @AMIGAOS_ONLY@OBJS += amiga.o
579 @AMIGAOS_ONLY@CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -W -m68020 -noixemul -fbaserel -msmall-code
580 @AMIGAOS_ONLY@LDFLAGS += -m68020 -noixemul -fbaserel
581 @AMIGAOS_ONLY@LIBS = -lm /gg/lib/libb/libm020/libnix/swapstack.o
582 @AMIGAOS_ONLY@amiga.o: amiga.c amiga.h config.h
583
584
585 $(PROGRAM): $(OBJS) $(W32_FILES)
586         $(LD) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
587
588 clean:
589         $(RM) a.out core $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) junkbuster
590
591 clobber: clean
592         $(RM) $(PROGRAM) cscope.* logfile *.pdb *.lib *.exp `find . -name tags` `find . -name TAGS` config.status config.h.in config.log junkbuster.log privoxy.log config.cache *~ *.tar.gz configure
593
594 tags: $(SRCS) $(HDRS)
595         etags $(SRCS) $(HDRS)
596
597 install: all
598         #
599         # FIXME: This is a dirty hack to have an install target
600         #        that works at least for some setups. This needs
601         #        to be fixed!
602         #
603         $(STRIP_PROG) $(PROGRAM)
604         $(INSTALL) $(PROGRAM) $(SBIN_DEST)
605         mkdir -p $(DEST)/user-manual
606         mkdir -p $(DEST)/templates
607         cp -r doc/webserver/user-manual $(DEST)
608         cp -r templates $(DEST)
609         $(INSTALL) config default.action default.filter trust $(DEST)
610         # FIXME $(ECHO) privoxy.logrotate privoxy.monthly privoxy.weekly
611         # FIXME: Need new manual! $(GZIP_PROG) -c privoxy.1 > $(MAN_DEST)/privoxy.1.gz
612         $(INSTALL) privoxy.init /etc/init.d/privoxy
613
614
615 #############################################################################
616
617 ## Local Variables:
618 ## tab-width: 3
619 ## end:
620
621 # $Log: GNUmakefile.in,v $
622 # Revision 1.34  2002/03/27 10:30:11  swa
623 # we want a html man file on the webserver
624 #
625 # Revision 1.33  2002/03/27 03:05:35  hal9
626 # Added man2html target for docs (redhat-dok only for now)
627 #
628 # Revision 1.32  2002/03/26 22:29:54  swa
629 # we have a new homepage!
630 #
631 # Revision 1.31  2002/03/26 14:00:18  swa
632 # fixed make tarball, tarball-dist, tarball-clean
633 #
634 # Revision 1.30  2002/03/25 12:52:25  swa
635 # new targets
636 #
637 # Revision 1.29  2002/03/24 17:03:55  jongfoster
638 # Name change
639 #
640 # Revision 1.28  2002/03/24 16:19:48  swa
641 # configure needs to be generated.
642 #
643 # Revision 1.27  2002/03/24 16:13:57  swa
644 # generated files are a nono in cvs
645 #
646 # Revision 1.26  2002/03/24 15:36:02  swa
647 # did not build.
648 #
649 # Revision 1.25  2002/03/24 14:31:08  swa
650 # remove more crappy files. set RPM
651 # release version correctly.
652 #
653 # Revision 1.24  2002/03/24 14:19:55  swa
654 # set rpm package release in configure.in. nowhere else.
655 #
656 # Revision 1.23  2002/03/24 13:06:49  swa
657 # suse-clean now runs fine
658 #
659 # Revision 1.22  2002/03/24 12:56:21  swa
660 # name change related issues.
661 #
662 # Revision 1.21  2002/03/24 12:43:57  swa
663 # name change
664 #
665 # Revision 1.20  2002/03/24 11:39:17  jongfoster
666 # Renaming config files
667 #
668 # Revision 1.19  2002/03/22 20:53:03  morcego
669 # - Ongoing process to change name to JunkbusterNG
670 # - configure/configure.in: no change needed
671 # - GNUmakefile.in:
672 #         - TAR_ARCH = /tmp/JunkbusterNG-$(RPM_VERSION).tar.gz
673 #         - PROGRAM    = jbng@EXEEXT@
674 #         - rh-spec now references as junkbusterng-rh.spec
675 #         - redhat-upload: references changed to junkbusterng-* (package names)
676 #         - tarball-dist: references changed to JunkbusterNG-distribution-*
677 #         - tarball-src: now JunkbusterNG-*
678 #         - install: initscript now junkbusterng.init and junkbusterng (when
679 #                    installed)
680 # - junkbuster-rh.spec: renamed to junkbusterng-rh.spec
681 # - junkbusterng.spec:
682 #         - References to the expression ijb where changed where possible
683 #         - New package name: junkbusterng (all in lower case, acording to
684 #           the LSB recomendation)
685 #         - Version changed to: 2.9.13
686 #         - Release: 1
687 #         - Added: junkbuster to obsoletes and conflicts (Not sure this is
688 #           right. If it obsoletes, why conflict ? Have to check it later)
689 #         - Summary changed: Stefan, please check and aprove it
690 #         - Changes description to use the new name
691 #         - Sed string was NOT changed. Have to wait to the manpage to
692 #           change first
693 #         - Keeping the user junkbuster for now. It will require some aditional
694 #           changes on the script (scheduled for the next specfile release)
695 #         - Added post entry to move the old logfile to the new log directory
696 #         - Removing "chkconfig --add" entry (not good to have it automaticaly
697 #           added to the startup list).
698 #         - Added preun section to stop the service with the old name, as well
699 #           as remove it from the startup list
700 #         - Removed the chkconfig --del entry from the conditional block on
701 #           the preun scriptlet (now handled on the %files section)
702 # - junkbuster.init: renamed to junkbusterng.init
703 # - junkbusterng.init:
704 #         - Changed JB_BIN to jbng
705 #         - Created JB_OBIN with the old value of JB_BIN (junkbuster), to
706 #           be used where necessary (config dir)
707 #
708 # Aditional notes:
709 # - The config directory is /etc/junkbuster yet. Have to change it on the
710 # specfile, after it is changes on the code
711 # - The only files that got renamed on the cvs tree were the rh specfile and
712 # the init file. Some file references got changes on the makefile and on the
713 # rh-spec (as listed above)
714 #
715 # Revision 1.18  2002/03/21 23:00:00  swa
716 # want to autogenerate stuff.
717 #
718 # Revision 1.17  2002/03/19 19:30:04  morcego
719 # - Fixing stylesheet checking on configure. If it is found, no further checks
720 #   should be done
721 #
722 # - configure will now check for db2html or docbook2html (should work now
723 #   on SuSe without the docbktls package)
724 #
725 # Revision 1.16  2002/03/14 22:32:32  hal9
726 # Bumped the RPM version.
727 #
728 # Revision 1.15  2002/03/08 20:00:28  swa
729 # some leftovers.
730 #
731 # Revision 1.14  2002/03/07 18:25:56  swa
732 # synced redhat and suse build process
733 #
734 # Revision 1.13  2002/03/07 17:17:56  oes
735 # (Hopefully) fixed for older make versions
736 #
737 # Revision 1.12  2002/03/07 15:28:27  swa
738 # more informative
739 #
740 # Revision 1.11  2002/03/06 14:33:18  sarantis
741 # Use proper temp file, not "abc".
742 #
743 # Revision 1.10  2002/03/06 14:19:35  sarantis
744 # Cleanup PID_FILE_PATH from redhat-dist target
745 #
746 # Revision 1.9  2002/03/05 17:31:11  morcego
747 # Search for docbook.dsl. Should solve portability problems for SuSe.
748 #
749 # Revision 1.8  2002/03/05 14:07:42  morcego
750 # configure now detects rpm topdir, and change GNUmakefile acordingly
751 #    (based on sugestion by Sarantis Paskalis)
752 #
753 # Revision 1.7  2002/03/05 13:43:28  morcego
754 # Checking for text browser, so redhat-dok can work.
755 #
756 # Revision 1.6  2002/03/05 13:10:51  morcego
757 # Changes to implement redhat-dok (Hal Burgiss)
758 # Changes to make it work on other distros and out-of-the-shelf configurations
759 #
760 # Revision 1.5  2002/02/27 15:30:39  hal9
761 # Reset $(RPM_PACKAGEV) to 1 (was 2)
762 #
763 # Revision 1.4  2002/01/17 21:44:04  jongfoster
764 # Adding urlmatch.[ch]
765 #
766 # Revision 1.3  2002/01/04 15:26:08  oes
767 # Added tarball-src target
768 #
769 # Revision 1.2  2001/12/30 14:07:31  steudten
770 # - Add signal handling (unix)
771 # - Add SIGHUP handler (unix)
772 # - Add creation of pidfile (unix)
773 # - Add action 'top' in rc file (RH)
774 # - Add entry 'SIGNALS' to manpage
775 # - Add exit message to logfile (unix)
776 #
777 # Revision 1.1  2001/12/01 11:22:57  jongfoster
778 # Renaming Makefile.in to GNUmakefile.in so that non-GNU versions of
779 # make break in a more obvious way.
780 # Adding .PHONY section.
781 #
782 # Revision 1.40  2001/12/01 00:24:11  jongfoster
783 # Renaming various config files
784 # Fixing CR->CRLF under Win32 (I hope)
785 #
786 # Revision 1.39  2001/11/06 12:07:30  steudten
787 # Add --clean for building rpm in target redhat-dist.
788 #
789 # Revision 1.38  2001/11/05 21:35:23  steudten
790 # Complete rewrite for the 'redhat-dist' target.
791 # Checks for writeable RPM build directories for calling user.
792 # So you must not be root, just set the modes to 1777 to
793 # build a RH package.
794 # Fix the upload-target to be arch independant.
795 # Add target for 'solaris-dist' - coming soon.
796 #
797 # Revision 1.37  2001/11/01 00:52:04  hal9
798 # Redhat-upload stuff per Stefan.
799 #
800 # Revision 1.36  2001/10/31 19:26:13  swa
801 # automate process of uploading new releases
802 # to sf.
803 #
804 # Revision 1.35  2001/10/15 22:14:59  joergs
805 # Removed -O2 and -Wall from AmigaOS-only CFLAGS since they are now in
806 #  the general CFLAGS already.
807 #
808 # Revision 1.34  2001/10/15 18:28:06  steudten
809 # remove config.cache for target clobber.
810 # Cleanup make dist for RH and S.u.S.E.
811 #
812 # Revision 1.33  2001/10/10 12:43:33  oes
813 # Added ugly hack to make install target work at least for some setups.
814 #
815 # Revision 1.32  2001/10/09 22:38:19  jongfoster
816 # Correcting actionsfile filename for Win32 INI build
817 #
818 # Revision 1.31  2001/09/23 10:13:48  swa
819 # upload process established. run make webserver and
820 # the documentation is moved to the webserver. documents
821 # are now linked correctly.
822 #
823 # Revision 1.30  2001/09/19 17:55:49  oes
824 # Fixed CFLAGS
825 #
826 # Revision 1.29  2001/09/16 17:34:27  jongfoster
827 # Removing showargs.[ch], adding cgi(simple|edit).[ch]
828 # Replacing $(OBJEXT) with @OBJEXT@ - this seems to be a common source
829 # of build problems.
830 #
831 # Revision 1.28  2001/09/13 15:19:08  swa
832 # we want text files as well.
833 #
834 # Revision 1.27  2001/09/13 13:11:37  steudten
835 #
836 # Replace DEBUG_CFLAGS with OTHER_CFLAGS
837 #
838 # Revision 1.26  2001/09/12 23:44:54  david__schmidt
839 # Mac OSX (Darwin) support added.
840 #
841 # Revision 1.25  2001/09/12 22:55:45  joergs
842 # AmigaOS support added.
843 #
844 # Revision 1.24  2001/09/12 17:28:59  david__schmidt
845 #
846 # OS/2 port: update autoconf'd support for the platform.
847 #
848 # Revision 1.23  2001/09/12 16:28:42  swa
849 # added "make dok" section to generate html pages from
850 # the sgml source documents. note that the we do not want
851 # generated stuff in cvs.
852 #
853 # Revision 1.22  2001/09/10 16:31:23  swa
854 # buildroot definition in the specfile fucks up the build
855 # process under suse. hence I moved it to the "rpm -ta"
856 # command
857 #
858 # Revision 1.21  2001/09/10 11:12:49  oes
859 # Turning on -Wall
860 #
861 # Revision 1.20  2001/08/02 22:04:29  jongfoster
862 # Removing some remaining references to obsolete w32rulesdlg.[ch]
863 #
864 # Revision 1.19  2001/07/30 22:14:03  jongfoster
865 # Removing obsolete w32rulesdlg.c and w32rulesdlg.h
866 #
867 # Revision 1.18  2001/07/29 17:09:17  jongfoster
868 # Major changes to build system in order to fix these bugs:
869 # - pthreads under Linux was broken - changed -lpthread to -pthread
870 # - Compiling in MinGW32 mode under CygWin now correctly detects
871 #   which shared libraries are available
872 # - Solaris support (?) (Not tested under Solaris yet)
873 #
874 # Revision 1.17  2001/07/28 16:44:54  oes
875 # Fixed sed LF->CRLF conversion and removed deprecated files
876 #
877 # Revision 1.16  2001/07/15 19:45:33  jongfoster
878 # Added support for linking with POSIX threads library
879 #
880 # Revision 1.15  2001/07/13 13:48:07  oes
881 #  - Moved STATIC #define for pcre to (ac)config.h
882 #  - Made -Ipcre depandant on static pcre compilation to
883 #    avoid version conflicts
884 #  - Included compilation and depandancies for new deanimate.c
885 #  - Made changes to the pcre/pcreposix/pcrs build process
886 #    as required by the new library autodetection in
887 #    configure.in
888 #
889 # Revision 1.14  2001/07/01 16:27:44  oes
890 # Fixed misplaced dependancy
891 #
892 # Revision 1.13  2001/06/29 13:18:36  oes
893 # - added depandancy of filters.o on cgi.h
894 #
895 # Revision 1.12  2001/06/12 17:15:56  swa
896 # fixes, because a clean build on rh6.1 was impossible.
897 # GZIP confuses make, %configure confuses rpm, etc.
898 #
899 # Revision 1.11  2001/06/11 11:26:35  sarantis
900 # RPM version should be the same as ijbswa version.  The rpm release is
901 # specified in the specfile.
902 #
903 # Revision 1.10  2001/06/07 17:27:45  swa
904 # added suse build section
905 #
906 # Revision 1.9  2001/06/04 18:31:58  swa
907 # files are now prefixed with either `confdir' or `logdir'.
908 # `make redhat-dist' replaces both entries confdir and logdir
909 # with redhat values
910 #
911 # Revision 1.8  2001/06/04 10:44:57  swa
912 # `make redhatr-dist' now works. Except for the paths
913 # in the config file.
914 #
915 # Revision 1.7  2001/06/03 17:09:09  swa
916 # swa for oes: reversed my earlier change
917 #
918 # Revision 1.6  2001/06/03 17:07:27  swa
919 # swa for oes
920 #
921 # Revision 1.5  2001/06/03 13:57:26  swa
922 # compile cgi.c (for andreas' GUI)
923 #
924 # Revision 1.4  2001/05/31 21:18:45  jongfoster
925 # Added files actions.[ch], actionlist.h, list.[ch] to Makefile
926 #
927 # Revision 1.3  2001/05/29 20:02:48  joergs
928 # Changes for AmigaOS added.
929 #
930 # Revision 1.2  2001/05/17 22:23:23  oes
931 #  - Added auto-generation of CRLFs for Win32 config files
932 #  - Added comment-prefix to all Win32-only options in the config file
933 #    and provided auto stripping of this prefix for the Win32 platform by make
934 #
935 # Revision 1.1.1.1  2001/05/15 13:59:00  oes
936 # Initial import of version 2.9.3 source tree
937 #
938 #