Project: NAnt
Code Location: git://github.com/nant/nant.gitmaster
Browse
/
Download File
Makefile.nmake
#NAnt nmake makefile for building on windows
CSC=csc
RESGEN=resgen
TARGET=net-2.0

!ifdef MONO
DEFINE = MONO
FRAMEWORK_DIR = mono
!else
DEFINE = NET
FRAMEWORK_DIR = net
!endif

!if "$(TARGET)" == "net-2.0" || "$(TARGET)" == "mono-2.0"
DEFINE = $(DEFINE),NET_1_0,NET_1_1,NET_2_0,ONLY_2_0
!else if "$(TARGET)" == "net-3.5" || "$(TARGET)" == "mono-3.5"
DEFINE = $(DEFINE),NET_1_0,NET_1_1,NET_2_0,NET_3_5,ONLY_3_5
!else if "$(TARGET)" == "net-4.0" || "$(TARGET)" == "mono-4.0"
DEFINE = $(DEFINE),NET_1_0,NET_1_1,NET_2_0,NET_3_5,NET_4_0,ONLY_4_0
!else
!error Specified target "$(TARGET)" is not valid
!endif

!ifdef DEBUG
NANT_DEBUG = -debug+
!endif

TARGET_FRAMEWORK = -t:$(TARGET)
NANT = $(MONO) bootstrap\NAnt.exe $(NANT_DEBUG)

all:  bootstrap build-nant

build-nant: bootstrap
	$(NANT) $(TARGET_FRAMEWORK) -f:NAnt.build build

clean:
	if exist bootstrap rmdir /S /Q bootstrap
	if exist build rmdir /S /Q build

install: bootstrap
	$(NANT) $(TARGET_FRAMEWORK) -f:NAnt.build install -D:prefix="$(prefix)"  -D:destdir="$(DESTDIR)" -D:doc.prefix="$(docdir)"

run-test: bootstrap
	$(NANT) $(TARGET_FRAMEWORK) -f:NAnt.build test
	
bootstrap: setup bootstrap\NAnt.exe bootstrap\NAnt.Core.dll bootstrap\NAnt.DotNetTasks.dll bootstrap\NAnt.CompressionTasks.dll bootstrap\NAnt.Win32Tasks.dll
	
setup:
	if not exist bootstrap md bootstrap
	if not exist bootstrap\lib md bootstrap\lib
	xcopy lib bootstrap\lib /S /Y /Q
	copy lib\common\neutral\log4net.dll bootstrap
	copy src\NAnt.Console\App.config bootstrap\NAnt.exe.config

bootstrap\NAnt.exe:
	$(CSC) $(DEBUG) -target:exe -define:$(DEFINE) -out:bootstrap\NAnt.exe -r:bootstrap\log4net.dll \
		-r:System.Configuration.dll  -recurse:src\NAnt.Console\*.cs src\CommonAssemblyInfo.cs

bootstrap\NAnt.Core.dll:
	$(RESGEN)  src\NAnt.Core\Resources\Strings.resx bootstrap\NAnt.Core.Resources.Strings.resources
	$(CSC) $(DEBUG) -target:library -warn:0 -define:$(DEFINE) -out:bootstrap\NAnt.Core.dll -r:bootstrap\log4net.dll \
		-r:System.Web.dll -resource:bootstrap\NAnt.Core.Resources.Strings.resources \
		-recurse:src\NAnt.Core\*.cs src\CommonAssemblyInfo.cs

bootstrap\NAnt.DotNetTasks.dll:
	$(RESGEN)  src\NAnt.DotNet\Resources\Strings.resx bootstrap\NAnt.DotNet.Resources.Strings.resources
	$(CSC) $(DEBUG) -target:library -warn:0 -define:$(DEFINE) -out:bootstrap\NAnt.DotNetTasks.dll \
		-r:bootstrap\NAnt.Core.dll -r:bootstrap/lib/common/neutral/NDoc.Core.dll \
		-resource:bootstrap\NAnt.DotNet.Resources.Strings.resources -recurse:src\NAnt.DotNet\*.cs \
		src\CommonAssemblyInfo.cs
	
bootstrap\NAnt.CompressionTasks.dll:
	$(CSC) $(DEBUG) -target:library -warn:0 -define:$(DEFINE) -out:bootstrap\NAnt.CompressionTasks.dll \
		-r:bootstrap\NAnt.Core.dll -r:bootstrap\lib\common\neutral\ICSharpCode.SharpZipLib.dll \
		-recurse:src\NAnt.Compression\*.cs src\CommonAssemblyInfo.cs

bootstrap\NAnt.Win32Tasks.dll:
	$(CSC) $(DEBUG) -target:library -warn:0 -define:$(DEFINE) -out:bootstrap\NAnt.Win32Tasks.dll \
		-r:bootstrap\NAnt.Core.dll -r:bootstrap\NAnt.DotNetTasks.dll -r:System.ServiceProcess.dll \
		-recurse:src\NAnt.Win32\*.cs \
		src\CommonAssemblyInfo.cs