GNUmakefile 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. ##########################################################################
  2. #
  3. # Written by and Copyright (C) 2002-2018 the Privoxy team.
  4. # https://www.privoxy.org/
  5. #
  6. # This script originally written by and Copyright (C) 2002
  7. # Jonathan Foster
  8. #
  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.
  14. #
  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.
  20. #
  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.
  26. #
  27. ##########################################################################
  28. ##########################################################################
  29. # External programs
  30. ##########################################################################
  31. SED = sed
  32. PERL = perl
  33. AWK = awk
  34. WGET = wget
  35. STRIP = strip
  36. AUTOCONF = autoconf
  37. AUTOHEADER = autoheader
  38. # Program to copy a directory from a web site to the local disk.
  39. WEBMIRROR = $(WGET) -nv -nH -nd -N -r -np
  40. # Program to do LF->CRLF
  41. #
  42. # The sed version should be the most portable, but it doesn't work for me,
  43. # the other two do. FIXME.
  44. # - Jon
  45. #
  46. DOSFILTER = $(SED) -e $$'s,$$,\r,'
  47. #DOSFILTER = $(AWK) -v ORS='\r\n' '{print $0;}'
  48. #DOSFILTER = $(PERL) -p -e 's/\n/\r\n/'
  49. # Path to NSIS
  50. # MAKENSIS = ./nsis/nsis-2.30.exe
  51. MAKENSIS = ./nsis-3.03/makensis.exe
  52. ##########################################################################
  53. # More configuration
  54. ##########################################################################
  55. # Directory containing the source code
  56. SOURCE = ..
  57. # Directory to build an image of the installed file system in.
  58. DEST = ./build
  59. # The name of the EXE installer (must match the name specified in
  60. # the .NSI script)
  61. TARGET=privoxy_setup.exe
  62. # The NSIS script that generates the installer.
  63. NSIFILE=privoxy_winthreads.nsi
  64. ##########################################################################
  65. # Rules
  66. ##########################################################################
  67. winrelease: $(TARGET)
  68. winbuild: $(DEST)/privoxy.exe templates inifiles doc webdoc
  69. clean:
  70. rm -rf $(DEST) $(TARGET)
  71. clobber: clean
  72. rm -f $(TARGET) $(SOURCE)/privoxy.exe
  73. .PHONY: winrelease winbuild clean
  74. $(TARGET): $(NSIFILE) winbuild
  75. $(MAKENSIS) $<
  76. $(DEST):
  77. mkdir $@
  78. $(DEST)/templates:
  79. mkdir $@
  80. $(DEST)/doc:
  81. mkdir $@
  82. $(DEST)/%.txt: $(SOURCE)/% $(DEST)
  83. $(DOSFILTER) < $< > $@
  84. inifiles: $(DEST)/config.txt $(DEST)/match-all.action $(DEST)/default.action $(DEST)/user.action \
  85. $(DEST)/default.filter $(DEST)/trust.txt $(DEST)/user.filter
  86. $(DEST)/config.txt: $(SOURCE)/config $(DEST)
  87. $(SED) -e 's!trustfile trust!trustfile trust.txt!' \
  88. -e 's!logfile logfile!logfile privoxy.log!' \
  89. -e 's!#user-manual http://www.privoxy.org/user-manual/!user-manual ./doc/user-manual/!' \
  90. -e 's!#Win32-only: !!' \
  91. < $< | \
  92. $(DOSFILTER) > $@
  93. $(DEST)/match-all.action: $(SOURCE)/match-all.action $(DEST)
  94. $(DOSFILTER) < $< > $@
  95. $(DEST)/default.action: $(SOURCE)/default.action $(DEST)
  96. $(DOSFILTER) < $< > $@
  97. $(DEST)/user.action: $(SOURCE)/user.action $(DEST)
  98. $(DOSFILTER) < $< > $@
  99. $(DEST)/default.filter: $(SOURCE)/default.filter $(DEST)
  100. $(DOSFILTER) < $< > $@
  101. $(DEST)/user.filter: $(SOURCE)/user.filter $(DEST)
  102. $(DOSFILTER) < $< > $@
  103. $(DEST)/privoxy.exe: $(SOURCE)/privoxy.exe $(DEST)
  104. $(STRIP) -o $@ $<
  105. $(SOURCE)/configure: $(SOURCE)/configure.in
  106. cd $(SOURCE) && $(AUTOCONF)
  107. $(SOURCE)/config.h.in: $(SOURCE)/configure $(SOURCE)/acconfig.h
  108. cd $(SOURCE) && $(AUTOHEADER)
  109. $(SOURCE)/config.h: $(SOURCE)/configure $(SOURCE)/config.h.in
  110. ./MYconfigure
  111. $(SOURCE)/privoxy.exe: $(SOURCE)/configure $(SOURCE)/config.h
  112. cd $(SOURCE) && $(MAKE) clean
  113. cd $(SOURCE) && $(MAKE)
  114. templates: $(patsubst $(SOURCE)/%,$(DEST)/%,$(wildcard $(SOURCE)/templates/*))
  115. $(DEST)/templates/%: $(SOURCE)/templates/% $(DEST)/templates
  116. if test -f $< ; then $(DOSFILTER) < $< > $@ ; fi
  117. doc: $(DEST)/AUTHORS.txt $(DEST)/README.txt $(DEST)/LICENSE.txt
  118. webdoc: $(DEST)/doc/developer-manual $(DEST)/doc/faq $(DEST)/doc/images $(DEST)/doc/user-manual
  119. cp $(SOURCE)/doc/webserver/p_doc.css $(DEST)/doc
  120. cp $(SOURCE)/doc/webserver/p_doc.css $(DEST)/doc/user-manual/
  121. $(DEST)/doc/gpl.html: $(SOURCE)/doc/gpl.html $(DEST)/doc
  122. $(DOSFILTER) < $< > $@
  123. $(DEST)/doc/%.txt : $(SOURCE)/doc/text/%.txt $(DEST)/doc
  124. $(DOSFILTER) < $< > $@
  125. $(DEST)/doc/developer-manual: $(DEST)/doc $(SOURCE)/doc/webserver/developer-manual/index.html
  126. test -d $(DEST)/doc/developer-manual || mkdir $(DEST)/doc/developer-manual
  127. cp $(SOURCE)/doc/webserver/developer-manual/*.html $(DEST)/doc/developer-manual/
  128. $(DEST)/doc/user-manual: $(DEST)/doc $(SOURCE)/doc/webserver/user-manual/index.html
  129. test -d $(DEST)/doc/user-manual || mkdir $(DEST)/doc/user-manual
  130. cp $(SOURCE)/doc/webserver/user-manual/*.html $(DEST)/doc/user-manual/
  131. $(DEST)/doc/faq: $(DEST)/doc $(SOURCE)/doc/webserver/faq/index.html
  132. test -d $(DEST)/doc/faq || mkdir $(DEST)/doc/faq
  133. cp $(SOURCE)/doc/webserver/faq/*.html $(DEST)/doc/faq/
  134. $(DEST)/doc/images: $(DEST)/doc
  135. cp -r $(SOURCE)/doc/webserver/images/ $(DEST)/doc
  136. ##########################################################################
  137. # That's all, folks!
  138. ##########################################################################