| 1 | @echo off
|
|---|
| 2 | rem Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
|
|---|
| 3 | rem 2004, 2005, 2006 Free Software Foundation, Inc.
|
|---|
| 4 | rem This file is part of GNU Make.
|
|---|
| 5 |
|
|---|
| 6 | rem GNU Make is free software; you can redistribute it and/or modify it under
|
|---|
| 7 | rem the terms of the GNU General Public License as published by the Free
|
|---|
| 8 | rem Software Foundation; either version 2, or (at your option) any later
|
|---|
| 9 | rem version.
|
|---|
| 10 |
|
|---|
| 11 | rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
|
|---|
| 12 | rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|---|
| 13 | rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|---|
| 14 | rem more details.
|
|---|
| 15 |
|
|---|
| 16 | rem You should have received a copy of the GNU General Public License along
|
|---|
| 17 | rem with GNU Make; see the file COPYING. If not, write to the Free Software
|
|---|
| 18 | rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|---|
| 19 |
|
|---|
| 20 | echo Configuring MAKE for DJGPP
|
|---|
| 21 |
|
|---|
| 22 | rem The SmallEnv trick protects against too small environment block,
|
|---|
| 23 | rem in which case the values will be truncated and the whole thing
|
|---|
| 24 | rem goes awry. COMMAND.COM will say "Out of environment space", but
|
|---|
| 25 | rem many people don't care, so we force them to care by refusing to go.
|
|---|
| 26 |
|
|---|
| 27 | rem Where is the srcdir?
|
|---|
| 28 | set XSRC=.
|
|---|
| 29 | if not "%XSRC%"=="." goto SmallEnv
|
|---|
| 30 | if "%1%"=="" goto SrcDone
|
|---|
| 31 | set XSRC=%1
|
|---|
| 32 | if not "%XSRC%"=="%1" goto SmallEnv
|
|---|
| 33 |
|
|---|
| 34 | :SrcDone
|
|---|
| 35 |
|
|---|
| 36 | update %XSRC%/configh.dos ./config.h
|
|---|
| 37 |
|
|---|
| 38 | rem Do they have Make?
|
|---|
| 39 | redir -o junk.$$$ -eo make -n -f NUL
|
|---|
| 40 | rem REDIR will return 1 if it cannot run Make.
|
|---|
| 41 | rem If it can run Make, it will usually return 2,
|
|---|
| 42 | rem but 0 is also OK with us.
|
|---|
| 43 | if errorlevel 2 goto MakeOk
|
|---|
| 44 | if not errorlevel 1 goto MakeOk
|
|---|
| 45 | if exist junk.$$$ del junk.$$$
|
|---|
| 46 | echo No Make program found--use DOSBUILD.BAT to build Make.
|
|---|
| 47 | goto End
|
|---|
| 48 |
|
|---|
| 49 | rem They do have Make. Generate the Makefile.
|
|---|
| 50 |
|
|---|
| 51 | :MakeOk
|
|---|
| 52 | del junk.$$$
|
|---|
| 53 | update %XSRC%/Makefile.DOS ./Makefile
|
|---|
| 54 | echo Done.
|
|---|
| 55 | if not "%XSRC%"=="." echo Invoke Make thus: "make srcdir=%XSRC%"
|
|---|
| 56 | goto End
|
|---|
| 57 |
|
|---|
| 58 | :SmallEnv
|
|---|
| 59 | echo Your environment is too small. Please enlarge it and run me again.
|
|---|
| 60 |
|
|---|
| 61 | :End
|
|---|
| 62 | set XRSC=
|
|---|