1618ef5d72419511b2e5eedee90ff711987596a5
[privoxy.git] / Makefile
1 # $Id: Makefile,v 1.7 2002/10/22 02:22:18 hal9 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.7  2002/10/22 02:22:18  hal9
30 # Look for gmake first, and fall back to make. More Solaris trouble.
31 #
32 # Revision 1.6  2002/09/05 14:35:17  oes
33 # Change make to gmake to fix auto-build on Solaris
34 #
35 # Revision 1.5  2002/04/11 12:51:34  oes
36 # Bugfix
37 #
38 # Revision 1.4  2002/04/09 16:38:10  oes
39 # Added option to run the whole build process
40 #
41 # Revision 1.3  2002/03/26 22:29:54  swa
42 # we have a new homepage!
43 #
44 # Revision 1.2  2002/03/24 13:25:42  swa
45 # name change related issues
46 #
47 # Revision 1.1  2001/12/01 11:24:29  jongfoster
48 # Will display a warning if non-GNU make is used
49 #
50 #
51
52 #############################################################################
53
54 # This script will first try to use the GNU make command, then the standard
55 # make command, checking whether the command returns 'GNU' as part of its
56 # version string. Amend this to point to your GNU make command if it is
57 # not in your path.
58 # Further tests; Solaris 'make' sets the HOST_ARCH variable, GNU  'make'
59 # sets the MAKE_VERSION variable, so a test is made that the former is
60 # non-zero and the latter is zero, if so we bail out with an error message.
61
62
63 GNU_MAKE_CMD = gmake
64 MAKE_CMD     = make
65
66 error:
67         @if [ -f GNUmakefile ]; then \
68             echo "***"; \
69             echo "*** You are not using the GNU version of Make - maybe it's called gmake"; \
70             echo "*** or it's in a different directory?"; \
71             echo "***"; \
72             exit 1; \
73          elif test -n "$(HOST_ARCH)"  && test -z "$(MAKE_VERSION)" ; then \
74             echo "***"; \
75             echo "*** You are not using GNU Make on Solaris, please make sure you do" ; \
76             echo "*** and re-run 'make' "; \
77             echo "***"; \
78             exit 1 ; \
79          else \
80             echo "***"; \
81             echo "*** To build this program, you must run"; \
82             echo "*** autoheader && autoconf && ./configure and then run GNU make."; \
83             echo "***"; \
84             echo -n "*** Shall I do this for you now? (y/n) "; \
85             read answer; \
86             if [ $$answer = "y" ]; then \
87                 autoheader && autoconf && ./configure || exit 1; \
88                 if $(GNU_MAKE_CMD) -v |grep GNU >/dev/null 2>/dev/null; then \
89                    $(GNU_MAKE_CMD) ;\
90                 elif $(MAKE_CMD) -v |grep GNU >/dev/null 2>/dev/null; then \
91                    $(MAKE_CMD) ;\
92                 else \
93                    echo "Neither 'make' nor 'gmake' are GNU compatible!" ; \
94                    exit 1 ; \
95                 fi ;\
96             fi; \
97          fi
98
99 .PHONY: error
100
101
102 #############################################################################
103
104 ## Local Variables:
105 ## tab-width: 3
106 ## end: