You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Paul Sutton <pa...@c2.net> on 1998/03/21 17:37:11 UTC

NT makefile simplication and wierdness

Below is a much simpler Makefile.nt for NT and 95. The previous version
repeated virtually the same code for release and debug builds. The new
version eliminates the repeated code by using Window's attempt at
"environment variables" to pick between release and debug builds. It also
allows for overriding the installation directory and documents the
available targets. 

Note that NMAKE has some very strange properties. For example single
letter targets don't work:

a:
	echo Hello

gives

--
t1(2) : fatal error U1035: syntax error : expected ':' or '=' separator 
Stop.
--

Environment variables at the end of lines don't work:

aa:	bb
	echo X is set to %X%
	echo No, X is set to %X% really

bb:
	set X=Hello!

gives

--
        set X=Hello!
        echo X is set to %X
X is set to %X
        echo No, X is set to %X% really
No, X is set to Hello! really
--

Plus the strange properties that environment variables are inherited by
not only subsequent commands, but also by parent and subsequent targets! 
This turns out to be useful, but is seriously wierd. 

Paul

Makefile.nt:

############################################################
#
# Makefile for Windows NT and Windows 95
#
# Targets are:
#   _apacher   - build Apache in Release mode
#   _apached   - build Apache in Debug mode
#   installr   - build and install a Release build
#   installd   - build and install a Debug build
#   clean      - remove (most) generated files
#   _cleanr    - remove (most) files generated by a Release build
#   _cleand    - remove (most) files generated by a Debug build
#
# The default installation directory is \Apache. This can be changed
# with the INSTDIR macro, for example:
#
#   nmake /f Makefile.nt INSTDIR="d:\Program Files\Apache" installr
#
# Note: this does *NOT* change the compiled in default "server root"

!IF "$(INSTDIR)" == ""
INSTDIR=\Apache
!MESSAGE Using default install directory \Apache
!ENDIF 

_release:
	set SHORT=R
	set LONG=Release

_debug:
	set SHORT=D
	set LONG=Debug

_apacher: _release _build
_apached: _debug   _build
installr: _release _build _install
installd: _debug   _build _install
_cleanr:  _release _clean
_cleand:  _debug   _clean

clean:
	$(MAKE) /f Makefile.nt _cleanr
	$(MAKE) /f Makefile.nt _cleand

installdll: _release installdll

_build:
	cd os\win32
	 nmake /nologo CFG="ApacheOS - Win32 %LONG%" -f ApacheOS.mak
	cd ..\..
	cd regex
	 nmake /nologo CFG="regex - Win32 %LONG%" -f regex.mak
	cd ..
	cd ap
	 nmake /nologo CFG="ap - Win32 %LONG%" -f ap.mak
	cd ..
	 -del Core%SHORT%\buildmark.obj
	 nmake /nologo CFG="ApacheCore - Win32 %LONG%" -f ApacheCore.mak
	 nmake /nologo CFG="Apache - Win32 %LONG%" -f Apache.mak
	cd os\win32
	 set CFG=ApacheModuleStatus - Win32 %LONG%
	 nmake /nologo CFG="ApacheModuleStatus - Win32 %LONG%" -f ApacheModuleStatus.mak
#	 nmake /nologo CFG ""/nologo -f ApacheModuleStatus.mak"=ApacheModuleInfo - Win32 %LONG%" -f ApacheModuleInfo.mak
	 nmake /nologo CFG="ApacheModuleAuthAnon - Win32 %LONG%" -f ApacheModuleAuthAnon.mak
	 nmake /nologo CFG="ApacheModuleDigest - Win32 %LONG%" -f ApacheModuleDigest.mak
	 nmake /nologo CFG="ApacheModuleCERNMeta - Win32 %LONG%" -f ApacheModuleCERNMeta.mak
	 nmake /nologo CFG="ApacheModuleExpires - Win32 %LONG%" -f ApacheModuleExpires.mak
	 nmake /nologo CFG="ApacheModuleHeaders - Win32 %LONG%" -f ApacheModuleHeaders.mak
	 nmake /nologo CFG="ApacheModuleSpeling - Win32 %LONG%" -f ApacheModuleSpeling.mak
	 nmake /nologo CFG="ApacheModuleUserTrack - Win32 %LONG%" -f ApacheModuleUserTrack.mak
	 nmake /nologo CFG="ApacheModuleRewrite - Win32 %LONG%" -f ApacheModuleRewrite.mak
	cd ..\..
	cd modules\proxy
	 nmake /nologo CFG="ApacheModuleProxy - Win32 %LONG%" -f ApacheModuleProxy.mak
	cd ..\..

