- Stop building text files nobody cares about.
[privoxy.git] / GNUmakefile.in
1 # Note:  Makefile is built automatically from Makefile.in
2 #
3 # $Id: GNUmakefile.in,v 1.171 2008/06/13 15:24:57 fabiankeil Exp $
4 #
5 # Written by and Copyright (C) 2001 - 2008 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 # Set make command correctly
33 #############################################################################
34 @SET_MAKE@
35
36 #############################################################################
37 # Version number (for RPM)
38 #############################################################################
39
40 VERSION_MAJOR = @VERSION_MAJOR@
41 VERSION_MINOR = @VERSION_MINOR@
42 VERSION_POINT = @VERSION_POINT@
43 CODE_STATUS   = @CODE_STATUS@
44 VERSION       = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_POINT)
45 RPM_VERSION   = $(VERSION)
46 RPM_PACKAGEV  = ""
47 SNAPVERSION   = $(RPM_VERSION)-$(shell date "+%Y%m%d")
48
49
50 #############################################################################
51 # "make install" directories and variables
52 #############################################################################
53
54 #User Group paras
55 USER         = @USER@
56 GROUP      = @GROUP@
57
58 datarootdir  = @datarootdir@
59 prefix       = @prefix@
60 exec_prefix  = @exec_prefix@
61 CONF_BASE    = @sysconfdir@
62 SBIN_DEST    = @sbindir@
63 MAN_DIR      = @mandir@
64 MAN_DEST     = $(MAN_DIR)/man1
65 SHARE_DEST   = @datadir@
66 DOC_DEST     = $(SHARE_DEST)/doc/privoxy
67 VAR_DEST     = @localstatedir@
68 LOGS_DEST    = $(VAR_DEST)/log/privoxy
69 PIDS_DEST    = $(VAR_DEST)/run
70
71 # if $prefix = /usr/local then the default CONFDEST change from 
72 # CONF_DEST = $(CONF_BASE) to CONF_DEST = $(CONF_BASE)/privoxy  
73 # by the target rule CONF_DEST
74 #
75 # also if the $prefix is /usr/local and there is no
76 # $(SHARE_DEST)/doc, it checks for $prefix/doc and installs there
77 # instead in this situation
78 #
79 # finally if $prefix=/usr/local and VAR_DEST=$prefix/var it 
80 # changes this to /var for storing the logs and pidfile
81
82 # used in source dir only, the install goes to $share_dest/doc/privoxy
83 DOK_WEB = doc/webserver/
84
85 # Install usage should be compatible with install-sh.
86 INSTALL    = @INSTALL@
87 # Binaries
88 BIN_MODE         = 0755
89 # Support files, docs, etc.
90 RA_MODE   = 0664
91 # Directory
92 DIR_MODE   = 0755
93 # Files daemon writes to.
94 RWD_MODE   = 0660
95 INSTALL_P  = -m $(BIN_MODE)  
96 INSTALL_T  = -m $(RA_MODE)
97 INSTALL_D  = -m $(DIR_MODE) -d
98 INSTALL_R  = -m $(RWD_MODE)
99
100 # install options for superuser install
101 #INSTALL_S  = -g @GROUP@ -o @USER@ 
102
103 #############################################################################
104 # Build tools
105 #############################################################################
106
107 PROGRAM    = privoxy@EXEEXT@
108 CC         = @CC@
109 ECHO       = echo
110 GZIP_PROG  = gzip
111
112 # id -u is not universal. FIXME: need to set from configure. Breaks on
113 # Solaris.
114 #ID         = id -u
115 ID         = id
116 LD         = @CC@
117 RM         = rm -f
118 CP         = cp -f
119 RMDIR      = rmdir
120 MKDIR      = ./mkinstalldirs
121 STRIP_PROG = strip
122 SED           = sed
123 GREP       = grep
124 CAT        = cat
125 RPM        = rpm
126 RPMBUILD   = rpmbuild
127 MV            = mv
128 TAR        = tar
129 LN         = ln
130 TOUCH      = touch
131 KILL       = kill
132 CHMOD      = chmod
133 CHOWN      = chown
134 CHGRP      = chgrp
135 GROUPS     = groups
136 WDUMP      = @WDUMP@ -dump
137 JADECAT    = @JADECAT@
138 JADEBIN    = @JADEBIN@
139 DB         = $(JADEBIN) $(JADECAT) -ihtml -t sgml  -D.. -d ldp.dsl\#html
140 DB2HTML    = @DB2HTML@
141 MAN2HTML   = @MAN2HTML@
142 G2H_CMD    = groff -mandoc -Thtml
143 TARGET_OS  = @host@
144 PERL       = perl
145 DOC_DIR  = doc/source
146 DOC_TMP    = $(DOC_DIR)/tmp
147 DOC_STATUS = @DOC_STATUS@
148
149 # Program to do LF->CRLF
150 #
151 # The sed version should be the most portable, but it doesn't for for me,
152 # the other two do.  FIXME.
153 #   - Jon
154 #DOSFILTER  = $(SED) -e $$'s,$$,\r,'
155 #DOSFILTER  = gawk -v ORS='\r\n' '{print $0;}'
156 DOSFILTER  = $(PERL) -p -e 's/\n/\r\n/'
157 CVSROOT    = :pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa
158 #TMPDIR     := $(shell mktemp -d /tmp/$(PROGRAM).XXXXXX)
159
160 #############################################################################
161 # Setup for make distribution rh and suse for now 
162 #############################################################################
163
164 TAR_ARCH = /tmp/privoxy-$(RPM_VERSION).tar.gz
165 RPM_BASE = @RPM_BASE@
166
167 #############################################################################
168 # We include these files in our distributions
169 #############################################################################
170 CONFIGS = config trust default.action standard.action user.action default.filter user.filter
171 # take care that no CVS .cvsignore or other crappy files
172 # are included here
173 # and escape every '#' in the find. doh.
174 CONFIG_FILES = $(CONFIGS) \
175                 `find templates/ -type f | grep -v "CVS" | grep -v "\.\#" | grep -v ".*~" | grep -v ".cvsignore" | grep -v "TAGS"`
176
177 DOC_FILES = AUTHORS LICENSE README ChangeLog INSTALL \
178                 `find doc/webserver/ -name "*.html" | grep -v "\(webserver\|team\)\/index\.html"` \
179                 `find doc/webserver/ -name "*.css"` \
180                 privoxy.1 \
181                 doc/pdf/*.pdf
182
183 #############################################################################
184 # Filenames and libraries
185 #############################################################################
186
187 C_SRC  = actions.c cgi.c cgiedit.c cgisimple.c deanimate.c encode.c \
188          errlog.c filters.c gateway.c jbsockets.c jcc.c \
189          list.c loadcfg.c loaders.c miscutil.c parsers.c ssplit.c \
190          urlmatch.c
191
192 C_OBJS = $(C_SRC:.c=.@OBJEXT@)
193 C_HDRS = $(C_SRC:.c=.h) project.h actionlist.h
194
195 W32_SRC   = @WIN_ONLY@w32log.c w32taskbar.c win32.c w32svrapi.c
196 W32_FILES = @WIN_ONLY@w32.res
197 W32_OBJS  = @WIN_ONLY@$(W32_SRC:.c=.@OBJEXT@) $(W32_FILES)
198 W32_HDRS  = @WIN_ONLY@w32log.h w32taskbar.h win32.h w32res.h w32svrapi.h
199 W32_LIB   = @WIN_ONLY@-lwsock32 -lcomctl32
200 W32_INIS  = @WIN_ONLY@config.txt trust.txt
201
202 PCRS_SRC     = @STATIC_PCRS_ONLY@pcrs.c
203 PCRS_OBJS    = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=.@OBJEXT@)
204 PCRS_HDRS    = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=.h)
205
206 PCRE_SRC     = @STATIC_PCRE_ONLY@pcre/get.c pcre/maketables.c pcre/study.c pcre/pcre.c
207 PCRE_OBJS    = @STATIC_PCRE_ONLY@$(PCRE_SRC:.c=.@OBJEXT@)
208 PCRE_HDRS    = @STATIC_PCRE_ONLY@pcre/config.h pcre/chartables.c pcre/internal.h pcre/pcre.h
209
210 # No REGEX (maybe because dynamically linked pcreposix):
211 REGEX_SRC    =
212 @STATIC_PCRE_ONLY@REGEX_SRC = pcre/pcreposix.c
213
214 REGEX_OBJS   = $(REGEX_SRC:.c=.@OBJEXT@)
215 REGEX_HDRS   = $(REGEX_SRC:.c=.h)
216
217 # Dependencies introduced by #include "project.h".
218 PROJECT_H_DEPS = project.h $(REGEX_HDRS) $(PCRS_HDRS) @STATIC_PCRE_ONLY@pcre/pcre.h
219
220 # Socket libraries for platforms that need them explicitly defined
221 SOCKET_LIB   = @SOCKET_LIB@
222
223 # PThreads library, if needed.
224 PTHREAD_LIB  = @PTHREAD_ONLY@@PTHREAD_LIB@
225
226 SRCS         = $(C_SRC)  $(W32_SRC)  $(PCRS_SRC)  $(PCRE_SRC)  $(REGEX_SRC)
227 OBJS         = $(C_OBJS) $(W32_OBJS) $(PCRS_OBJS) $(PCRE_OBJS) $(REGEX_OBJS)
228 HDRS         = $(C_HDRS) $(W32_HDRS) $(PCRS_HDRS) $(PCRE_OBJS) $(REGEX_HDRS)
229 LIBS         = @LIBS@ $(W32_LIB) $(SOCKET_LIB) $(PTHREAD_LIB)
230
231
232 #############################################################################
233 # Compiler switches
234 #############################################################################
235
236 # The flag "-mno-win32" can be used by Cygwin to emulate a un?x type build.
237 # The flag "-mwindows -mno-cygwin" will cause Cygwin to use MingW32 for a
238 # Win32 GUI build.
239 # The flag "-pthread" is required if using Pthreads under Linux (and
240 # possibly other OSs).
241 SPECIAL_CFLAGS = @SPECIAL_CFLAGS@
242
243 # Add your flags here 
244 OTHER_CFLAGS =   
245
246 CFLAGS = @CFLAGS@ @CPPFLAGS@ $(OTHER_CFLAGS) $(SPECIAL_CFLAGS) -Wall \
247          @STATIC_PCRE_ONLY@ -Ipcre 
248
249 LDFLAGS = @LDFLAGS@ $(DEBUG_CFLAGS) $(SPECIAL_CFLAGS)
250
251
252 #############################################################################
253 # Build section.
254 #
255 # There should NOT be any targets above this line.
256 #############################################################################
257 all: $(PROGRAM) default.action
258
259
260 #############################################################################
261 # Phony targets
262 #############################################################################
263 .PHONY: all inifiles redhat-dist redhat-upload solaris-dist suse-dist \
264 suse-upload win-dist tarball-dist dok redhat-dok webserver clean clobber tags \
265 install conectiva-spec conectiva-dist conectiva-upload CONF_DEST LOG_DEST \
266 PID_DEST check_doc install-strip uninstall GROUP_T
267
268 #############################################################################
269 # Define this explicitly because Solaris is broken!
270 #############################################################################
271 %.o: %.c
272         $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
273
274
275 #############################################################################
276 # Strip master copy comments from default.action:
277 #############################################################################
278 default.action: default.action.master
279         $(GREP) -v '^#MASTER#' $< > $@
280
281 #############################################################################
282 # Win32 config files
283 #############################################################################
284
285 inifiles: $(W32_INIS)
286
287 config.txt: config
288         $(SED) -e 's!\trustfile trust!trustfile trust.txt!' \
289                -e 's!\jarfile jarfile!jarfile jar.log!' \
290                -e 's!\logfile logfile!logfile privoxy.log!' \
291                -e 's!#Win32-only: !!' \
292                < $< | \
293                $(DOSFILTER) > $@
294         # LF to CRLF in default.action
295         $(DOSFILTER) <default.action >default.action.txt && mv default.action.txt default.action
296         # LF to CRLF in default.filter
297         $(DOSFILTER) <default.filter >default.filter.txt && mv default.filter.txt default.filter
298
299 trust.txt: trust
300         $(DOSFILTER) < $< > $@ 
301
302 #############################################################################
303 # Pre-dist check:
304 #############################################################################
305 dist-check:
306         @if [ -d CVS ]; then \
307            $(ECHO) "***************************************************"; \
308            $(ECHO) "***                                             ***"; \
309            $(ECHO) "***                  WARNING                    ***"; \
310            $(ECHO) "***                                             ***"; \
311            $(ECHO) "*** The presence of a CVS subdirectory suggests ***"; \
312            $(ECHO) "*** that you are trying to build a distribution ***"; \
313            $(ECHO) "*** package based on a checked out, not an      ***"; \
314            $(ECHO) "*** exported copy of the source tree. Please    ***"; \
315            $(ECHO) "*** see \"Releasing a new version\" in the        ***"; \
316            $(ECHO) "*** developer manual.                           ***"; \
317            $(ECHO) "***                                             ***"; \
318            $(ECHO) "***************************************************"; \
319            $(ECHO) "Type \"yes i am sure\" if you are sure that you"; \
320            $(ECHO) -n "really want to proceed: "; \
321            read answer; \
322            if [ "$$answer" != "yes i am sure" ]; then exit 1; fi \
323          fi;
324
325
326 #############################################################################
327 # create tar.gz from CVS:
328 # This make-target is usually called through 'create-archive'. If you 
329 # run 'make create-snapshot' without setting SNAPVERSION, you'll get a
330 # tar.gz with the current date in the name and as a releasenumber in the 
331 # spec-file. But the main usage is to run it as follows (Red Hat example):
332 # make SNAPVERSION=1.6x create-snapshot
333 # This creates a tar.gz and spec-file for a Red Hat 6.x version.
334 #############################################################################
335 create-snapshot:
336         @tag=`cvs -d $(CVSROOT) status Makefile | awk ' /Sticky Tag/ { print $$3 } '` 2> /dev/null; \
337         [ x"$$tag" = x"(none)" ] && tag=HEAD; \
338         echo "*** Creating package from $$tag!"; \
339         TMPDIR=$(shell mktemp -d /tmp/$(PROGRAM).XXXXXX); \
340         cd $$TMPDIR ; cvs -Q -d $(CVSROOT) export -r $$tag current || echo "Um... export aborted."; \
341         cd $$TMPDIR/current; \
342         TMPFILE=$$(mktemp -q /tmp/$(PROGRAM).XXXXXX); \
343         if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \
344                 -e 's/^\(Release:\).*/\1 $(SNAPVERSION)/g' \
345                 privoxy-rh.spec > $$TMPFILE ; then \
346                         $(MV) -f $$TMPFILE privoxy-rh.spec; \
347         else \
348                 $(ECHO) "Could not set version info in specfile."; \
349                 exit 1;\
350         fi;\
351         if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \
352              -e 's/^\(Release:\).*/\1 $(SNAPVERSION)/g' \
353               privoxy-suse.spec > $$TMPFILE ; then \
354                         $(MV) -f $$TMPFILE privoxy-suse.spec; \
355         else \
356                 $(ECHO) "Could not set version info in specfile."; \
357                 exit 1;\
358         fi; \
359         $(RM) $$TMPFILE; \
360         cd $$TMPDIR/current; \
361         $(TAR) --exclude ".cvsignore" --exclude "CVS" \
362                 -czf /tmp/$(PROGRAM)-$(VERSION).tar.gz .; \
363         $(RM) -rf $$TMPDIR
364         @echo "Resulting file is /tmp/$(PROGRAM)-$(VERSION).tar.gz"
365
366
367 #############################################################################
368 # looks at the version of Makefile and exports a corresponding source-tree
369 # example: if the Makefile has the sticky tag v_2_9_13, you'll get 
370 # privoxy-*-2.4.13.tar.gz. Two different tar files will be written, one for
371 # Red Hat and one for SuSe (different spec-files)
372 #############################################################################
373 create-archive:
374         make SNAPVERSION=$(SNAPVERSION) create-snapshot
375
376 #############################################################################
377 # RPM specifice stuff (SuSE or Redhat, ..)
378 #############################################################################
379 rpm-stuff: dist-check clean clobber 
380         for dir in RPMS SRPMS BUILD SOURCES SPECS; do \
381                 if [ ! -w $(RPM_BASE)/$$dir ]; then \
382                         $(ECHO) "$(RPM_BASE)/$$dir is not writable for you. Maybe try as root."; \
383                         $(ECHO) "Or add a suitable path to .rpmmacros like."; \
384                         $(ECHO) "%_topdir /home/foo/rpm-build"; \
385                         exit 1; \
386                 fi; \
387         done; \
388
389 check-release:
390         @if [ "$(RPM_PACKAGEV)" = "" ]; then \
391                 echo ; \
392                 echo "  ERROR: NO RPM_PACKAGEV VALUE"; \
393                 echo "  No value given for RPM_PACKAGEV. Please use:"; \
394                 echo "  make dist-upload RPM_PACKAGEV=release"; \
395                 echo "  where \"release\" is the release number you want to and"; \
396                 echo "  where \"dist\" is the name of the distro (redhat or suse)"; \
397                 echo ; \
398                 echo "  Ex: make redhat-upload RPM_PACKAGEV=1"; \
399                 echo ""; \
400                 echo "ATTENTION: If your distribution use a specific tag on the"; \
401                 echo "           release field (like \"cl\" for Conectiva, and"; \
402                 echo "           \"mdk\" for Mandrake), DO NOT put it on the value"; \
403                 echo "           given to RPM_PACKAGEV. It will be added automaticaly."; \
404                 echo "           Do it like you would do for a redhat package,"; \
405                 echo "           (i.e. just the number)."; \
406                 echo ; \
407                 exit 1; \
408         fi
409
410
411 #############################################################################
412 # Create Conectiva specfile from RedHat specfile
413 #############################################################################
414 conectiva-spec:
415         $(RM) privoxy-cl.spec
416         chmod a+x genclspec.sh
417         ./genclspec.sh
418
419 #############################################################################
420 # Conectiva distribution for x86
421 #############################################################################
422 conectiva-dist: rpm-stuff conectiva-spec
423
424         $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-rh.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) .
425         $(RPMBUILD) --clean -ta  $(TAR_ARCH)
426         if [ -f $(TAR_ARCH) ]; then  $(RM) $(TAR_ARCH); fi
427
428 conectiva-upload: check-release
429         make redhat-upload RPM_PACKAGEV=$(RPM_PACKAGEV)cl
430
431 #############################################################################
432 # redhat distribution alpha and x86
433 #############################################################################
434 redhat-dist: rpm-stuff
435         echo $(CONFIG_FILES)
436         $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) .
437         $(RPMBUILD) --clean -ta  $(TAR_ARCH)
438         if [ -f $(TAR_ARCH) ]; then  $(RM) $(TAR_ARCH); fi
439
440 # For testing build issues only! Use redhat-dist for official releases.
441 redhat-test: 
442         echo $(CONFIG_FILES)
443         $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) .
444         $(RPMBUILD) --clean -tb  $(TAR_ARCH)
445         if [ -f $(TAR_ARCH) ]; then  $(RM) $(TAR_ARCH); fi
446         @echo "WARNING: This target is only for testing. Use redhat-dist for releases!!!"
447
448 # anonymously ncftps the rpms to sourceforge
449 redhat-upload: check-release
450         ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/SRPMS/privoxy-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm
451 # better should use `arch` here instead of ix86 to support other platforms too
452         ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/RPMS/*/privoxy-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm
453         @$(ECHO) -------------------------------------------------------
454         @$(ECHO) Now goto
455         @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118
456         @$(ECHO) ... and release the files.
457         @$(ECHO) -------------------------------------------------------
458      # w3m http://sourceforge.net/project/admin/editpackages.php?group_id=11118
459
460
461 #############################################################################
462 # Creates a Red Hat sourcepackage from CVS (not from the current sources
463 # on disk)
464 #############################################################################
465 redhat-srpm: 
466         make create-archive
467         $(RPMBUILD) -ts --nodeps $(PROGRAM)-$(VERSION).tar.gz
468
469
470 #############################################################################
471 # suse distribution. works fine. no need to be root. 
472 #############################################################################
473 suse-dist: rpm-stuff
474 #       TMPFILE=$$(mktemp -q /tmp/$(PROGRAM).XXXXXX); \
475 #       if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \
476 #              -e 's/^\(Release:\).*/\1 $(RPM_PACKAGEV)/g' \
477 #               privoxy-suse.spec > $$TMPFILE ; then \
478 #       $(MV) -f $$TMPFILE privoxy-suse.spec; \
479 #       else \
480 #               $(ECHO) "Could not set version info in specfile."; \
481 #       exit 1;\
482 #       fi
483
484         $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-rh.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) .
485         $(RPMBUILD) --clean -ta  $(TAR_ARCH)
486         if [ -f $(TAR_ARCH) ]; then  $(RM) $(TAR_ARCH); fi
487
488 # anonymously ncftps the rpms to sourceforge
489 suse-upload: check-release
490         ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/SRPMS/privoxy-suse-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm
491 # better should use `arch` here instead of ix86 to support other platforms too
492         ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/RPMS/*/privoxy-suse-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm
493         @$(ECHO) -------------------------------------------------------
494         @$(ECHO) Now goto
495         @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118
496         @$(ECHO) ... and release the files.
497         @$(ECHO) -------------------------------------------------------
498
499 # handle with care. use with root.
500 suse-clean:
501         $(RPM) -e junkbuster-suse || true
502         $(RM) -r /etc/junkbuster
503         $(RM) -r /etc/rc.d/junkbuster*
504         $(RM) -r /var/run/junkbuster.pid 
505         $(RM) -r /var/log/junkbuster
506         $(RM) /etc/init.d/junkbuster
507         $(RM) /usr/sbin/junkbuster
508         $(RM) /usr/sbin/rcjunkbuster
509         $(RM) /usr/share/man/man1/junkbuster.1.gz
510         $(RPM) -e privoxy-suse || true
511         $(RM) -r /etc/privoxy
512         $(RM) -r /etc/rc.d/privoxy*
513         $(RM) -r /var/run/privoxy.pid 
514         $(RM) -r /var/log/privoxy
515         $(RM) /etc/init.d/privoxy
516         $(RM) /usr/sbin/privoxy
517         $(RM) /usr/sbin/rcprivoxy
518         $(RM) /usr/share/man/man1/privoxy.1.gz
519
520 #############################################################################
521 # generic distribution
522 #############################################################################
523 gen-dist: dist-check
524         @$(ECHO) ""
525         @$(ECHO) "You have run autoconf && autoheader && ./configure right?"
526         @$(ECHO) ""
527         $(MAKE) $(PROGRAM)
528         $(STRIP_PROG) $(PROGRAM)
529         $(LN) -s current ../privoxy-$(VERSION)-$(CODE_STATUS)
530 # add program
531         (cd .. && $(TAR) -cvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$(PROGRAM))
532 # add config files
533         for foo in $(CONFIG_FILES); do \
534                 (cd .. && $(TAR) -uvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \
535         done; 
536 # add documentation
537         for foo in $(DOC_FILES); do \
538                 (cd .. && $(TAR) -uvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \
539         done;
540 # and zip the archive
541         $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)
542         $(GZIP_PROG) ../privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar
543         @$(ECHO) Distribution with binary created.
544
545 # anonymously ncftps the package to sourceforge
546 gen-upload:
547         ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming ../privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar.gz
548         @$(ECHO) -------------------------------------------------------
549         @$(ECHO) Now goto
550         @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118
551         @$(ECHO) ... and release the files.
552         @$(ECHO) -------------------------------------------------------
553
554 # use with care
555 gen-clean:
556         $(RM) privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar*
557
558 #############################################################################
559 # solaris distribution. verified on SF machines by swa.
560 #############################################################################
561 solaris-dist: gen-dist
562         @$(ECHO) Done.
563 # anonymously ncftps the package to sourceforge
564 solaris-upload: gen-upload
565         @$(ECHO) Done.
566 # use with care
567 solaris-clean: gen-clean
568         @$(ECHO) Done.
569
570 #############################################################################
571 # hpux distribution
572 #############################################################################
573 hpux-dist:
574         @$(ECHO) coming soon. 
575 hpux-upload:
576         @$(ECHO) coming soon. 
577
578 #############################################################################
579 # debian distribution
580 #############################################################################
581 debian-dist:
582         @$(ECHO) coming soon. 
583 debian-upload:
584         @$(ECHO) coming soon. 
585
586 #############################################################################
587 # macosx distribution
588 #############################################################################
589 macosx-dist:
590         @$(ECHO) coming soon. 
591 macosx-upload:
592         @$(ECHO) coming soon. 
593
594 #############################################################################
595 # amiga distribution
596 #############################################################################
597 amiga-dist:
598         @$(ECHO) coming soon. 
599 amiga-upload:
600         @$(ECHO) coming soon. 
601
602 #############################################################################
603 # freebsd distribution. verified on SF machines by swa.
604 #############################################################################
605 freebsd-dist: gen-dist
606         @$(ECHO) Done.
607 # anonymously ncftps the package to sourceforge
608 freebsd-upload: gen-upload
609         @$(ECHO) Done.
610 # use with care
611 freebsd-clean: gen-clean
612         @$(ECHO) Done.
613
614 #############################################################################
615 # Windows distribution
616 #############################################################################
617 win-dist:
618         $(ECHO) Not implemented.
619
620
621 #############################################################################
622 # Tarball distribution: No CVS dirs, dotfiles, debian build dir,
623 # (FIXME:) only parts of the static / generated docs mix in doc/webserver
624 #############################################################################
625
626 tarball-dist: dist-check clean clobber
627         $(LN) -s current ../privoxy-$(VERSION)-$(CODE_STATUS)
628
629         for i in `find . -type f -a -not \( -path "*/CVS*" -o -name ".*" \
630         -o -path "*/debian/*" -o -path "*/actions/*" -o -name "*.php" -o \
631         -name "PACKAGERS" -o -path "*/pdf/*" \)`; do \
632            files="$$files privoxy-$(VERSION)-$(CODE_STATUS)/$$i"; \
633         done &&  \
634         cd .. && $(TAR) -cvhf privoxy-$(VERSION)-$(CODE_STATUS)-src.tar $$files ; \
635
636 # and zip the archive
637         $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS) 
638         $(GZIP_PROG) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar
639         @$(ECHO) Tarball distribution created.
640
641 # anonymously ncftps the tarball to sourceforge
642 tarball-upload:
643         ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz
644         @$(ECHO) -------------------------------------------------------
645         @$(ECHO) Now goto
646         @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118
647         @$(ECHO) ... and release the files.
648         @$(ECHO) -------------------------------------------------------
649
650 tarball-clean:
651         $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz
652
653 #############################################################################
654 #
655 # Documentation
656 #
657 # converts doc/source/*.sgml into html, pdf and man pages
658 #
659 #############################################################################
660
661 # developer manual
662 dok-devel: 
663         $(RM) doc/webserver/developer-manual/*.html
664         $(RM) -r doc/source/developer-manual
665         mkdir -p doc/source/developer-manual
666         cd doc/source/developer-manual && $(DB) ../developer-manual.sgml && cd .. && cp developer-manual/*.html ../webserver/developer-manual/
667
668 # user manual
669 dok-user: 
670         $(RM) doc/webserver/user-manual/*.html
671         $(RM) -r doc/source/user-manual/
672         mkdir -p doc/source/user-manual
673         cd doc/source/user-manual && $(DB) -iuser-man ../user-manual.sgml && cd .. && cp user-manual/*.html ../webserver/user-manual/
674         # FIXME: temp fix so same stylesheet gets in more than one place so it works
675         # for all doc set-ups, including the 'user manual' config option in local
676         # system where it MUST be in same directory as html.
677         $(PERL) -pi.bak -e 's/<\/head/\n<LINK REL=\"STYLESHEET\" TYPE=\"text\/css\" HREF=\"p_doc.css\">\n<\/head/i' doc/webserver/user-manual/*html
678
679 # faq
680 dok-faq: 
681         $(RM) doc/webserver/faq/*.html
682         $(RM) -r doc/source/faq
683         mkdir -p doc/source/faq
684         cd doc/source/faq && $(DB) ../faq.sgml && cd .. && cp faq/*.html ../webserver/faq/
685
686 # man page, one variation. Try to use the next target, just 'make man'. 
687 dok-man: 
688         $(RM) doc/man/* doc/webserver/man-page/*.html
689 ifneq ($(MAN2HTML),false)
690         $(ECHO) "<html><head><title>Privoxy 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
691         man ./privoxy.1 | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html
692         $(ECHO) "</body></html>" >> doc/webserver/man-page/privoxy-man-page.html
693 else
694         $(MAKE) groff2html
695 endif
696
697 # Build man page from sgml. This requires the SGMLSpm perl module.
698 # See CPAN, or your favorite perl repository. This is the preferred 
699 # target for man page generation!
700 man: dok-release
701         mkdir -p doc/source/temp && cd doc/source/temp && $(RM) * ;\
702         nsgmls ../privoxy-man-page.sgml  | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\
703         perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' privoxy.1 ;\
704         $(DB) ../privoxy-man-page.sgml && $(MV) -f privoxy.1 ../../../privoxy.1
705
706 # For those with man2html ala RH7s.
707 man2html:
708         mkdir -p doc/webserver/man-page
709 ifneq ($(MAN2HTML),false)
710         $(MAN2HTML) privoxy.1 |grep -v "^Content-type" > tmp.html
711         $(PERL) -pi.bak -e 's/<A .*Contents<\/A>//; s/<A .*man2html<\/A>/man2html/' tmp.html
712         $(PERL) -pi.bak -e 's/(<\/HEAD>)/<LINK REL=\"STYLESHEET\" TYPE=\"text\/css\" HREF=\"..\/p_doc.css\"><\/HEAD>/' tmp.html
713 # Twice because my version of man2html is pulling in commas and periods in URLs.
714         $(PERL) -pi.bak -e 's/(<A.*),(">)/$$1$$2/g' tmp.html
715         $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html
716 # Get rid of spurious \a from conversion. (How to do this with perl?)
717         $(SED) -e 's/\a//g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.*
718 else
719         $(MAKE) groff2html
720 endif
721
722
723 # Otherwise we get plain groff conversion.
724 groff2html:
725         $(G2H_CMD) ./privoxy.1 | $(SED) -e 's@</head>@<link REL="STYLESHEET" TYPE="text/css" HREF="../p_doc.css"></head>@' > doc/webserver/man-page/privoxy-man-page.html
726
727
728 # readme page and INSTALL file
729 dok-readme: dok-release
730         cd doc/source && $(DB)-notoc -V nochunks readme.sgml > tmp.html &&\
731         env -u LANG $(WDUMP) tmp.html > ../../README ;\
732         $(DB)-notoc -V nochunks install.sgml > tmp.html &&\
733         env -u LANG $(WDUMP) tmp.html > ../../INSTALL ;\
734         $(RM) tmp.*
735
736 # index.sgml is used to create both the Home Page, and a local index
737 # for documentation, etc.
738 #
739 # index.html for webserver:
740 dok-webserver: 
741         cd doc/source/webserver && $(DB)-notoc -ip-homepage -V nochunks index.sgml > ../../webserver/index.html
742         $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\
743         s/<\/HEAD/\n<meta name=\"description\" content=\"Privoxy helps users to protect their privacy.\"><\/HEAD/;\
744         s/<\/HEAD/\n<meta name="MSSmartTagsPreventParsing" content="TRUE"><\/HEAD/;\
745         s/\.\d\. //;\
746         s/__copy/&copy;/'\
747      doc/webserver/index.html && $(RM) doc/webserver/*.bak
748
749 # privoxy-index.html for local documentation:
750 dok-index: 
751         cd doc/source/webserver && $(DB)-notoc -ip-index -V nochunks index.sgml > ../../webserver/privoxy-index.html
752         $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\
753         s/<\/HEAD/\n<meta name=\"description\" content=\"Privoxy helps users to protect their privacy.\"><\/HEAD/;\
754         s/<\/HEAD/\n<meta name="MSSmartTagsPreventParsing" content="TRUE"><\/HEAD/;\
755         s/\.\d\. //;\
756         s/__copy/&copy;/' \
757      doc/webserver/privoxy-index.html && $(RM) doc/webserver/*.bak
758
759 # Main documentation target.
760 dok: dok-release dok-devel dok-user dok-faq dok-readme dok-webserver dok-authors dok-index
761         @$(ECHO) Documentation created.
762
763 #
764 # an alternative to the above dok. disabled man page creation for the moment
765 #
766 redhat-dok: dok-release dok-devel dok-user dok-faq redhat-readme dok-webserver dok-authors
767         @$(ECHO) Documentation created.
768
769 ## Make README
770 redhat-readme: 
771         cd doc/source && $(DB)-notoc -V nochunks readme.sgml > tmp.html && $(WDUMP) \
772           tmp.html > ../../README && $(RM) -r tmp.html
773
774 ## Make AUTHORS file
775 dok-authors: 
776         cd doc/source && $(DB) -V nochunks authors.sgml > tmp.html && env -u LANG $(WDUMP) \
777           tmp.html > ../../AUTHORS && $(RM) tmp.html
778
779 # Set doc entities for VERSION and CODE_STATUS in sgml docs. Toggle content
780 # exceptions accordingly. This needs to go before any doc building (doh).
781 dok-release:
782         @$(ECHO) Setting doc version and status to $(VERSION), $(CODE_STATUS)
783         @$(PERL) -pi.bak -e 's/<!entity +p-version.*>/<!entity p-version "$(VERSION)">/;\
784      s/<!entity +p-status.*>/<!entity p-status "$(CODE_STATUS)">/' \
785      doc/source/*sgml doc/source/*/*sgml
786         $(RM) -r doc/source/*bak doc/source/*/*bak
787 ifeq ($(CODE_STATUS),stable)
788         @$(ECHO) Setting docs to stable $(VERSION)
789         @$(PERL) -pi.bak -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "INCLUDE">/;\
790      s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "IGNORE">/' \
791      doc/source/*sgml doc/source/*/*sgml
792         $(RM) -r doc/source/*bak doc/source/*/*bak
793 else
794         @$(ECHO) Setting docs to not stable $(VERSION)
795         @$(PERL) -pi.bak -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "IGNORE">/;\
796      s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "INCLUDE">/' \
797      doc/source/*sgml doc/source/*/*sgml
798         $(RM) -r doc/source/*bak doc/source/*/*bak
799 endif
800
801 # Generate single page html. Used only for creating pdf docs (ATM).
802 # Currently using: See http://www.easysw.com/htmldoc/pdf-o-matic.php.
803 # If using this generator, remember U-M has a couple of graphics in 
804 # a parallel directory.
805 #
806 dok-shtml: dok-release 
807         mkdir -p doc/source/temp # this directory not in cvs
808         cd doc/source && $(DB) -iuser-man -V nochunks user-manual.sgml > temp/privoxy-user-manual.html
809         cd doc/source && $(DB) -V nochunks developer-manual.sgml > temp/privoxy-developer-manual.html
810         cd doc/source && $(DB) -V nochunks faq.sgml > temp/privoxy-faq.html
811 # one could use html2ps and ps2pdf. well, that does not work. htmlps produces incorrect output.
812
813 # Make pdf docs from single page html. Requires htmldoc, see
814 # (http://www.easysw.com/htmldoc/). Note: 1.8.20 has a TOC bug.
815 # PDF docs are uploaded to webserver as zip archive.
816 dok-pdf: dok-shtml
817         @$(ECHO) -n "starting htmldoc version: ";
818         if htmldoc --version ; then : ; \
819            else $(ECHO) "WARNING: could not get htmldoc version" ; fi
820         cd utils/ldp_print && $(RM) *html *bak *jpg *tmp *pdf *zip
821         cp -f doc/source/temp/*html doc/webserver/user-manual/*jpg utils/ldp_print
822         cd utils/ldp_print ;\
823         $(PERL) -pi.bak -e 's/\.\.\/images\///; s/(<\/?)SUB/$$1small/i;\
824                             s/\.\.\/user-manual\/index\.html/privoxy-user-manual.pdf/;\
825                                         s/\.\.\/developer-manual\/index\.html/privoxy-developer-manual.pdf/;\
826                                         s/\.\.\/faq\/index\.html/privoxy-faq.pdf/' *.html ;\
827         for i in developer-manual user-manual faq; do \
828                 ./ldp_print privoxy-$$i.html ;\
829                 $(ECHO) DONE: privoxy-$$i.pdf ;\
830         done ;\
831         $(MV) *.pdf  ../../doc/pdf ;\
832         $(RM) -r *html *bak *jpg *pdf *zip ../../doc/source/temp
833
834 # Create release announcement in text and html, with short and long versions.
835 # This is a standalone target, and must be invoked directly.
836 # announce: dok-release
837 #       mkdir -p $(DOC_TMP)
838 #       cd $(DOC_TMP) && cp -f ../announce.sgml . && $(DB) -iannounce-big announce.sgml &&\
839 #       mv -f index.html announce.html && $(WDUMP) announce.html > announce.txt
840 #       cd $(DOC_TMP) && $(DB) announce.sgml &&\
841 #       mv -f index.html announce-mini.html && $(WDUMP) announce-mini.html > announce-mini.txt &&\
842 #       mv -f *html *txt ../../.. 
843 #       rm -fr $(DOC_TMP)
844
845 # The main Privoxy config file, generated from sgml sources. 
846 # NOTE: This will require some hand editing. The new file is outputted 
847 # as config.new so that problem sections can be compared to previous
848 # version. This is hardcored to w3m for html/text conversion. Also, 
849 # requires the shell util 'fmt'.
850 config-file: dok-release
851         cd doc/source && $(DB)-notoc -iconfig-file -V nochunks config.sgml > __tmp.html &&\
852         env -u LANG w3m -dump __tmp.html | fmt -w 70 > ../../config.new && $(RM) -r __tmp.*
853         $(PERL) -i.bak utils/prepare-configfile.pl config.new
854
855         $(RM) *.bak
856         @$(ECHO)  "****************************************************"
857         @$(ECHO)  "The output file is config.new."
858         @$(ECHO)  "Now -- you need to hand edit the results!!!"
859         @$(ECHO)  "In particular, check the Debug levels, the"
860         @$(ECHO)  "permit-access, forward & socks examples and the"
861         @$(ECHO)  "various user-manual examples, which all"
862         @$(ECHO)  "probably got hammered."
863         @$(ECHO)  "****************************************************"
864
865 # config file, alternate version using lynx (perl stuff unfinished). Lynx
866 # does not do so good a job.
867 config-file-alt: 
868         cd doc/source && $(ECHO) -e ".h2 JUSTIFY\\nJUSTIFY:FALSE" > __tmp.lynx_cfg &&\
869         $(DB)-notoc -iconfig-file -V nochunks config.sgml > __tmp.html &&\
870         lynx -cfg=__tmp.lynx_cfg -width=78 -dump __tmp.html > ../../config.new && $(RM) -r __tmp.*
871         $(PERL) -pi -e 's/^(   )//;\
872                         s/:$\/:\n/' config.new
873
874 #############################################################################
875 #
876 # Webserver
877 #
878 # moves dokumentation to webserver
879 #
880 #############################################################################
881 webserver: tidy
882         @$(ECHO) -------------------------------------------------------
883         @$(ECHO) You have run make dok/redhat-dok before, right?
884         @$(ECHO) Note that this command scps all stuff to the webserver,
885         @$(ECHO) it will not remove obsolete documents.
886         @$(ECHO) -------------------------------------------------------
887
888         @$(ECHO) Uploading html
889         @cd doc/webserver; \
890           upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \
891           $(TAR) c $$upload | ssh ijbswa.sourceforge.net 'cd /home/groups/i/ij/ijbswa/htdocs/; tar xvm 2>&1 | grep -v timestamp'
892
893         @$(ECHO) Uploading pdf
894         @cd doc/pdf;\
895           zip privoxy-pdf-docs *.pdf  ;\
896                 scp -q privoxy-pdf-docs.zip ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/pdf
897
898         @$(ECHO) Fixing permissions
899         @ssh ijbswa.sourceforge.net 'chmod -R 775 /home/groups/i/ij/ijbswa/htdocs 2>/dev/null; true'
900         @ssh ijbswa.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/ -type f | xargs chmod 664 2>/dev/null; true'
901         @ssh ijbswa.sourceforge.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null; true'
902
903
904 web-actions: tidy
905         @$(ECHO) Uploading 
906         @cd doc/webserver/actions; \
907           upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \
908           $(TAR) c $$upload | ssh ijbswa.sourceforge.net 'cd /home/groups/i/ij/ijbswa/htdocs/actions; tar xvm'
909
910         @$(ECHO) Fixing permissions
911         @ssh ijbswa.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/actions/ -type f | xargs chmod 664 2>/dev/null'
912         @ssh ijbswa.sourceforge.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null'
913
914 ## 
915 dok-put:
916         tar --exclude ".cvsignore" --exclude "CVS" --exclude "source" --exclude ".htaccess" \
917              --exclude "obsolete" --exclude "actions" --exclude "*.zip" --exclude "robots.txt"\
918                 doc/* INSTALL LICENSE AUTHORS README \
919                 -czf $(DOC_FILE) ;\
920                 $(ECHO) "Uploading doc package ..." ;\
921                 scp $(DOC_FILE) ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/docs/
922                 @ssh ijbswa.sourceforge.net 'chmod 775 /home/groups/i/ij/ijbswa/htdocs/docs/*gz 2>/dev/null; true'
923                 $(RM) $(DOC_FILE)
924
925 dok-get:
926         cd /tmp ;\
927         $(WGET) http://www.privoxy.org/docs/$(DOC_FILE) ;\
928         $(TAR) -zxvf $(DOC_FILE)
929
930
931 #############################################################################
932 # Source file dependencies
933 #############################################################################
934
935 actions.@OBJEXT@:   actions.c   actions.h   config.h $(PROJECT_H_DEPS) errlog.h jcc.h list.h loaders.h miscutil.h actionlist.h ssplit.h
936 cgi.@OBJEXT@:       cgi.c       cgi.h       config.h $(PROJECT_H_DEPS) cgiedit.h cgisimple.h jbsockets.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h
937 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 actionlist.h actions.h errlog.h miscutil.h
938 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 urlmatch.h
939 deanimate.@OBJEXT@: deanimate.c deanimate.h config.h $(PROJECT_H_DEPS)
940 encode.@OBJEXT@:    encode.c    encode.h    config.h
941 errlog.@OBJEXT@:    errlog.c    errlog.h    config.h $(PROJECT_H_DEPS) @WIN_ONLY@w32log.h
942 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 urlmatch.h @WIN_ONLY@win32.h 
943 gateway.@OBJEXT@:   gateway.c   gateway.h   config.h $(PROJECT_H_DEPS) errlog.h jbsockets.h jcc.h loadcfg.h
944 jbsockets.@OBJEXT@: jbsockets.c jbsockets.h config.h $(PROJECT_H_DEPS) filters.h
945 jcc.@OBJEXT@:       jcc.c       jcc.h       config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h loadcfg.h loaders.h miscutil.h parsers.h @WIN_ONLY@w32log.h win32.h w32svrapi.h cgi.h
946 list.@OBJEXT@:      list.c      list.h      config.h $(PROJECT_H_DEPS) list.h miscutil.h
947 loadcfg.@OBJEXT@:   loadcfg.c   loadcfg.h   config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h jcc.h loaders.h miscutil.h parsers.h @WIN_ONLY@w32log.h win32.h
948 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
949 miscutil.@OBJEXT@:  miscutil.c  miscutil.h  config.h
950 parsers.@OBJEXT@:   parsers.c   parsers.h   config.h $(PROJECT_H_DEPS) errlog.h filters.h jbsockets.h jcc.h loadcfg.h loaders.h miscutil.h ssplit.h
951 ssplit.@OBJEXT@:    ssplit.c    ssplit.h    config.h miscutil.h
952 urlmatch.@OBJEXT@:  urlmatch.c  urlmatch.h  config.h $(PROJECT_H_DEPS) errlog.h miscutil.h ssplit.h
953
954 # GNU regex
955 gnu_regex.@OBJEXT@: gnu_regex.c gnu_regex.h config.h
956
957 # PCRS
958 pcrs.@OBJEXT@: pcrs.c pcrs.h config.h pcre/pcre.h 
959
960 # PCRE
961 pcre/get.@OBJEXT@:        pcre/get.c        pcre/config.h pcre/internal.h pcre/pcre.h
962 pcre/maketables.@OBJEXT@: pcre/maketables.c pcre/config.h pcre/internal.h pcre/pcre.h
963 pcre/pcre.@OBJEXT@:       pcre/pcre.c       pcre/config.h pcre/internal.h pcre/pcre.h pcre/chartables.c 
964 pcre/pcreposix.@OBJEXT@:  pcre/pcreposix.c  pcre/config.h pcre/internal.h pcre/pcre.h pcre/pcreposix.h
965 pcre/study.@OBJEXT@:      pcre/study.c      pcre/config.h pcre/internal.h pcre/pcre.h
966
967 # An auxiliary program makes the PCRE default character table source
968
969 pcre/chartables.c:   pcre/dftables@EXEEXT@
970                 pcre/dftables@EXEEXT@ >pcre/chartables.c
971
972 pcre/dftables@EXEEXT@:       pcre/dftables.c pcre/maketables.c pcre/pcre.h pcre/internal.h pcre/config.h
973                 $(CC) -o pcre/dftables@EXEEXT@ $(CFLAGS) pcre/dftables.c
974
975 # Win32
976 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
977 w32taskbar.@OBJEXT@: w32taskbar.c config.h w32log.h w32taskbar.h
978 win32.@OBJEXT@: win32.c config.h jcc.h loadcfg.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h win32.h w32svrapi.h
979
980 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
981         windres -D__MINGW32__=0.2 -O coff -i $< -o $@
982
983 # AmigaOS
984 @AMIGAOS_ONLY@OBJS += amiga.o
985 @AMIGAOS_ONLY@ifeq ($(shell $(CC) -dumpmachine), m68k-amigaos)
986 @AMIGAOS_ONLY@CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -W -m68020 -noixemul -fbaserel -msmall-code
987 @AMIGAOS_ONLY@LDFLAGS += -m68020 -noixemul -fbaserel
988 @AMIGAOS_ONLY@LIBS = -lm /gg/lib/libb/libm020/libnix/swapstack.o
989 @AMIGAOS_ONLY@else
990 @AMIGAOS_ONLY@CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -Wextra -D__USE_INLINE__ -D__NO_INTUITION_RJ_MACROS
991 @AMIGAOS_ONLY@endif
992 @AMIGAOS_ONLY@amiga.o: amiga.c amiga.h config.h
993
994
995 $(PROGRAM): $(OBJS) $(W32_FILES)
996         $(LD) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
997
998 clean:
999         $(RM) a.out $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) default.action `find . -name TAGS -o -name tags` config.base config.tmp
1000
1001 tidy:
1002         $(RM) `find . -name "*~"`
1003         $(RM) `find . -name "#*#"` # Emacs backup files
1004         $(RM) `find . -name ".\#*"`
1005
1006 clobber: tidy
1007         $(RM) GNUmakefile configure config.h.in config.h config.cache config.status config.log logfile \
1008               privoxy.log core *.tar.gz *.tar privoxy-cl.spec doc/source/ldp.dsl config.new
1009         $(RM) -r autom4te.cache
1010
1011 #
1012 # FIXME: What is all this? 
1013 #
1014         $(RM) cscope.*  *.pdb *.lib *.exp 
1015
1016 distclean: clobber
1017
1018 tags: $(SRCS) $(HDRS)
1019         etags $(SRCS) $(HDRS)
1020
1021 CONF_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(CONF_BASE)" = "$(prefix)/etc" ];then \
1022                 $(ECHO) "$(CONF_BASE)/privoxy";\
1023          else\
1024                  $(ECHO) "$(CONF_BASE)";\
1025          fi)
1026
1027 LOG_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(LOGS_DEST)" = "$(prefix)/var/log/privoxy" ];then \
1028                 $(ECHO) "/var/log/privoxy" ;\
1029          else\
1030                  $(ECHO) "$(LOGS_DEST)";\
1031          fi)
1032
1033 PID_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(PIDS_DEST)" = "$(prefix)/var/run" ];then \
1034                 $(ECHO) "/var/run" ;\
1035          else\
1036                  $(ECHO) "$(PIDS_DEST)";\
1037          fi)
1038
1039 check_doc:=$(shell if [ ! -d "$(SHARE_DEST)/doc" ] && [ "$(prefix)" = "/usr/local" ]  && [ -d "$(prefix)/doc" ];then \
1040                 $(ECHO) "1";\
1041          else\
1042                  $(ECHO) "0";\
1043          fi)
1044
1045 # If USER is specified but no GROUP, assume there is a GROUP of same name.
1046 GROUP_T:=$(shell if [ x$(GROUP) = x ] && [ x$(USER) != x ];then \
1047                 $(ECHO) "$(USER)" ;\
1048          else\
1049                  $(ECHO) "$(GROUP)";\
1050          fi)
1051
1052 install-strip:
1053         $(MAKE) install STRIP=-s
1054
1055 # FIXME: Test USER and GROUP on Slack to make sure this works as 
1056 # intended.
1057 #
1058 # FIXME: id handling needs help, probably via configure, since 'id -u' is not 
1059 # universally reliable (eg Solaris). Group handling could be better. 
1060 # Perhaps the whole user/group validation should be done here, and simplified.
1061 PROGRAM_V = Privoxy $(VERSION) $(CODE_STATUS)
1062 install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T
1063         @# Quick test for valid USER.
1064         @if [ -n "$(USER)" ]; then \
1065                 $(ID) $(USER) >/dev/null || exit 1;\
1066         fi
1067         @# Test for valid group. FIXME. USER does not have to belong to GROUP 
1068         @# for file ownership purposes.
1069 #       if [ -n "$(GROUP_T)" ] && [ -n "$(USER)" ] && ! $(GROUPS) $(USER) | $(GREP) "\<$(GROUP_T)\>" >/dev/null; then \
1070 #               $(ECHO) Group $(GROUP_T) for User $(USER) is invalid && exit 1 ;\
1071 #       fi
1072
1073         @$(ECHO) "Creating directories, and preparing $(PROGRAM_V) installation"
1074         $(CHMOD) $(DIR_MODE) $(MKDIR)
1075         @$(MKDIR) $(DESTDIR)$(SBIN_DEST) $(DESTDIR)$(prefix) $(DESTDIR)$(CONF_DEST) \
1076                 $(DESTDIR)$(CONF_DEST)/templates $(DESTDIR)$(SHARE_DEST) \
1077                 $(DESTDIR)$(LOG_DEST) $(DESTDIR)$(PID_DEST)
1078         @# Install the executable binary, strip if invoked as install-strip
1079         @test -n "$(STRIP)" &&\
1080         $(ECHO) Installing $(PROGRAM) stripped executable to $(SBIN_DEST) ||\
1081         $(ECHO) Installing $(PROGRAM) executable to $(DESTDIR)$(SBIN_DEST)
1082         $(INSTALL) $(INSTALL_P) $(STRIP) $(PROGRAM) $(DESTDIR)$(SBIN_DEST)
1083
1084         @# Install the DOCS and man page. install-sh only does one file at a time.
1085         @# FIXME: only handles jpegs.
1086         -@if [ $(check_doc) = 0 ]; then \
1087                 DOC=$(DOC_DEST) ;\
1088         else \
1089                 DOC=$(prefix)/doc/privoxy ;\
1090         fi;\
1091         $(MKDIR) $(DESTDIR)$$DOC $(DESTDIR)$$DOC/user-manual $(DESTDIR)$$DOC/faq $(DESTDIR)$$DOC/developer-manual \
1092              $(DESTDIR)$$DOC/man-page $(DESTDIR)$$DOC/images $(DESTDIR)$(MAN_DEST) ;\
1093         if [ -d "$(DOK_WEB)" ]; then \
1094                 $(ECHO) Installing FAQ, Manual, and other docs to $(DESTDIR)$$DOC;\
1095           for i in user-manual developer-manual faq; do \
1096                for ii in $(DOK_WEB)/$$i/*html; do \
1097                     $(INSTALL) $(INSTALL_T) $$ii $(DESTDIR)$$DOC/$$i;\
1098                done ;\
1099           done ;\
1100                 for i in $(DOK_WEB)/user-manual/*jpg; do \
1101                $(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$$DOC/user-manual;\
1102           done ;\
1103                 $(INSTALL) $(INSTALL_T) $(DOK_WEB)/man-page/*html $(DESTDIR)$$DOC/man-page;\
1104                 $(INSTALL) $(INSTALL_T) $(DOK_WEB)/privoxy-index.html $(DESTDIR)$$DOC/index.html;\
1105                 $(INSTALL) $(INSTALL_T) AUTHORS $(DESTDIR)$$DOC;\
1106                 $(INSTALL) $(INSTALL_T) LICENSE $(DESTDIR)$$DOC;\
1107                 $(INSTALL) $(INSTALL_T) README $(DESTDIR)$$DOC;\
1108                 $(INSTALL) $(INSTALL_T) ChangeLog $(DESTDIR)$$DOC;\
1109                 $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC;\
1110                 $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC/user-manual;\
1111         fi
1112         @# Not all platforms support gzipped man pages.
1113         @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/privoxy.1
1114         -$(INSTALL) $(INSTALL_T) privoxy.1  $(DESTDIR)$(MAN_DEST)/privoxy.1
1115
1116         @# Change the config file default directories according to the configured ones
1117         @$(ECHO) Rewriting config for this installation
1118         @if [ -f config.base ] ; then \
1119                 $(CAT) config >config~ ;\
1120                 $(MV) config.base config ;\
1121         fi
1122         $(SED) 's+^confdir \.+confdir $(CONF_DEST)+' config | \
1123         $(SED) 's+^logdir \.+logdir $(LOG_DEST)+' >config.tmp
1124         -@if [ $(check_doc) = 0 ]; then \
1125       $(SED) 's+^#\?user-manual .*+user-manual $(DOC_DEST)/user-manual/+' config.tmp >config.updated ;\
1126         else \
1127       $(SED) 's+^#\?user-manual .*+user-manual $(prefix)/doc/privoxy/user-manual/+' config.tmp >config.updated ;\
1128         fi;\
1129         $(MV) config config.base
1130         $(MV) config.updated config 
1131
1132         @# Install the config support files. Test for root install, and abort 
1133         @# if there is no privoxy user, and no other user was enabled during 
1134         @# configure. Later, install init script if appropriate.
1135         @$(ECHO) Installing templates to $(DESTDIR)$(CONF_DEST)/templates
1136         @for i in `find templates -type f`; do \
1137                 $(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$(CONF_DEST)/templates ;\
1138         done
1139
1140         @# FIXME: group/user validation is overly convoluted.
1141         @# If superuser install ... we require a minimum of group ownership
1142         @# of those files the daemon writes to, to be non-root owned.
1143         @if [ "`$(ID) |sed 's/(.*//' |sed 's/.*=//'`" = "0" ] ;then\
1144                 if [ x$(USER) = x ] || [ $(USER) = root ]; then \
1145                         if [ x$(GROUP) = x ] || [ $(GROUP) = root ]; then \
1146                                 if [ "`$(ID) privoxy`" ] && \
1147                                         $(GROUPS) privoxy | $(SED) 's/^.*://' |$(GREP) "\<privoxy\>" >/dev/null; then \
1148                                         $(ECHO) "Warning: Setting group owner to privoxy";\
1149                                         GROUP_T=privoxy ;\
1150                                 else \
1151                                         $(ECHO)  "******************************************************************" ;\
1152                                         $(ECHO)  " WARNING! WARNING! installing config files as root!" ;\
1153                                         $(ECHO)  " It is strongly recommended to run $(PROGRAM) as a non-root user," ;\
1154                                         $(ECHO)  " and to install the config files as that user and/or group!" ;\
1155                                         $(ECHO)  " Please read INSTALL, and create a privoxy user and group!" ;\
1156                                         $(ECHO)  "*******************************************************************" ;\
1157                                         exit 1 ;\
1158                                 fi ;\
1159                         else \
1160                                 GROUP_T=$(GROUP) ;\
1161                         fi ;\
1162                         INSTALL_CONF="$(INSTALL_R) -g $$GROUP_T " ;\
1163                 else \
1164                         $(ECHO) "Superuser install, installing config files as $(USER):$(GROUP_T)" ;\
1165                         INSTALL_CONF="$(INSTALL_R) -o $(USER) -g $(GROUP_T)" ;\
1166                         GROUP_T=$(GROUP_T) ;\
1167                 fi ;\
1168         else \
1169                 if [ ! "`id $(USER)`" = "`id`" ] ;then \
1170                         $(ECHO) "** WARNING ** current install user different from configured user!!" ;\
1171                         $(ECHO) "Edit may fail." ;\
1172                 fi ;\
1173                 INSTALL_CONF="$(INSTALL_R)" ;\
1174         fi ;\
1175         $(ECHO) Installing configuration files to $(DESTDIR)$(CONF_DEST);\
1176         for i in $(CONFIGS); do \
1177                 if [ "$$i" = "default.action" ] || [ "$$i" = "default.filter" ] || [ "$$i" = "standard.action" ]; then \
1178                         $(RM) $(DESTDIR)$(CONF_DEST)/$$i ;\
1179                         $(ECHO) Installing fresh $$i;\
1180                         $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\
1181                 elif [ -s "$(CONF_DEST)/$$i" ]; then \
1182                         $(ECHO) Installing $$i as $$i.new ;\
1183                         $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST)/$$i.new || exit 1;\
1184                         NEW=1;\
1185                 else \
1186                         $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\
1187                 fi ;\
1188         done ;\
1189         if [ -n "$$NEW" ]; then \
1190                 $(CHMOD) $(RWD_MODE) $(DESTDIR)$(CONF_DEST)/*.new || exit 1 ;\
1191                 $(ECHO) "Warning: Older config files are preserved. Check new versions for changes!" ;\
1192         fi ;\
1193         [ ! -f $(DESTDIR)$(LOG_DEST)/logfile ] && $(ECHO) Creating logfiles in $(DESTDIR)$(LOG_DEST) || \
1194                 $(ECHO) Checking logfiles in $(DESTDIR)$(LOG_DEST) ;\
1195                 $(TOUCH) $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(LOG_DEST)/jarfile || exit 1 ;\
1196         if [ x$$USER != x ]; then \
1197                 $(CHOWN) $$USER $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(LOG_DEST)/jarfile || \
1198                 $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
1199         fi ;\
1200         if [ x$$GROUP_T != x ]; then \
1201                 $(CHGRP) $$GROUP_T $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(LOG_DEST)/jarfile || \
1202                 $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
1203         fi ;\
1204         $(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(LOG_DEST)/jarfile || exit 1 ;\
1205         if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \
1206                 if [ -f /etc/slackware-version ] && [ -d /etc/rc.d/ ] && [ -w /etc/rc.d/ ] ; then \
1207                $(SED) 's+%PROGRAM%+$(PROGRAM)+' slackware/rc.privoxy.orig | \
1208                $(SED) 's+%SBIN_DEST%+$(SBIN_DEST)+' | \
1209                $(SED) 's+%CONF_DEST%+$(CONF_DEST)+' | \
1210                $(SED) 's+%USER%+$(USER)+' | \
1211                $(SED) 's+%GROUP%+$(GROUP_T)+' >slackware/rc.privoxy ;\
1212                         $(INSTALL) $(INSTALL_P) slackware/rc.privoxy $(DESTDIR)/etc/rc.d/ ;\
1213                $(ECHO) "Installing for Slackware." ;\
1214                $(ECHO) "Dont forget to add the rc.privoxy to rc.local if you want it started at every boot" ;\
1215                 elif [ -f /etc/redhat-release ] && [ -d /etc/rc.d/init.d/ ] && [ -w /etc/rc.d/init.d/ ] ; then \
1216                $(ECHO) "Installing init script to /etc/rc.d/init.d/privoxy" ;\
1217                         $(SED) 's,^PRIVOXY_BIN=.*,PRIVOXY_BIN="/usr/local/sbin/$(PROGRAM)",' privoxy.init |\
1218                         $(SED) 's,^PRIVOXY_CONF=.*,PRIVOXY_CONF="$(CONF_DEST)/config",' |\
1219                         $(SED) "s,^PRIVOXY_USER=.*,PRIVOXY_USER=$$USER," > init.tmp ;\
1220                         $(INSTALL) $(INSTALL_P) init.tmp $(DESTDIR)/etc/rc.d/init.d/privoxy && $(RM) init.tmp;\
1221                         $(MKDIR) $(DESTDIR)/etc/logrotate.d/ ;\
1222                         $(ECHO) "Installing logrotate script to $(DESTDIR)/etc/logrotate.d/" ;\
1223                         $(INSTALL) -m 0644 privoxy.logrotate $(DESTDIR)/etc/logrotate.d/privoxy ;\
1224                 elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \
1225                         $(ECHO) "Installing generic init script to $(DESTDIR)/etc/init.d/privoxy" ;\
1226                         $(ECHO) "Please check that the PATHs are correct, and edit if needed." ;\
1227                         $(INSTALL) $(INSTALL_P) privoxy-generic.init $(DESTDIR)/etc/init.d/privoxy ;\
1228                 fi ;\
1229         else \
1230                 $(ECHO) "No init script installed, install it manually if needed" ;\
1231         fi
1232         $(RM) config.base config.tmp
1233         @# mmmmm, good.
1234         @$(ECHO) "$(PROGRAM_V) installation succeeded!"
1235         @$(ECHO) "The Privoxy configuration files have been installed in $(DESTDIR)$(CONF_DEST)"
1236
1237 # rmdir is used as a precaution since it will not remove non-empty
1238 # directories. RH init script creates lock file and pid file.
1239 uninstall: CONF_DEST LOG_DEST PID_DEST check_doc
1240         @$(ECHO) Starting Privoxy uninstallation
1241         @# KILL privoxy if running
1242         @# XXX: the chkconfig line may need a DESTDIR prefix.
1243         -@if [ -f $(DESTDIR)/etc/redhat-release ] && [ -x $(DESTDIR)/etc/rc.d/init.d/privoxy ]; then \
1244                 $(DESTDIR)/etc/rc.d/init.d/privoxy stop >/dev/null 2>/dev/null ;\
1245                 chkconfig --del $(PROGRAM) 2>/dev/null;\
1246         fi
1247         -@test -f $(DESTDIR)$(PID_DEST)/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\
1248          $(KILL) `$(CAT) $(DESTDIR)$(PID_DEST)/privoxy.pid` || :
1249         -@test -f $(DESTDIR)/var/run/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\
1250           $(KILL) `$(CAT) $(DESTDIR)/var/run/privoxy.pid ` || :
1251
1252         @# Program binary
1253         @$(ECHO) Removing $(PROGRAM) binary
1254         $(RM) $(DESTDIR)$(SBIN_DEST)/$(PROGRAM) $(SBIN_DEST)/$(PROGRAM)~
1255
1256         @# config files and dir, and maybe old install backups
1257         -@if [ -d $(DESTDIR)$(CONF_DEST) ]; then \
1258                 $(ECHO) Saving $(PROGRAM) config files to $(DESTDIR)/tmp/$(PROGRAM)-save ;\
1259                 $(MKDIR) $(DESTDIR)/tmp/$(PROGRAM)-save ;\
1260                 cd $(DESTDIR)$(CONF_DEST) ;\
1261                 for i in $(DESTDIR)$(CONFIGS); do \
1262                         [ -f $$i ] && $(CP) $$i $(DESTDIR)/tmp/$(PROGRAM)-save ;\
1263                 done ;\
1264         fi
1265         @$(ECHO) Removing $(PROGRAM) config files
1266         -@for i in $(DESTDIR)$(CONFIGS); do \
1267                 test -f $(CONF_DEST)/$$i && $(ECHO) Removing $$i ;\
1268                 $(RM) $(DESTDIR)$(CONF_DEST)/$$i $(DESTDIR)$(CONF_DEST)/$$i~ $(DESTDIR)$(CONF_DEST)/$$i.new ;\
1269         done
1270         -@test -d $(DESTDIR)$(CONF_DEST)/templates && $(RM) -r $(DESTDIR)$(CONF_DEST)/templates &&\
1271         $(ECHO) "Removing $(DESTDIR)$(CONF_DEST)/templates/*"
1272
1273         @# man page and docs
1274         @$(ECHO) Removing $(PROGRAM) docs
1275         -$(RM) $(DESTDIR)$(MAN_DEST)/privoxy.1*
1276         -$(RM) -r $(DESTDIR)$(DOC_DEST) || $(RM) -r $(DESTDIR)$(prefix)/doc/privoxy
1277
1278         @# Log and jarfile and pidfile
1279         @$(ECHO) Removing $(PROGRAM) logs
1280         -$(RM) $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(PID_DEST)/privoxy.pid $(DESTDIR)$(LOG_DEST)/jarfile
1281
1282         @# Final clean up of unused directories. Special handling of CONF and LOG
1283      # destinations.
1284         @$(ECHO) Removing $(PROGRAM) directories
1285         @for i in $(DESTDIR)$(LOG_DEST) $(DESTDIR)$(CONF_DEST); do \
1286                 if test -d $$i; then \
1287                         $(ECHO) Removing $$i ;\
1288                         $(RMDIR) $$i || $(ECHO) "$$i is not empty, not removed" ;\
1289                 fi;\
1290         done
1291         @if [  ! "$(prefix)" = "/usr/local" ] ;then \
1292                 for i in $(DESTDIR)$(MAN_DEST) $(DESTDIR)$(MAN_DIR) $(DESTDIR)$(SHARE_DEST)/doc \
1293                          $(DESTDIR)$(SHARE_DEST) $(DESTDIR)$(SBIN_DEST); do \
1294                         if test -d $$i; then \
1295                                 $(ECHO) Removing $$i ;\
1296                                 $(RMDIR) $$i || $(ECHO) "$$i is not empty, not removed" ;\
1297                         fi;\
1298                 done;\
1299                 if test $(LOG_DEST) != /var/log/privoxy && test -d $(DESTDIR)$(prefix)/var/log; then \
1300                         $(ECHO) Removing $(DESTDIR)$(prefix)/var/log ;\
1301                         $(RMDIR) $(DESTDIR)$(prefix)/var/log || $(ECHO) "$(DESTDIR)$(prefix)/var/log is not empty, not removed";\
1302                 fi ;\
1303                 if test $(PID_DEST) != /var/run && test -d $(DESTDIR)$(prefix)/var/run; then \
1304                         $(ECHO) Removing $(DESTDIR)$(prefix)/var/run ;\
1305                         $(RMDIR) $(DESTDIR)$(prefix)/var/run || $(ECHO) "$(DESTDIR)$(prefix)/var/run is not empty, not removed";\
1306                 fi ;\
1307                 if test $(prefix)/var != /var && test -d $(DESTDIR)$(prefix)/var; then \
1308                         $(ECHO) Removing $(DESTDIR)$(prefix)/var ;\
1309                         $(RMDIR) $(DESTDIR)$(prefix)/var || $(ECHO) "$(DESTDIR)$(prefix)/var is not empty, not removed" ;\
1310                 fi ;\
1311                 if test $(prefix) != / && test $(prefix) != /usr && test -d $(DESTDIR)$(prefix); then \
1312                         $(ECHO) Removing $(DESTDIR)$(prefix) ;\
1313                         $(ECHO) Removing installation directory $(DESTDIR)$(prefix) ;\
1314                         $(RMDIR) $(DESTDIR)$(prefix) || $(ECHO) "$(DESTDIR)$(prefix) is not empty, not removed" ;\
1315                 fi;\
1316         fi
1317
1318         @# init scripts and logrotate
1319         @if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \
1320                 $(ECHO) Removing $(PROGRAM) init script ;\
1321                 if [ -f $(DESTDIR)/etc/slackware-version ] && \
1322                         [ -d $(DESTDIR)/etc/rc.d/ ]  && [ -w $(DESTDIR)/etc/rc.d/ ] ; then \
1323                         $(RM) $(DESTDIR)/etc/rc.d/rc.privoxy ;\
1324                 elif [ -f $(DESTDIR)/etc/redhat-release ] && [ -d $(DESTDIR)/etc/rc.d/init.d/ ] \
1325                        && [ -w $(DESTDIR)/etc/rc.d/init.d/ ] ; then \
1326                         $(RM) $(DESTDIR)/etc/rc.d/init.d/privoxy $(DESTDIR)/etc/logrotate.d/privoxy;\
1327                 elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \
1328                         $(RM) $(DESTDIR)/etc/init.d/privoxy ;\
1329                 else \
1330                         $(ECHO) "Unable to remove privoxy init script, not installed or permission denied" ;\
1331                 fi ;\
1332         fi
1333         @$(ECHO) Privoxy uninstalled, bye
1334
1335 coffee:
1336          @perl  -e 'print pack "C*", (31,139,8,8,153,63,226,60,2,3,99,111,102,102,101,'  \
1337                 -e '101,0,109,143,205,13,192,32,8,133,239,78,241,110,234,1,28,160,171,'  \
1338                 -e '152,208,53,26,117,247,22,165,73,137,125,9,1,62,126,2,128,169,5,243,' \
1339                 -e '143,13,139,49,164,65,100,149,152,102,73,141,88,73,178,116,205,100,'  \
1340                 -e '69,253,36,102,81,49,83,236,19,225,171,131,214,172,163,73,4,168,123,' \
1341                 -e '115,71,126,247,122,94,128,178,227,95,154,12,86,215,122,197,249,146,' \
1342                 -e '187,54,220,125,193,51,228,11,1,0,0);' | zcat
1343
1344 #############################################################################
1345
1346 ## Local Variables:
1347 ## tab-width: 3
1348 ## end:
1349
1350 # $Log: GNUmakefile.in,v $
1351 # Revision 1.171  2008/06/13 15:24:57  fabiankeil
1352 # Move previously inline'd Perl code for the config-file target
1353 # into a separate file, have it work with older perl releases,
1354 # clean it up a bit and fix the "underlining" code.
1355 #
1356 # Revision 1.170  2008/06/12 16:38:50  fabiankeil
1357 # Add third-level domain to URL in dok-get target.
1358 #
1359 # Revision 1.169  2008/06/09 17:28:31  fabiankeil
1360 # - Recommend https for releasing files.
1361 # - Fix a warning about datarootdir being ignored.
1362 #
1363 # Revision 1.168  2008/05/23 18:03:12  fabiankeil
1364 # - Shorten meta description inserted in dok-webserver
1365 #   and dok-index target.
1366 # - In config-file target, unset LANG for w3m as we
1367 #   might otherwise end up with multi-byte characters.
1368 #
1369 # Revision 1.167  2008/05/23 14:39:09  fabiankeil
1370 # Silence dok-user complaint about @# not being found.
1371 #
1372 # Revision 1.166  2008/05/23 14:04:57  fabiankeil
1373 # - Get config-file target working with more recent Perl
1374 #   versions. The generated file is still messed up, though.
1375 # - Fix comment typo.
1376 #
1377 # Revision 1.165  2008/05/22 16:57:23  fabiankeil
1378 # Fix coffee machine.
1379 #
1380 # Revision 1.164  2008/05/22 10:26:26  fabiankeil
1381 # - Remove parsers.@OBJEXT@'s dependency on encode.h.
1382 # - Include Emacs backup files in tidy target again.
1383 #
1384 # Revision 1.163  2008/05/04 18:01:53  fabiankeil
1385 # Dependency fixes: cgisimple.c and filters.c depend on urlmatch.h.
1386 #
1387 # Revision 1.162  2008/03/30 13:31:42  fabiankeil
1388 # Add DESTDIR support for the uninstall target.
1389 #
1390 # Revision 1.161  2008/03/30 13:19:13  fabiankeil
1391 # Add DESTDIR support for the install target. Closes PR#1910612.
1392 # Patch by Radoslaw Zielinski with minor modifications.
1393 #
1394 # Revision 1.160  2008/03/27 18:27:19  fabiankeil
1395 # Remove kill-popups action.
1396 #
1397 # Revision 1.159  2008/03/21 11:13:53  fabiankeil
1398 # Only gather host information if it's actually needed.
1399 # Also move the code out of accept_connection() so it's less likely
1400 # to delay other incoming connections if the host is misconfigured.
1401 #
1402 # Revision 1.158  2007/12/11 21:29:25  fabiankeil
1403 # Fix dependency list for cgiedit.c.
1404 #
1405 # Revision 1.157  2007/12/10 02:28:02  hal9
1406 # Unset $LANG for text processing of docs so we get pure text.
1407 #
1408 # Revision 1.156  2007/11/15 03:17:43  hal9
1409 # Some workaround changes to the config file perl stuff and comments, which is
1410 # broken here all by itself on perl 5.8.8.
1411 #
1412 # Revision 1.155  2007/09/22 16:23:25  fabiankeil
1413 # Update copyright line.
1414 #
1415 # Revision 1.154  2007/02/07 11:52:40  fabiankeil
1416 # Fix suse-dist as described in BR#1654052.
1417 # (I didn't test it, but it's done the same
1418 # way in redhat-dist which is known to work).
1419 #
1420 # Revision 1.153  2007/01/07 07:36:36  joergs
1421 # Added AmigaOS4 support.
1422 #
1423 # Revision 1.152  2006/12/13 14:53:51  etresoft
1424 # Include any existing LDFLAGS environment when linking so that a MacOS X Universal Binary can be created.
1425 #
1426 # Revision 1.151  2006/11/30 01:08:55  hal9
1427 # Fix problem with variable declarations in the Slackware section. Thanks to higuita.
1428 #
1429 # Revision 1.150  2006/10/25 11:55:45  fabiankeil
1430 # Fix sed regexes for rewriting "confdir ." and "logdir .".
1431 # Thanks to Darel Henman for reporting this.
1432 #
1433 # Revision 1.149  2006/10/11 01:40:28  hal9
1434 # Apply patch from  Neil McCalden to fix syntax issue.
1435 #
1436 # Revision 1.148  2006/09/26 10:57:58  hal9
1437 # Including Karsten's patch to fix make create-snapshot.
1438 #
1439 # Revision 1.147  2006/09/13 01:25:16  hal9
1440 # Make sure install forces in new default.action, default.filter, and
1441 # standard.filter. These are privoxy files, not user files.
1442 #
1443 # Revision 1.146  2006/09/08 23:57:19  hal9
1444 # User manual images are now user-manual doc directory, and fix make install
1445 # target accordingly.
1446 #
1447 # Revision 1.145  2006/09/08 02:32:00  hal9
1448 # Various changes to implement building and installing docs to be compatible
1449 # with the new "user-manual" settings in config from Roland. Docbook does not
1450 # seem to like dealing with more than one css file, so workaround that here.
1451 # Change 'make install' so it provides p_doc.css in the user-manual doc
1452 # directory so that functions well, and lastly modify 'make install' so that the
1453 # PATH is automatically set, and the 'user-manual' directive should done during
1454 # the install.
1455 #
1456 # Revision 1.144  2006/09/07 22:53:20  hal9
1457 # Make sure config sgml build related artifacts are cleaned out.
1458 #
1459 # Revision 1.143  2006/09/02 15:59:40  hal9
1460 # Add to code status to make install output.
1461 #
1462 # Revision 1.142  2006/08/29 01:46:24  hal9
1463 # Add user.filter to $CONFIGS.
1464 #
1465 # Revision 1.141  2006/08/12 03:54:37  david__schmidt
1466 # Windows service integration
1467 #
1468 # Revision 1.140  2006/07/18 14:48:45  david__schmidt
1469 # Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
1470 # with what was really the latest development (the v_3_0_branch branch)
1471 #
1472 # Revision 1.104.2.28  2004/06/10 17:06:05  hal9
1473 # Fix bug #959617, by moving TMPDIR var to create-snapshot target, which is the
1474 # only place it is used.
1475 #
1476 # Revision 1.104.2.27  2004/02/07 16:11:10  oes
1477 # Make clobber remove the autom4te.cache dir.
1478 # Closes BR #889300
1479 #
1480 # Revision 1.104.2.26  2004/01/31 16:32:25  oes
1481 # Adding a check for an htmldoc variant from the debian diff
1482 #
1483 # Revision 1.104.2.25  2004/01/31 01:15:33  oes
1484 # Fixed a typo; updated copyright notice
1485 #
1486 # Revision 1.104.2.24  2003/12/03 10:30:02  oes
1487 # - Added new dependency: actions.c -> ssplit.h
1488 # - Excluded PDF docs from src tarball
1489 #
1490 # Revision 1.104.2.23  2003/04/20 17:28:52  hal9
1491 # Strip trailing spaces from config-file generation, bug #724596.
1492 #
1493 # Revision 1.104.2.22  2003/03/28 03:32:01  hal9
1494 # Minor changes for Privoxy home page:
1495 #  - Handle &copy; more sanely
1496 #  - include link to announce.txt
1497 # Also, disable 'make announce' target.
1498 #
1499 # Revision 1.104.2.21  2002/11/04 07:04:03  hal9
1500 # Catch up with main trunk install/uninstall. Quiet output, etc.
1501 #
1502 # Revision 1.104.2.20  2002/10/25 02:44:22  hal9
1503 # Port of make install, etc from main trunk. Needs testing! Add Slackware
1504 # support, and other related changes. Update related docs.
1505 #
1506 # Revision 1.104.2.19  2002/09/26 22:50:02  hal9
1507 # New user-manual examples in config-file are getting wrapped. Add warning.
1508 #
1509 # Revision 1.104.2.18  2002/08/23 12:22:40  oes
1510 # Added warning to broken install target
1511 #
1512 # Revision 1.104.2.17  2002/08/16 03:19:34  hal9
1513 # More (minor) cleanup of html before pdf processing to make some relative
1514 # links work as pdf -> pdf. Upload pdf as zip archive now.
1515 #
1516 # Revision 1.104.2.16  2002/08/14 16:43:27  hal9
1517 # Added pdf docs to make webserver target.
1518 #
1519 # Revision 1.104.2.15  2002/08/11 20:02:41  hal9
1520 # New targets for man page (make man) and pdf (make dok-pdf) targets.
1521 #
1522 # Revision 1.104.2.14  2002/08/10 11:19:37  oes
1523 # - Make -Ipcre (again) conditional on STATIC_PCRE
1524 # - $(RPMBUILD) -> $(RPM) for SuSE
1525 # - Add dependency: pcrs.o deps on config.h
1526 #
1527 # Revision 1.104.2.13  2002/08/07 15:13:54  hal9
1528 # Remove pdf2 target, and make it dok-shtml (single page html for pdf
1529 # conversion).
1530 #
1531 # Revision 1.104.2.12  2002/08/06 11:29:36  oes
1532 # Fixed detection/inclusion of pcre.h, which is in a pcre subdir on RH
1533 #
1534 # Revision 1.104.2.11  2002/07/30 19:38:11  hal9
1535 # Add redhat-test target for testing purposes only. Fix RPM_PACKAGEV to what
1536 # *I think* it was supposed to be (was breaking upload targets since it was
1537 # set to RPM_VERSION).
1538 #
1539 # Revision 1.104.2.10  2002/07/27 22:56:53  kick_
1540 # cleanups of the redhat-srpm target
1541 #
1542 # Revision 1.104.2.9  2002/07/26 15:17:02  oes
1543 # - Added generation of default.action from defaul.action.master
1544 # - Deleted obsolete re_filterfile.txt generation
1545 #
1546 # Revision 1.104.2.8  2002/07/12 10:04:32  kick_
1547 # added helper targets to the makefile. They shouldn't break anything, but
1548 # make my life a lot easier.
1549 #
1550 # The new rpm has been splitted into two parts, one for package installation/
1551 # removal, one for package building.
1552 # Therefore rpm -ta isn't a valid command anymore and needs to be replaced
1553 # by rpmbuild -ta  (this is backwards compatible)
1554 #
1555 # Revision 1.104.2.7  2002/06/07 00:23:47  hal9
1556 # Fixing a quirk of man2html (on my system) that pulls punctuation into URLs,
1557 # thus breaking them completely.
1558 #
1559 # Revision 1.104.2.6  2002/06/02 03:26:25  hal9
1560 # Update CONFIG_FILES (ie update basic.action, etc), and also DOC_FILES (exclude
1561 # index.html and team/index.html)
1562 #
1563 # Revision 1.104.2.5  2002/05/30 15:35:01  hal9
1564 # This is more cleanup on the make config-file target. Most issues for
1565 # automatic generation are taken care of. There are still some problems
1566 # that require hand editing. Namely, some of the examples that are > 80 chars.
1567 #
1568 # Revision 1.104.2.4  2002/05/29 02:12:17  hal9
1569 # Ooops...forgot about perl -pi cygwin problem. Add -pi.bak. Also, the
1570 # new target is 'make config-file', _not_ make config.
1571 #
1572 # Revision 1.104.2.3  2002/05/29 02:05:48  hal9
1573 # 'make config' target added (WIP) for future generation of config file from
1574 # text in u-m so the two are in sync. New generated config, which requires
1575 # some hand editing for the time being.
1576 #
1577 # Revision 1.104.2.2  2002/05/28 02:32:55  hal9
1578 # New target 'make dok-index' for privoxy-index.html. Also, fixed *.bak files
1579 # not being cleaned up in doc/webserver.
1580 #
1581 # Revision 1.104.2.1  2002/05/26 17:19:34  hal9
1582 # Remove Table of Contents from readme with oes's dsl trick.
1583 #
1584 # Revision 1.104  2002/05/24 00:03:49  oes
1585 # Use p_doc.css for the Homepage for consistency
1586 #
1587 # Revision 1.103  2002/05/23 23:19:00  oes
1588 # Use dsl without TOC for the homepage
1589 #
1590 # Revision 1.102  2002/05/16 01:20:17  hal9
1591 # make announce target added.
1592 #
1593 # Revision 1.101  2002/05/15 12:28:46  oes
1594 # Trying to keep Hal happy :)
1595 #
1596 # Revision 1.100  2002/05/08 13:48:18  hal9
1597 # Ooops, that trashed JB v2.0.2 comment. Fixed.
1598 #
1599 # Revision 1.99  2002/05/08 13:42:07  hal9
1600 # This fixes the numbering problem on index.html in contact info section (.1.). Using
1601 # perl, since its way too convoluted to try to fix proper with docbook.
1602 #
1603 # Revision 1.98  2002/05/03 14:33:06  oes
1604 # Replaced ldp(OK).dsl handling with generation via autoconf; handle all file exeptions to src tarball via find
1605 #
1606 # Revision 1.97  2002/04/27 20:27:43  swa
1607 # no longer needed due to new
1608 # PACKAGE_VERSION process
1609 #
1610 # Revision 1.96  2002/04/27 17:44:32  morcego
1611 # - Correcting typo in my name (Rodrigo, not Rodgrigo) :-)
1612 # - Using the RM macro everywhere rm is called (either we use, or don't)
1613 # - Same for RPM
1614 #
1615 # Revision 1.95  2002/04/27 15:37:25  swa
1616 # replacing directory in document creation process
1617 # no longer necessary.
1618 #
1619 # Revision 1.94  2002/04/27 08:23:29  swa
1620 # pdf process reviewed and cleaned up
1621 #
1622 # Revision 1.93  2002/04/27 04:55:53  morcego
1623 # privoxy-cl.spec now gets removed by clobber target
1624 #
1625 # Revision 1.92  2002/04/27 04:53:40  morcego
1626 # Adding --exclude "PACKAGERS" to every tar command that applies (not for
1627 #   webserver target)
1628 #
1629 # Revision 1.91  2002/04/27 04:44:51  morcego
1630 # GNUmakefile.in: The tarball created on redhat-dist and suse-dist now ignore
1631 #   the PACKAGERS file, as well privoxy-cl.spec (in case it was created)
1632 # GNUmakefile.in: New targets -> conectiva-spec, conectiva-dist and
1633 #   conectiva-upload
1634 # genclspec.sh  : New file to generate, from privoxy-rh.spec, a specfile
1635 #   for Conectiva Linux
1636 #
1637 # Revision 1.90  2002/04/26 17:46:53  swa
1638 # be consistent
1639 #
1640 # Revision 1.89  2002/04/26 17:20:54  swa
1641 # just produce single html files to proces them later with Destiller or somesuch. looks prettier.
1642 #
1643 # Revision 1.88  2002/04/25 19:13:57  morcego
1644 # Removed RPM release number declaration on configure.in
1645 # Changed makefile to use given value for RPM_PACKAGEV when on uploading
1646 # targets (will produce an error, explaining who to do it, if no value
1647 # if provided).
1648 #
1649 # Revision 1.87  2002/04/23 14:10:59  swa
1650 # now create pdf documents
1651 #
1652 # Revision 1.86  2002/04/15 04:30:27  hal9
1653 # Missed two -pi.bak's on perl/cygwin problem.
1654 #
1655 # Revision 1.85  2002/04/14 01:05:34  hal9
1656 # Revert dok-webserver change for SF logo.
1657 #
1658 # Revision 1.84  2002/04/13 22:43:25  hal9
1659 # -Fix dok-webserver for SF logo (more perl).
1660 # -Change all perl -pi to perl -pi.bak for Cygwin problem.
1661 #
1662 # Revision 1.83  2002/04/12 09:39:25  oes
1663 # Excluding yet more files from tarball; making dist warning yet more scary
1664 #
1665 # Revision 1.82  2002/04/11 21:07:11  oes
1666 # Excluding more files from tarball build
1667 #
1668 # Revision 1.81  2002/04/11 14:40:27  oes
1669 # Fixed typo -- Thanks, Moritz!
1670 #
1671 # Revision 1.80  2002/04/11 12:50:00  oes
1672 # Fixed tarball-dist target
1673 #
1674 # Revision 1.79  2002/04/11 06:49:28  oes
1675 # webserver target: silenced timestamp warnings resulting from uploading westwards, made permissions fixing independant of screwed local dir permissions, suppress (false alarm) make error if not owner of feedback log
1676 #
1677 # Revision 1.78  2002/04/09 13:37:11  sarantis
1678 # fix tar options typo
1679 #
1680 # Revision 1.77  2002/04/09 13:28:53  swa
1681 # build suse and gen-dist with html docs
1682 #
1683 # Revision 1.76  2002/04/08 22:43:41  oes
1684 # Fix: Include dotfiles in fixing webserver permissions
1685 #
1686 # Revision 1.75  2002/04/08 22:14:59  oes
1687 # Silencing tar warnings in the web* targets
1688 #
1689 # Revision 1.74  2002/04/08 15:22:44  hal9
1690 # This has finishing touches for dok building. Should be ready to go.
1691 # -The main doc build is now 'make dok', should work on Redhat too.
1692 # -Removed man page from main doc build. It is built separately due to
1693 #  perl scripts that most aren't likely to have.
1694 #
1695 # Revision 1.73  2002/04/08 14:03:24  oes
1696 # oes for al: Fix install target
1697 #
1698 # Revision 1.72  2002/04/08 13:42:11  oes
1699 # Added safety check to *-dist targets; fixed permissions for feedback logfile
1700 #
1701 # Revision 1.71  2002/04/07 20:32:03  hal9
1702 # -Add meta data kludge for make dok-webserver via $(PERL).
1703 # -Add subdirs for 'make dok-release'.
1704 #
1705 # Revision 1.70  2002/04/07 08:59:40  swa
1706 # generated files. do NOT edit.
1707 # fixed directory bug in makefile.
1708 #
1709 # Revision 1.69  2002/04/07 08:10:47  swa
1710 # create some of the webserver docs
1711 # automatically (in particular if
1712 # those docs recycle other documentation
1713 # fragments). Now committed webserver's
1714 # index file.
1715 #
1716 # Revision 1.68  2002/04/07 07:58:11  swa
1717 # create some of the webserver docs
1718 # automatically (in particular if
1719 # those docs recycle other documentation
1720 # fragments)
1721 #
1722 # Revision 1.67  2002/04/07 05:31:42  hal9
1723 # Add 'dok-release' target:
1724 # -Set doc entities to VERSION and CODE_STATUS during make.
1725 # -Set doc conditional content flags (stable vs non-stable).
1726 # A separate target for the time being but needs to be incorporated into
1727 # dok build at some point.
1728 # -Filter out a spurious ^G from new man page > html converion in man2html.
1729 #
1730 # Revision 1.66  2002/04/06 20:28:21  jongfoster
1731 # Prettifying groff2html.
1732 # Using GNU Make's conditional makefile feature rather than shell "if"s.
1733 # (The shell "if"s were hiding errors)
1734 # "perl" -> "$(PERL)"
1735 # Spaces->tabs in a couple of places.
1736 #
1737 # Revision 1.65  2002/04/06 05:16:39  hal9
1738 # -Add 'authors' and 'man' targets for AUTHORS and man-page (WIP).
1739 # -Both of these will soon be generated files.
1740 #
1741 # Revision 1.64  2002/04/04 22:14:51  oes
1742 # No longer rely on find honoring -iname
1743 #
1744 # Revision 1.63  2002/04/04 21:06:22  swa
1745 # cosmetics.
1746 #
1747 # Revision 1.62  2002/04/04 20:49:50  swa
1748 # attempt to consolidate the
1749 # different dokbook versions.
1750 #
1751 # Revision 1.61  2002/04/04 19:18:21  swa
1752 # readme was leftover directory. use w3m instead
1753 # of lynx to be consistent among developers. use
1754 # consistent target naming.
1755 #
1756 # Revision 1.60  2002/04/04 12:25:41  oes
1757 # Tidy webserver upload w/o *~ files, CVS dirs and logfiles and with proper dir and file permissions
1758 #
1759 # Revision 1.59  2002/04/04 08:32:45  swa
1760 # wrong name for tarball-dist target. further fixed content of tarball dist
1761 #
1762 # Revision 1.58  2002/04/04 06:32:58  hal9
1763 # New dok targets for make readme.
1764 #
1765 # Revision 1.57  2002/04/04 00:36:36  gliptak
1766 # always use pcre for matching
1767 #
1768 # Revision 1.56  2002/04/03 22:28:03  gliptak
1769 # Removed references to gnu_regex
1770 #
1771 # Revision 1.55  2002/04/03 19:54:29  swa
1772 # freebsd tested to work. attempt to move tarball dist target forward
1773 #
1774 # Revision 1.54  2002/04/03 14:54:07  oes
1775 # Standard clean and clobber semantics II
1776 #
1777 # Revision 1.53  2002/04/03 14:19:16  oes
1778 # Standard clean and clobber semantics
1779 #
1780 # Revision 1.52  2002/04/03 02:56:18  hal9
1781 # Revert previous FAQ numbering kludge.
1782 #
1783 # Revision 1.51  2002/04/02 13:03:56  oes
1784 # Added fix for webserver permissions
1785 #
1786 # Revision 1.50  2002/04/02 03:46:24  hal9
1787 # Rewrite ldpOK.dsl so that sections are NOT numbered on FAQ, in an effort
1788 # to make the Table of Contents not so 'busy' looking. SuSE needs testing :)
1789 #
1790 # Revision 1.49  2002/03/30 22:20:12  swa
1791 # cd didn't work. neither did find.
1792 #
1793 # Revision 1.48  2002/03/30 19:04:06  swa
1794 # people release differently. no good.
1795 # I want to make parts of the docs only.
1796 #
1797 # Revision 1.47  2002/03/30 09:05:21  swa
1798 # better packaging. better rpm building.
1799 # tar failed on sun (no exclude there).
1800 #
1801 # Revision 1.46  2002/03/29 20:09:01  swa
1802 # al's patch
1803 #
1804 # Revision 1.45  2002/03/29 19:45:45  swa
1805 # for lazy swa
1806 #
1807 # Revision 1.44  2002/03/29 17:42:44  gliptak
1808 # Correcting for Solaris tar limitations
1809 #
1810 # Revision 1.43  2002/03/29 07:40:03  swa
1811 # fixed make webserver. doh
1812 #
1813 # Revision 1.42  2002/03/29 06:59:04  swa
1814 # other users could not modify files on webserver
1815 #
1816 # Revision 1.41  2002/03/28 20:43:00  swa
1817 # set make correctly
1818 #
1819 # Revision 1.40  2002/03/28 04:22:44  hal9
1820 # More on man2html stuff.
1821 #
1822 # Revision 1.39  2002/03/28 01:04:14  hal9
1823 # More man2html stuff for docs.
1824 #
1825 # Revision 1.38  2002/03/27 16:02:30  swa
1826 # have a generic target
1827 #
1828 # Revision 1.37  2002/03/27 15:30:26  swa
1829 # have a consistent appearance
1830 #
1831 # Revision 1.36  2002/03/27 14:58:08  swa
1832 # can be used by mutilple targets
1833 #
1834 # Revision 1.35  2002/03/27 14:53:19  swa
1835 # added solaris-dist
1836 #
1837 # Revision 1.34  2002/03/27 10:30:11  swa
1838 # we want a html man file on the webserver
1839 #
1840 # Revision 1.33  2002/03/27 03:05:35  hal9
1841 # Added man2html target for docs (redhat-dok only for now)
1842 #
1843 # Revision 1.32  2002/03/26 22:29:54  swa
1844 # we have a new homepage!
1845 #
1846 # Revision 1.31  2002/03/26 14:00:18  swa
1847 # fixed make tarball, tarball-dist, tarball-clean
1848 #
1849 # Revision 1.30  2002/03/25 12:52:25  swa
1850 # new targets
1851 #
1852 # Revision 1.29  2002/03/24 17:03:55  jongfoster
1853 # Name change
1854 #
1855 # Revision 1.28  2002/03/24 16:19:48  swa
1856 # configure needs to be generated.
1857 #
1858 # Revision 1.27  2002/03/24 16:13:57  swa
1859 # generated files are a nono in cvs
1860 #
1861 # Revision 1.26  2002/03/24 15:36:02  swa
1862 # did not build.
1863 #
1864 # Revision 1.25  2002/03/24 14:31:08  swa
1865 # remove more crappy files. set RPM
1866 # release version correctly.
1867 #
1868 # Revision 1.24  2002/03/24 14:19:55  swa
1869 # set rpm package release in configure.in. nowhere else.
1870 #
1871 # Revision 1.23  2002/03/24 13:06:49  swa
1872 # suse-clean now runs fine
1873 #
1874 # Revision 1.22  2002/03/24 12:56:21  swa
1875 # name change related issues.
1876 #
1877 # Revision 1.21  2002/03/24 12:43:57  swa
1878 # name change
1879 #
1880 # Revision 1.20  2002/03/24 11:39:17  jongfoster
1881 # Renaming config files
1882 #
1883 # Revision 1.19  2002/03/22 20:53:03  morcego
1884 # - Ongoing process to change name to JunkbusterNG
1885 # - configure/configure.in: no change needed
1886 # - GNUmakefile.in:
1887 #         - TAR_ARCH = /tmp/JunkbusterNG-$(RPM_VERSION).tar.gz
1888 #         - PROGRAM    = jbng@EXEEXT@
1889 #         - rh-spec now references as junkbusterng-rh.spec
1890 #         - redhat-upload: references changed to junkbusterng-* (package names)
1891 #         - tarball-dist: references changed to JunkbusterNG-distribution-*
1892 #         - tarball-src: now JunkbusterNG-*
1893 #         - install: initscript now junkbusterng.init and junkbusterng (when
1894 #                    installed)
1895 # - junkbuster-rh.spec: renamed to junkbusterng-rh.spec
1896 # - junkbusterng.spec:
1897 #         - References to the expression ijb where changed where possible
1898 #         - New package name: junkbusterng (all in lower case, acording to
1899 #           the LSB recomendation)
1900 #         - Version changed to: 2.9.13
1901 #         - Release: 1
1902 #         - Added: junkbuster to obsoletes and conflicts (Not sure this is
1903 #           right. If it obsoletes, why conflict ? Have to check it later)
1904 #         - Summary changed: Stefan, please check and aprove it
1905 #         - Changes description to use the new name
1906 #         - Sed string was NOT changed. Have to wait to the manpage to
1907 #           change first
1908 #         - Keeping the user junkbuster for now. It will require some aditional
1909 #           changes on the script (scheduled for the next specfile release)
1910 #         - Added post entry to move the old logfile to the new log directory
1911 #         - Removing "chkconfig --add" entry (not good to have it automaticaly
1912 #           added to the startup list).
1913 #         - Added preun section to stop the service with the old name, as well
1914 #           as remove it from the startup list
1915 #         - Removed the chkconfig --del entry from the conditional block on
1916 #           the preun scriptlet (now handled on the %files section)
1917 # - junkbuster.init: renamed to junkbusterng.init
1918 # - junkbusterng.init:
1919 #         - Changed JB_BIN to jbng
1920 #         - Created JB_OBIN with the old value of JB_BIN (junkbuster), to
1921 #           be used where necessary (config dir)
1922 #
1923 # Aditional notes:
1924 # - The config directory is /etc/junkbuster yet. Have to change it on the
1925 # specfile, after it is changes on the code
1926 # - The only files that got renamed on the cvs tree were the rh specfile and
1927 # the init file. Some file references got changes on the makefile and on the
1928 # rh-spec (as listed above)
1929 #
1930 # Revision 1.18  2002/03/21 23:00:00  swa
1931 # want to autogenerate stuff.
1932 #
1933 # Revision 1.17  2002/03/19 19:30:04  morcego
1934 # - Fixing stylesheet checking on configure. If it is found, no further checks
1935 #   should be done
1936 #
1937 # - configure will now check for db2html or docbook2html (should work now
1938 #   on SuSe without the docbktls package)
1939 #
1940 # Revision 1.16  2002/03/14 22:32:32  hal9
1941 # Bumped the RPM version.
1942 #
1943 # Revision 1.15  2002/03/08 20:00:28  swa
1944 # some leftovers.
1945 #
1946 # Revision 1.14  2002/03/07 18:25:56  swa
1947 # synced redhat and suse build process
1948 #
1949 # Revision 1.13  2002/03/07 17:17:56  oes
1950 # (Hopefully) fixed for older make versions
1951 #
1952 # Revision 1.12  2002/03/07 15:28:27  swa
1953 # more informative
1954 #
1955 # Revision 1.11  2002/03/06 14:33:18  sarantis
1956 # Use proper temp file, not "abc".
1957 #
1958 # Revision 1.10  2002/03/06 14:19:35  sarantis
1959 # Cleanup PID_FILE_PATH from redhat-dist target
1960 #
1961 # Revision 1.9  2002/03/05 17:31:11  morcego
1962 # Search for docbook.dsl. Should solve portability problems for SuSe.
1963 #
1964 # Revision 1.8  2002/03/05 14:07:42  morcego
1965 # configure now detects rpm topdir, and change GNUmakefile acordingly
1966 #    (based on sugestion by Sarantis Paskalis)
1967 #
1968 # Revision 1.7  2002/03/05 13:43:28  morcego
1969 # Checking for text browser, so redhat-dok can work.
1970 #
1971 # Revision 1.6  2002/03/05 13:10:51  morcego
1972 # Changes to implement redhat-dok (Hal Burgiss)
1973 # Changes to make it work on other distros and out-of-the-shelf configurations
1974 #
1975 # Revision 1.5  2002/02/27 15:30:39  hal9
1976 # Reset $(RPM_PACKAGEV) to 1 (was 2)
1977 #
1978 # Revision 1.4  2002/01/17 21:44:04  jongfoster
1979 # Adding urlmatch.[ch]
1980 #
1981 # Revision 1.3  2002/01/04 15:26:08  oes
1982 # Added tarball-src target
1983 #
1984 # Revision 1.2  2001/12/30 14:07:31  steudten
1985 # - Add signal handling (unix)
1986 # - Add SIGHUP handler (unix)
1987 # - Add creation of pidfile (unix)
1988 # - Add action 'top' in rc file (RH)
1989 # - Add entry 'SIGNALS' to manpage
1990 # - Add exit message to logfile (unix)
1991 #
1992 # Revision 1.1  2001/12/01 11:22:57  jongfoster
1993 # Renaming Makefile.in to GNUmakefile.in so that non-GNU versions of
1994 # make break in a more obvious way.
1995 # Adding .PHONY section.
1996 #
1997 # Revision 1.40  2001/12/01 00:24:11  jongfoster
1998 # Renaming various config files
1999 # Fixing CR->CRLF under Win32 (I hope)
2000 #
2001 # Revision 1.39  2001/11/06 12:07:30  steudten
2002 # Add --clean for building rpm in target redhat-dist.
2003 #
2004 # Revision 1.38  2001/11/05 21:35:23  steudten
2005 # Complete rewrite for the 'redhat-dist' target.
2006 # Checks for writeable RPM build directories for calling user.
2007 # So you must not be root, just set the modes to 1777 to
2008 # build a RH package.
2009 # Fix the upload-target to be arch independant.
2010 # Add target for 'solaris-dist' - coming soon.
2011 #
2012 # Revision 1.37  2001/11/01 00:52:04  hal9
2013 # Redhat-upload stuff per Stefan.
2014 #
2015 # Revision 1.36  2001/10/31 19:26:13  swa
2016 # automate process of uploading new releases
2017 # to sf.
2018 #
2019 # Revision 1.35  2001/10/15 22:14:59  joergs
2020 # Removed -O2 and -Wall from AmigaOS-only CFLAGS since they are now in
2021 #  the general CFLAGS already.
2022 #
2023 # Revision 1.34  2001/10/15 18:28:06  steudten
2024 # remove config.cache for target clobber.
2025 # Cleanup make dist for RH and S.u.S.E.
2026 #
2027 # Revision 1.33  2001/10/10 12:43:33  oes
2028 # Added ugly hack to make install target work at least for some setups.
2029 #
2030 # Revision 1.32  2001/10/09 22:38:19  jongfoster
2031 # Correcting actionsfile filename for Win32 INI build
2032 #
2033 # Revision 1.31  2001/09/23 10:13:48  swa
2034 # upload process established. run make webserver and
2035 # the documentation is moved to the webserver. documents
2036 # are now linked correctly.
2037 #
2038 # Revision 1.30  2001/09/19 17:55:49  oes
2039 # Fixed CFLAGS
2040 #
2041 # Revision 1.29  2001/09/16 17:34:27  jongfoster
2042 # Removing showargs.[ch], adding cgi(simple|edit).[ch]
2043 # Replacing $(OBJEXT) with @OBJEXT@ - this seems to be a common source
2044 # of build problems.
2045 #
2046 # Revision 1.28  2001/09/13 15:19:08  swa
2047 # we want text files as well.
2048 #
2049 # Revision 1.27  2001/09/13 13:11:37  steudten
2050 #
2051 # Replace DEBUG_CFLAGS with OTHER_CFLAGS
2052 #
2053 # Revision 1.26  2001/09/12 23:44:54  david__schmidt
2054 # Mac OSX (Darwin) support added.
2055 #
2056 # Revision 1.25  2001/09/12 22:55:45  joergs
2057 # AmigaOS support added.
2058 #
2059 # Revision 1.24  2001/09/12 17:28:59  david__schmidt
2060 #
2061 # OS/2 port: update autoconf'd support for the platform.
2062 #
2063 # Revision 1.23  2001/09/12 16:28:42  swa
2064 # added "make dok" section to generate html pages from
2065 # the sgml source documents. note that the we do not want
2066 # generated stuff in cvs.
2067 #
2068 # Revision 1.22  2001/09/10 16:31:23  swa
2069 # buildroot definition in the specfile fucks up the build
2070 # process under suse. hence I moved it to the "rpm -ta"
2071 # command
2072 #
2073 # Revision 1.21  2001/09/10 11:12:49  oes
2074 # Turning on -Wall
2075 #
2076 # Revision 1.20  2001/08/02 22:04:29  jongfoster
2077 # Removing some remaining references to obsolete w32rulesdlg.[ch]
2078 #
2079 # Revision 1.19  2001/07/30 22:14:03  jongfoster
2080 # Removing obsolete w32rulesdlg.c and w32rulesdlg.h
2081 #
2082 # Revision 1.18  2001/07/29 17:09:17  jongfoster
2083 # Major changes to build system in order to fix these bugs:
2084 # - pthreads under Linux was broken - changed -lpthread to -pthread
2085 # - Compiling in MinGW32 mode under CygWin now correctly detects
2086 #   which shared libraries are available
2087 # - Solaris support (?) (Not tested under Solaris yet)
2088 #
2089 # Revision 1.17  2001/07/28 16:44:54  oes
2090 # Fixed sed LF->CRLF conversion and removed deprecated files
2091 #
2092 # Revision 1.16  2001/07/15 19:45:33  jongfoster
2093 # Added support for linking with POSIX threads library
2094 #
2095 # Revision 1.15  2001/07/13 13:48:07  oes
2096 #  - Moved STATIC #define for pcre to (ac)config.h
2097 #  - Made -Ipcre depandant on static pcre compilation to
2098 #    avoid version conflicts
2099 #  - Included compilation and depandancies for new deanimate.c
2100 #  - Made changes to the pcre/pcreposix/pcrs build process
2101 #    as required by the new library autodetection in
2102 #    configure.in
2103 #
2104 # Revision 1.14  2001/07/01 16:27:44  oes
2105 # Fixed misplaced dependancy
2106 #
2107 # Revision 1.13  2001/06/29 13:18:36  oes
2108 # - added depandancy of filters.o on cgi.h
2109 #
2110 # Revision 1.12  2001/06/12 17:15:56  swa
2111 # fixes, because a clean build on rh6.1 was impossible.
2112 # GZIP confuses make, %configure confuses rpm, etc.
2113 #
2114 # Revision 1.11  2001/06/11 11:26:35  sarantis
2115 # RPM version should be the same as ijbswa version.  The rpm release is
2116 # specified in the specfile.
2117 #
2118 # Revision 1.10  2001/06/07 17:27:45  swa
2119 # added suse build section
2120 #
2121 # Revision 1.9  2001/06/04 18:31:58  swa
2122 # files are now prefixed with either `confdir' or `logdir'.
2123 # `make redhat-dist' replaces both entries confdir and logdir
2124 # with redhat values
2125 #
2126 # Revision 1.8  2001/06/04 10:44:57  swa
2127 # `make redhatr-dist' now works. Except for the paths
2128 # in the config file.
2129 #
2130 # Revision 1.7  2001/06/03 17:09:09  swa
2131 # swa for oes: reversed my earlier change
2132 #
2133 # Revision 1.6  2001/06/03 17:07:27  swa
2134 # swa for oes
2135 #
2136 # Revision 1.5  2001/06/03 13:57:26  swa
2137 # compile cgi.c (for andreas' GUI)
2138 #
2139 # Revision 1.4  2001/05/31 21:18:45  jongfoster
2140 # Added files actions.[ch], actionlist.h, list.[ch] to Makefile
2141 #
2142 # Revision 1.3  2001/05/29 20:02:48  joergs
2143 # Changes for AmigaOS added.
2144 #
2145 # Revision 1.2  2001/05/17 22:23:23  oes
2146 #  - Added auto-generation of CRLFs for Win32 config files
2147 #  - Added comment-prefix to all Win32-only options in the config file
2148 #    and provided auto stripping of this prefix for the Win32 platform by make
2149 #
2150 # Revision 1.1.1.1  2001/05/15 13:59:00  oes
2151 # Initial import of version 2.9.3 source tree
2152 #
2153 #