# Makefile for Windows NT and Windows 95

# Targets are:
#   _apache    - build Apache in Debug mode
#   install    - build and install a Debug build
#   clean      - 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_win32_debug.txt INSTDIR="d:\Program Files\Apache" install
#
# Note: this does *NOT* change the compiled in default "server root"

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

default:	_apache

_apache: _build

install: _build _install

_build:
	cd os\win32
	 nmake /nologo CFG="ApacheOS - Win32 Debug" -f ApacheOS.mak
	cd ..\..
	cd regex
	 nmake /nologo CFG="regex - Win32 Debug" -f regex.mak
	cd ..
	cd ap
	 nmake /nologo CFG="ap - Win32 Debug" -f ap.mak
	cd ..
	cd support
	 nmake /nologo CFG="htpasswd - Win32 Debug" -f htpasswd.mak
	cd ..
	cd main
	 nmake /nologo CFG="gen_uri_delims - Win32 Debug" -f gen_uri_delims.mak
	 nmake /nologo CFG="gen_test_char - Win32 Debug" -f gen_test_char.mak
	cd ..
	 -del CoreD\buildmark.obj
	 nmake /nologo CFG="ApacheCore - Win32 Debug" -f ApacheCore.mak
	 nmake /nologo CFG="Apache - Win32 Debug" -f Apache.mak
	cd os\win32
	 set CFG=ApacheModuleStatus - Win32 Debug
	 nmake /nologo CFG="ApacheModuleStatus - Win32 Debug" -f ApacheModuleStatus.mak
#	 nmake /nologo CFG ""/nologo -f ApacheModuleStatus.mak"=ApacheModuleInfo - Win32 Debug" -f ApacheModuleInfo.mak
	 nmake /nologo CFG="ApacheModuleAuthAnon - Win32 Debug" -f ApacheModuleAuthAnon.mak
	 nmake /nologo CFG="ApacheModuleDigest - Win32 Debug" -f ApacheModuleDigest.mak
	 nmake /nologo CFG="ApacheModuleCERNMeta - Win32 Debug" -f ApacheModuleCERNMeta.mak
	 nmake /nologo CFG="ApacheModuleExpires - Win32 Debug" -f ApacheModuleExpires.mak
	 nmake /nologo CFG="ApacheModuleHeaders - Win32 Debug" -f ApacheModuleHeaders.mak
	 nmake /nologo CFG="ApacheModuleSpeling - Win32 Debug" -f ApacheModuleSpeling.mak
	 nmake /nologo CFG="ApacheModuleUserTrack - Win32 Debug" -f ApacheModuleUserTrack.mak
	 nmake /nologo CFG="ApacheModuleRewrite - Win32 Debug" -f ApacheModuleRewrite.mak
	cd ..\..
	cd modules\proxy
	 nmake /nologo CFG="ApacheModuleProxy - Win32 Debug" -f ApacheModuleProxy.mak
	cd ..\..

_install:
	-mkdir $(INSTDIR)
	-mkdir $(INSTDIR)\modules
	-mkdir $(INSTDIR)\logs
	-mkdir $(INSTDIR)\conf
	-mkdir $(INSTDIR)\bin
	copy ApacheD\Apache.exe $(INSTDIR)
	copy CoreD\ApacheCore.dll $(INSTDIR)
	copy os\win32\ApacheModuleStatusD\ApacheModuleStatus.dll $(INSTDIR)\modules
#       copy os\win32\ApacheModuleInfoD\ApacheModuleInfo.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleAuthAnonD\ApacheModuleAuthAnon.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleDigestD\ApacheModuleDigest.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleCERNMetaD\ApacheModuleCERNMeta.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleExpiresD\ApacheModuleExpires.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleHeadersD\ApacheModuleHeaders.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleRewriteD\ApacheModuleRewrite.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleSpelingD\ApacheModuleSpeling.dll $(INSTDIR)\modules
	copy os\win32\ApacheModuleUserTrackD\ApacheModuleUserTrack.dll $(INSTDIR)\modules
	copy modules\proxy\Debug\ApacheModuleProxy.dll $(INSTDIR)\modules
	copy support\Debug\htpasswd.exe $(INSTDIR)\bin

clean:
	cd os\win32
	 nmake /nologo CFG="ApacheOS - Win32 Debug" -f ApacheOS.mak clean
	cd ..\..
	cd regex
	 nmake /nologo CFG="regex - Win32 Debug" -f regex.mak clean
	cd ..
	cd ap
	 nmake /nologo CFG="ap - Win32 Debug" -f ap.mak clean
	cd ..
	cd support
	 nmake /nologo CFG="htpasswd - Win32 Debug" -f htpasswd.mak clean
	cd ..
	cd main
	 nmake /nologo CFG="gen_uri_delims - Win32 Debug" -f gen_uri_delims.mak clean
	 del uri_delims.h
	 nmake /nologo CFG="gen_test_char - Win32 Debug" -f gen_test_char.mak clean
	 del test_char.h
	cd ..
	 nmake /nologo CFG="ApacheCore - Win32 Debug" -f ApacheCore.mak clean
	 nmake /nologo CFG="Apache - Win32 Debug" -f Apache.mak clean
	cd os\win32
	 nmake /nologo CFG="ApacheModuleStatus - Win32 Debug" -f ApacheModuleStatus.mak clean
#	 nmake /nologo CFG="ApacheModuleInfo - Win32 Debug" -f ApacheModuleInfo.mak clean
	 nmake /nologo CFG="ApacheModuleAuthAnon - Win32 Debug" -f ApacheModuleAuthAnon.mak clean
	 nmake /nologo CFG="ApacheModuleDigest - Win32 Debug" -f ApacheModuleDigest.mak clean
	 nmake /nologo CFG="ApacheModuleCERNMeta - Win32 Debug" -f ApacheModuleCERNMeta.mak clean
	 nmake /nologo CFG="ApacheModuleExpires - Win32 Debug" -f ApacheModuleExpires.mak clean
	 nmake /nologo CFG="ApacheModuleHeaders - Win32 Debug" -f ApacheModuleHeaders.mak clean
	 nmake /nologo CFG="ApacheModuleSpeling - Win32 Debug" -f ApacheModuleSpeling.mak clean
	 nmake /nologo CFG="ApacheModuleUserTrack - Win32 Debug" -f ApacheModuleUserTrack.mak clean
	 nmake /nologo CFG="ApacheModuleRewrite - Win32 Debug" -f ApacheModuleRewrite.mak clean
	cd ..\..
	cd modules\proxy
	 nmake /nologo CFG="ApacheModuleProxy - Win32 Debug" -f ApacheModuleProxy.mak clean
	cd ..\..
 	cd os\win32\installer\installdll
	 nmake /nologo CFG="install - Win32 Debug" -f install.mak clean
	cd ..\..\..

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