1 ##########################################################################
3 # Written by and Copyright (C) 2002-2018 the Privoxy team.
4 # https://www.privoxy.org/
6 # This script originally written by and Copyright (C) 2002
9 # This program is free software; you can redistribute it
10 # and/or modify it under the terms of the GNU General
11 # Public License as published by the Free Software
12 # Foundation; either version 2 of the License, or (at
13 # your option) any later version.
15 # This program is distributed in the hope that it will
16 # be useful, but WITHOUT ANY WARRANTY; without even the
17 # implied warranty of MERCHANTABILITY or FITNESS FOR A
18 # PARTICULAR PURPOSE. See the GNU General Public
19 # License for more details.
21 # The GNU General Public License should be included with
22 # this file. If not, you can view it at
23 # http://www.gnu.org/copyleft/gpl.html
24 # or write to the Free Software Foundation, Inc., 59
25 # Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 ##########################################################################
30 ##########################################################################
32 ##########################################################################
39 AUTOHEADER = autoheader
41 # Program to copy a directory from a web site to the local disk.
42 WEBMIRROR = $(WGET) -nv -nH -nd -N -r -np
44 # Program to do LF->CRLF
46 # The sed version should be the most portable, but it doesn't work for me,
47 # the other two do. FIXME.
50 DOSFILTER = $(SED) -e $$'s,$$,\r,'
51 #DOSFILTER = $(AWK) -v ORS='\r\n' '{print $0;}'
52 #DOSFILTER = $(PERL) -p -e 's/\n/\r\n/'
55 # MAKENSIS = ./nsis/nsis-2.30.exe
56 MAKENSIS = /source/nsis-3.03/makensis.exe
59 ##########################################################################
61 ##########################################################################
63 # Directory containing the source code
66 # Directory to build an image of the installed file system in.
69 # The name of the EXE installer (must match the name specified in
71 TARGET=privoxy_setup.exe
73 # The NSIS script that generates the installer.
74 NSIFILE=privoxy_winthreads.nsi
77 ##########################################################################
79 ##########################################################################
83 winbuild: $(DEST)/privoxy.exe templates inifiles doc webdoc
86 rm -rf $(DEST) $(TARGET)
89 rm -f $(TARGET) $(SOURCE)/privoxy.exe
91 .PHONY: winrelease winbuild clean
94 $(TARGET): $(NSIFILE) winbuild
106 $(DEST)/%.txt: $(SOURCE)/% $(DEST)
107 $(DOSFILTER) < $< > $@
110 inifiles: $(DEST)/config.txt $(DEST)/match-all.action $(DEST)/default.action $(DEST)/user.action \
111 $(DEST)/default.filter $(DEST)/trust.txt $(DEST)/user.filter
114 $(DEST)/config.txt: $(SOURCE)/config $(DEST)
115 $(SED) -e 's!trustfile trust!trustfile trust.txt!' \
116 -e 's!logfile logfile!logfile privoxy.log!' \
117 -e 's!#user-manual http://www.privoxy.org/user-manual/!user-manual ./doc/user-manual/!' \
118 -e 's!#Win32-only: !!' \
122 $(DEST)/match-all.action: $(SOURCE)/match-all.action $(DEST)
123 $(DOSFILTER) < $< > $@
125 $(DEST)/default.action: $(SOURCE)/default.action $(DEST)
126 $(DOSFILTER) < $< > $@
128 $(DEST)/user.action: $(SOURCE)/user.action $(DEST)
129 $(DOSFILTER) < $< > $@
131 $(DEST)/default.filter: $(SOURCE)/default.filter $(DEST)
132 $(DOSFILTER) < $< > $@
134 $(DEST)/user.filter: $(SOURCE)/user.filter $(DEST)
135 $(DOSFILTER) < $< > $@
137 $(DEST)/privoxy.exe: $(SOURCE)/privoxy.exe $(DEST)
140 $(SOURCE)/configure: $(SOURCE)/configure.in
141 cd $(SOURCE) && $(AUTOCONF)
143 $(SOURCE)/config.h.in: $(SOURCE)/configure $(SOURCE)/acconfig.h
144 cd $(SOURCE) && $(AUTOHEADER)
146 $(SOURCE)/config.h: $(SOURCE)/configure $(SOURCE)/config.h.in
149 $(SOURCE)/privoxy.exe: $(SOURCE)/configure $(SOURCE)/config.h
150 cd $(SOURCE) && $(MAKE) clean
151 cd $(SOURCE) && $(MAKE)
154 templates: $(patsubst $(SOURCE)/%,$(DEST)/%,$(wildcard $(SOURCE)/templates/*))
156 $(DEST)/templates/%: $(SOURCE)/templates/% $(DEST)/templates
157 if test -f $< ; then $(DOSFILTER) < $< > $@ ; fi
160 doc: $(DEST)/AUTHORS.txt $(DEST)/README.txt $(DEST)/LICENSE.txt
162 webdoc: $(DEST)/doc/developer-manual $(DEST)/doc/faq $(DEST)/doc/user-manual
163 cp $(SOURCE)/doc/webserver/p_doc.css $(DEST)/doc
164 cp $(SOURCE)/doc/webserver/p_doc.css $(DEST)/doc/user-manual/
167 $(DEST)/doc/%.txt : $(SOURCE)/doc/text/%.txt $(DEST)/doc
168 $(DOSFILTER) < $< > $@
170 $(DEST)/doc/developer-manual: $(DEST)/doc $(SOURCE)/doc/webserver/developer-manual/index.html
171 test -d $(DEST)/doc/developer-manual || mkdir $(DEST)/doc/developer-manual
172 cp $(SOURCE)/doc/webserver/developer-manual/*.html $(DEST)/doc/developer-manual/
174 $(DEST)/doc/user-manual: $(DEST)/doc $(SOURCE)/doc/webserver/user-manual/index.html
175 test -d $(DEST)/doc/user-manual || mkdir $(DEST)/doc/user-manual
176 cp $(SOURCE)/doc/webserver/user-manual/*.html $(DEST)/doc/user-manual/
177 cp $(SOURCE)/doc/webserver/user-manual/*.jpg $(DEST)/doc/user-manual/
179 $(DEST)/doc/faq: $(DEST)/doc $(SOURCE)/doc/webserver/faq/index.html
180 test -d $(DEST)/doc/faq || mkdir $(DEST)/doc/faq
181 cp $(SOURCE)/doc/webserver/faq/*.html $(DEST)/doc/faq/
183 ##########################################################################
185 ##########################################################################