_install:
	-mkdir $(INSTDIR)
	-mkdir $(INSTDIR)\modules
	-mkdir $(INSTDIR)\logs
	-mkdir $(INSTDIR)\conf
	copy Apache%SHORT%\Apache.exe $(INSTDIR)
	copy Core%SHORT%\ApacheCore.dll $(INSTDIR)
	copy os\win32\ApacheModuleStatus%SHORT%\ApacheModuleStatus.dll $(INSTDIR)\modules
#       copy os\win32\ApacheModuleInfo%SHORT%\ApacheModuleInfo.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleAuthAnon%SHORT%\ApacheModuleAuthAnon.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleDigest%SHORT%\ApacheModuleDigest.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleCERNMeta%SHORT%\ApacheModuleCERNMeta.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleExpires%SHORT%\ApacheModuleExpires.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleHeaders%SHORT%\ApacheModuleHeaders.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleRewrite%SHORT%\ApacheModuleRewrite.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleSpeling%SHORT%\ApacheModuleSpeling.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleUserTrack%SHORT%\ApacheModuleUserTrack.dll $(INSTDIR)\modules
	copy modules\proxy\%LONG%\ApacheModuleProxy.dll $(INSTDIR)\modules

_clean:
	cd os\win32
	 nmake /nologo CFG="ApacheOS - Win32 %LONG%" -f ApacheOS.mak clean
	cd ..\..
	cd regex
	 nmake /nologo CFG="regex - Win32 %LONG%" -f regex.mak clean
	cd ..
	cd ap
	 nmake /nologo CFG="ap - Win32 %LONG%" -f ap.mak clean
	cd ..
	 nmake /nologo CFG="ApacheCore - Win32 %LONG%" -f ApacheCore.mak clean
	 nmake /nologo CFG="Apache - Win32 %LONG%" -f Apache.mak clean
	cd os\win32
	 nmake /nologo CFG="ApacheModuleStatus - Win32 %LONG%" -f ApacheModuleStatus.mak clean
#	 nmake /nologo CFG="ApacheModuleInfo - Win32 %LONG%" -f ApacheModuleInfo.mak clean
	 nmake /nologo CFG="ApacheModuleAuthAnon - Win32 %LONG%" -f ApacheModuleAuthAnon.mak clean
	 nmake /nologo CFG="ApacheModuleDigest - Win32 %LONG%" -f ApacheModuleDigest.mak clean
	 nmake /nologo CFG="ApacheModuleCERNMeta - Win32 %LONG%" -f ApacheModuleCERNMeta.mak clean
	 nmake /nologo CFG="ApacheModuleExpires - Win32 %LONG%" -f ApacheModuleExpires.mak clean
	 nmake /nologo CFG="ApacheModuleHeaders - Win32 %LONG%" -f ApacheModuleHeaders.mak clean
	 nmake /nologo CFG="ApacheModuleSpeling - Win32 %LONG%" -f ApacheModuleSpeling.mak clean
	 nmake /nologo CFG="ApacheModuleUserTrack - Win32 %LONG%" -f ApacheModuleUserTrack.mak clean
	cd ..\..
	cd modules\proxy
	 nmake /nologo CFG="ApacheModuleProxy - Win32 %LONG%" -f ApacheModuleProxy.mak clean
	cd ..\..
 	cd os\win32\installer\installdll
	 nmake /nologo CFG="install - Win32 %LONG%" -f install.mak clean
	cd ..\..\..

_installdll:
 	cd os\win32\installer\installdll
	 nmake /nologo CFG="install - Win32 %LONG%" -f install.mak
	cd ..\..\..



Re: NT makefile simplication and wierdness

Posted by Ben Laurie <be...@algroup.co.uk>.
Paul Sutton wrote:
> 
> Below is a much simpler Makefile.nt for NT and 95. The previous version
> repeated virtually the same code for release and debug builds. The new
> version eliminates the repeated code by using Window's attempt at
> "environment variables" to pick between release and debug builds. It also
> allows for overriding the installation directory and documents the
> available targets.

Cute. +1.

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|  Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd,     |Apache-SSL author    http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache