Update to recent version as of January 2003.
[privoxy.git] / Makefile
1 # $Id: Makefile,v 1.9 2002/10/23 06:14:09 agotneja Exp $
2 #
3 # Written by and Copyright (C) 2001 the SourceForge
4 # Privoxy team. http://www.privoxy.org/
5 #
6 # Based on the Internet Junkbuster originally written
7 # by and Copyright (C) 1997 Anonymous Coders and 
8 # Junkbusters Corporation.  http://www.junkbusters.com
9 #
10 # This program is free software; you can redistribute it 
11 # and/or modify it under the terms of the GNU General
12 # Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at
14 # your option) any later version.
15 #
16 # This program is distributed in the hope that it will
17 # be useful, but WITHOUT ANY WARRANTY; without even the
18 # implied warranty of MERCHANTABILITY or FITNESS FOR A
19 # PARTICULAR PURPOSE.  See the GNU General Public
20 # License for more details.
21 #
22 # The GNU General Public License should be included with
23 # this file.  If not, you can view it at
24 # http://www.gnu.org/copyleft/gpl.html
25 # or write to the Free Software Foundation, Inc., 59
26 # Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27 #
28 # $Log: Makefile,v $
29 # Revision 1.9  2002/10/23 06:14:09  agotneja
30 # Added FreeBSD checks to stop people from using the default 'make'
31 #
32 # Revision 1.8  2002/10/23 05:41:45  agotneja
33 # Added checks for Solaris 'make' command, and more extensive checks that
34 # the user is running GNU make.
35 #
36 # Revision 1.7  2002/10/22 02:22:18  hal9
37 # Look for gmake first, and fall back to make. More Solaris trouble.
38 #
39 # Revision 1.6  2002/09/05 14:35:17  oes
40 # Change make to gmake to fix auto-build on Solaris
41 #
42 # Revision 1.5  2002/04/11 12:51:34  oes
43 # Bugfix
44 #
45 # Revision 1.4  2002/04/09 16:38:10  oes
46 # Added option to run the whole build process
47 #
48 # Revision 1.3  2002/03/26 22:29:54  swa
49 # we have a new homepage!
50 #
51 # Revision 1.2  2002/03/24 13:25:42  swa
52 # name change related issues
53 #
54 # Revision 1.1  2001/12/01 11:24:29  jongfoster
55 # Will display a warning if non-GNU make is used
56 #
57 #
58
59 #############################################################################
60
61 # This script will first try to use the GNU make command, then the standard
62 # make command, checking whether the command returns 'GNU' as part of its
63 # version string. Amend this to point to your GNU make command if it is
64 # not in your path.
65 # Further tests; 
66 #   GNU  'make' sets the MAKE_VERSION variable
67 #   Solaris 'make' sets the HOST_ARCH variable
68 #   FreeBSD 'make' sets the MACHINE_ARCH variable
69 # We check if this isn't GNU but matches one of the above we error out
70
71 GNU_MAKE_CMD = gmake
72 MAKE_CMD     = make
73
74 error:
75         @if [ -f GNUmakefile ]; then \
76             echo "***"; \
77             echo "*** You are not using the GNU version of Make - maybe it's called gmake"; \
78             echo "*** or it's in a different PATH? Please read INSTALL." ; \
79             echo "***"; \
80             exit 1; \
81          elif test -n "$(HOST_ARCH)"  && test -z "$(MAKE_VERSION)" ; then \
82             echo "***"; \
83             echo "*** You are not using GNU Make on Solaris, please make sure you do" ; \
84             echo "*** and re-run 'make' "; \
85             echo "***"; \
86             exit 1 ; \
87          elif test -n "$(MACHINE_ARCH)"  && test -z "$(MAKE_VERSION)" ; then \
88             echo "***"; \
89             echo "*** You are not using GNU Make on FreeBSD, please make sure you do" ; \
90             echo "*** and re-run 'make' "; \
91             echo "***"; \
92             exit 1 ; \
93          else \
94             echo "***"; \
95             echo "*** To build this program, you must run"; \
96             echo "*** autoheader && autoconf && ./configure and then run GNU make."; \
97             echo "***"; \
98             echo -n "*** Shall I do this for you now? (y/n) "; \
99             read answer; \
100             if [ "$$answer" = "y" ]; then \
101                 autoheader && autoconf && ./configure || exit 1; \
102                 if $(GNU_MAKE_CMD) -v |grep GNU >/dev/null 2>/dev/null; then \
103                    $(GNU_MAKE_CMD) ;\
104                 elif $(MAKE_CMD) -v |grep GNU >/dev/null 2>/dev/null; then \
105                    $(MAKE_CMD) ;\
106                 else \
107                    echo "Neither 'make' nor 'gmake' are GNU compatible!" ; \
108                    echo "Please read INSTALL." ; \
109                    exit 1 ; \
110                 fi ;\
111             fi; \
112          fi
113
114 .PHONY: error
115
116
117 #############################################################################
118
119 ## Local Variables:
120 ## tab-width: 3
121 ## end: