###################################################################### # # Microsoft Visual C++ makefile for XOTcl # # do not edit in this file, edit "configs.vc" # ###################################################################### !include "configs.vc" BINROOT = . ROOT = .. NAMEPREFIX = lib NAME = nsf STUBSUFFIX = stub NSF_DIR = .. NSF_BUILD_DIR = ..\win SDBM_DIR = ..\library\store\NsfSdbm EXPAT_DIR = ..\library\xml\TclExpat-1.1 MAKE_XOTCL = .\library\lib\make.nsf MAKECMD = nmake.exe -nologo /$(MAKEFLAGS) -f makefile.vc ######################################################################## lflags = /NODEFAULTLIB /NOLOGO /MACHINE:$(MACHINE) $(libpath32) conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup !IF "$(MACHINE)" == "PPC" libc = libc$(DBGX).lib libcdll = crtdll$(DBGX).lib !ELSE libc = libc$(DBGX).lib oldnames.lib libcdll = msvcrt$(DBGX).lib oldnames.lib !ENDIF baselibs = kernel32.lib $(optlibs) advapi32.lib user32.lib winlibs = $(baselibs) gdi32.lib comdlg32.lib winspool.lib guilibs = $(libc) $(winlibs) conlibs = $(libc) $(baselibs) guilibsdll = $(libcdll) $(winlibs) conlibsdll = $(libcdll) $(baselibs) ######################################################################## !if $(DEBUG) TMPNAME = Debug DBGX = d !else TMPNAME = Release DBGX = !endif TMP_DIR = $(BINROOT)\$(TMPNAME) !ifndef OUT_DIR OUT_DIR = $(TMP_DIR) !endif !if $(STATIC_BUILD) XOTCLOUTNAME = $(NAMEPREFIX)$(NAME)$(NSF_VERSION)$(DBGX) XOTCLTARGET = "$(OUT_DIR)\$(XOTCLOUTNAME).lib" !else XOTCLOUTNAME = $(NAMEPREFIX)$(NAME)$(NSF_VERSION)$(DBGX) XOTCLIMPLIB = "$(OUT_DIR)\$(XOTCLOUTNAME).lib" XOTCLTARGET = "$(OUT_DIR)\$(XOTCLOUTNAME).dll" !endif TCLSTUBLIB = "$(TCLROOT)\win\Release\tclstub$(TCL_VERSION).lib" TCLIMPLIB = "$(TCLROOT)\win\$(OUT_DIR)\tcl$(TCL_VERSION)$(DBGX).lib" TKIMPLIB = "$(TKROOT)\win\$(OUT_DIR)\tk$(TCL_VERSION)$(DBGX).lib" TCLSH = "$(TCLROOT)\win\$(OUT_DIR)\tclsh$(TCL_VERSION)$(DBGX).exe" XOTCLSTUBLIBNAME = $(NAMEPREFIX)$(NAME)$(STUBSUFFIX)$(NSF_VERSION)$(DBGX).lib XOTCLSTUBLIB = "$(OUT_DIR)\$(XOTCLSTUBLIBNAME)" LIB_INSTALL_DIR = $(INSTALLDIR)\lib BIN_INSTALL_DIR = $(INSTALLDIR)\bin SCRIPT_INSTALL_DIR = $(INSTALLDIR)\lib\nsf$(NSF_DOTVERSION) INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include XOTCLOBJS_STUB = $(TMP_DIR)\nsfStubInit.obj COMPILE_NSF_STUBS = -DCOMPILE_NSF_STUBS=1 !if $(TCLMAJOR) == 8 !if $(TCLMINOR) == 0 XOTCLOBJS_STUB = "" COMPILE_NSF_STUBS="" !endif !endif XOTCLOBJS = $(XOTCLOBJS_STUB) \ $(TMP_DIR)\nsf.obj \ $(TMP_DIR)\nsfError.obj \ $(TMP_DIR)\nsfMetaData.obj \ $(TMP_DIR)\nsfObjectData.obj \ $(TMP_DIR)\nsfProfile.obj \ $(TMP_DIR)\nsfTrace.obj \ $(TMP_DIR)\nsfShadow.obj \ $(TMP_DIR)\nsfUtil.obj \ $(TMP_DIR)\aolstub.obj \ !if $(STATIC_BUILD) == 0 $(TMP_DIR)\dllEntryPoint.obj \ $(TMP_DIR)\dllResource.obj \ !endif XOTCLSHOBJS = $(TMP_DIR)\nsfAppInit.obj XOWISHOBJS = $(TMP_DIR)\winMain.obj XOTCLSTUBOBJS = \ $(TMP_DIR)\nsfStubLib.obj WINDIR = $(ROOT)\win GENERICDIR = $(ROOT)\generic RCDIR = $(ROOT)\win\rc ###################################################################### # Link flags ###################################################################### !if $(DEBUG) ldebug = -debug:full -debugtype:cv !else ldebug = -release !endif # declarations common to all linker options lcommon = -nologo -link50compat -machine:$(MACHINE) NSF_LFLAGS = $(lcommon) $(ldebug) -subsystem:windows -dll !if $(USE_TCL_STUBS) == 0 NSF_LLIBS = $(TCLIMPLIB) !else NSF_LLIBS = $(TCLSTUBLIB) !endif ###################################################################### # Compile flags ###################################################################### !if !$(DEBUG) # This cranks the optimization level to maximize speed cdebug = -O2 -Gs !else if "$(MACHINE)" == "IA64" cdebug = -Od -Zi !else cdebug = -Z7 -Od -WX DBGX = d !endif !if $(STATIC_BUILD) cdll = !else cdll = -GD !endif # declarations common to all compiler options ccommon = -nologo -c -W3 -YX \ !if $(STATIC_BUILD) && $(NOMSVCRT) crt = -MT$(DBGX) !else crt = -MD$(DBGX) !endif TCL_INCLUDES = -I"$(TCLROOT)\generic" TK_INCLUDES = -I"$(TKROOT)\generic" -I$(TKROOT)\win -I$(TKROOT)\xlib NSF_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) NSF_DEFINES = -DBUILD_$(NAME) -DTCL_THREADS=1 \ -DXOLIBPKG=$(INST_XOLIBPKG) \ -DXOTCLVERSION=$(XOTCLVERSION) \ -DPACKAGE_VERSION=$(PACKAGE_VERSION) \ -DXOTCLPATCHLEVEL=$(XOTCLPATCHLEVEL) \ -D__WIN32__ -DVISUAL_CC $(COMPILE_NSF_STUBS) NSF_EXE_CFLAGS = $(ccommon) $(cdebug) $(crt) $(cdll) $(NSF_INCLUDES) \ $(NSF_DEFINES) $(TCL_INCLUDES) $(TK_INCLUDES) !if $(USE_TCL_STUBS) NSF_CFLAGS = $(NSF_EXE_CFLAGS) -DUSE_TCL_STUBS !else NSF_CFLAGS = $(NSF_EXE_CFLAGS) !endif ###################################################################### # Project specific targets ###################################################################### all : libs packages end #nsf : nsfsh xowish libs : setup $(XOTCLTARGET) $(XOTCLSTUBLIB) ./pkgIndex.tcl cd $(SDBM_DIR) $(MAKECMD) cd ..\.. cd $(EXPAT_DIR) $(MAKECMD) cd ..\..\..\win end: @echo ************************************************************ @echo * @echo * Make completed. @echo * @echo * In order to test XOTcl, invoke: @echo * @echo * nmake -fmakefile.vc test @echo * @echo * In order install XOTcl, invoke the installWin.tcl @echo * installation script, like: @echo * @echo * tclsh83 installWin.tcl c:\Progra~1 @echo * @echo * or: @echo * @echo * nmake -fmakefile.vc install @echo * @echo * To run XOTcl from the local directory, set the environment @echo * variable TCLLIBPATH to the toplevel directory of nsf and @echo * execute tclsh: @echo * @echo * set TCLLIBPATH=$(ROOT) @echo * tclsh83 @echo * package require XOTcl; namespace import -force nsf::* @echo * @echo ************************************************************ packages : libs cd ..\library set TCLLIBPATH=$(ROOT) $(TCLSH) ..\$(MAKE_XOTCL) -target $(INST_XOLIBPKG) -all cd ..\win install : all set TCLLIBPATH=$(ROOT) $(TCLSH) .\installWin.tcl test : $(TCLSH) set TCLLIBPATH=$(ROOT) $(TCLSH) $(ROOT)\tests\speedtest.nsf $(TCLSH) $(ROOT)\tests\testx.nsf $(TCLSH) $(ROOT)\tests\testo.nsf $(TCLSH) $(ROOT)\tests\forwardtest.nsf $(TCLSH) $(ROOT)\tests\actiweb.test $(TCLSH) $(ROOT)\tests\persistence.test $(TCLSH) $(ROOT)\tests\xoRDF.test $(TCLSH) $(ROOT)\tests\xocomm.test tar : distclean cd .. tar cvfz nsf-$(FULLVERSION).tar.gz nsf-$(FULLVERSION)/* cd nsf-$(FULLVERSION) ./pkgIndex.tcl : $(XOTCLTARGET) echo package ifneeded XOTcl $(NSF_VERSION) [list load [file join $$dir $(TMPNAME)/$(XOTCLOUTNAME).dll] XOTcl] > \ ".\pkgIndex.tcl" setup : @$(vcvars) > nul @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) &\ echo Created directory '$(TMP_DIR)' @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) &\ echo Created directory '$(OUT_DIR)' $(XOTCLTARGET) : $(XOTCLOBJS) !if $(STATIC_BUILD) $(lib32) -nologo -machine:$(MACHINE) -out:$@ @<< !else $(link32) $(NSF_LFLAGS) -base:@$(NSF_DIR)\win\dllBase.txt,$@ -out:$@ $(NSF_LLIBS) @<< !endif $(XOTCLOBJS) << #!if $(DEBUG) == 0 $(XOTCLSTUBLIB) : $(XOTCLSTUBOBJS) $(lib32) -nologo -out:$@ $(XOTCLSTUBOBJS) #!else #$(XOTCLSTUBLIB) : #!endif #install : all # if not exist "$(INSTALLDIR)" mkdir "$(INSTALLDIR)" # if not exist "$(BIN_INSTALL_DIR)" mkdir "$(BIN_INSTALL_DIR)" # if not exist "$(LIB_INSTALL_DIR)" mkdir "$(LIB_INSTALL_DIR)" # if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)" # if not exist "$(INCLUDE_INSTALL_DIR)" mkdir "$(INCLUDE_INSTALL_DIR)" # copy $(XOTCLTARGET) "$(SCRIPT_INSTALL_DIR)" # -copy $(XOTCLSTUBLIB) "$(LIB_INSTALL_DIR)" # copy $(ROOT)\generic\nsf.h "$(INCLUDE_INSTALL_DIR)" # copy $(ROOT)\generic\nsfDecls.h "$(INCLUDE_INSTALL_DIR)" # copy $(ROOT)\library\*.* "$(SCRIPT_INSTALL_DIR)" # echo package ifneeded XOTcl $(NSF_DOTVERSION) [list load [file join $$dir ../../bin $(XOTCLOUTNAME).dll] XOTcl] > \ # "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" ###################################################################### # Regenerate the stubs files. ###################################################################### genstubs: $(TCLSH) $(TCLROOT)\tools\genStubs.tcl $(GENERICDIR) \ $(GENERICDIR)\nsf.decls $(GENERICDIR)\nsfInt.decls ###################################################################### # Special case object file targets ###################################################################### # The following object is part of the stub library and should not # be built as DLL objects but none of the symbols should be exported $(TMP_DIR)\nsfStubLib.obj : $(GENERICDIR)\nsfStubLib.c $(cc32) -DSTATIC_BUILD $(NSF_EXE_CFLAGS) -Zl -Fo$@ $? $(TMP_DIR)\dllResource.obj : $(TMP_DIR)\nsf.res $(cvtres32) -nologo -machine:$(MACHINE) -out:$@ $? predefined : $(GENERICDIR)\predefined.nsf cd $(GENERICDIR) $(TCLSH) mk_predefined.nsf > predefined.h cd ..\win ###################################################################### # Inference rules. Use batch-mode when supported. ###################################################################### $(TMP_DIR)\nsfAppInit.obj : $(GENERICDIR)\nsfAppInit.c $(cc32) $(NSF_EXE_CFLAGS) -Fo$@ $? $(TMP_DIR)\findXOTcl.obj : $(GENERICDIR)\findXOTcl.c $(cc32) $(NSF_EXE_CFLAGS) -Fo$@ $? $(TMP_DIR)\winMain.obj : $(WINDIR)\winMain.c $(cc32) $(NSF_EXE_CFLAGS) -Fo$@ $? !if $(_NMAKE_VER) < 162 {$(WINDIR)}.c{$(TMP_DIR)}.obj : !else {$(WINDIR)}.c{$(TMP_DIR)}.obj :: !endif $(cc32) -DDLL_BUILD $(NSF_CFLAGS) -Fo$(TMP_DIR)\ @<< $< << !if $(_NMAKE_VER) < 162 {$(GENERICDIR)}.c{$(TMP_DIR)}.obj : !else {$(GENERICDIR)}.c{$(TMP_DIR)}.obj :: !endif $(cc32) -DDLL_BUILD $(NSF_CFLAGS) -Fo$(TMP_DIR)\ @<< $< << NSF_VERSION_DEFINES = \ -DNSF_MAJOR_VERSION=$(NSF_MAJOR_VERSION) \ -DNSF_MINOR_VERSION=$(NSF_MINOR_VERSION) \ -DNSF_VERSION=\"$(NSF_VERSION)\" {$(RCDIR)}.rc{$(TMP_DIR)}.res : $(rc32) -fo $@ -DDEBUG=$(DEBUG) $(NSF_VERSION_DEFINES) $(NSF_INCLUDES) $(TCL_INCLUDES) $(NSF_DEFINES) $< ###################################################################### # Clean up ###################################################################### tidy : -del $(TMP_DIR)\*.pch -del $(TMP_DIR)\*.obj -del $(TMP_DIR)\*.res -del .\*.pdb -del .\*.pch cd $(SDBM_DIR) $(MAKECMD) tidy cd ..\.. cd $(EXPAT_DIR) $(MAKECMD) tidy cd ..\..\..\win clean : -del $(TMP_DIR)\*.pch -del $(TMP_DIR)\*.obj -del $(TMP_DIR)\*.res -del .\*.pdb -del .\*.pch -del $(OUT_DIR)\*.exp -del $(OUT_DIR)\*.lib -del $(OUT_DIR)\*.dll -del ..\*.exp -del ..\*.lib -del ..\nsfsh.exe -del ..\xowish.exe cd $(SDBM_DIR) $(MAKECMD) clean cd ..\.. cd $(EXPAT_DIR) $(MAKECMD) clean cd ..\..\..\win distclean : clean -rmdir $(OUT_DIR) -rmdir $(TMP_DIR) cd $(SDBM_DIR) $(MAKECMD) distclean cd ..\.. cd $(EXPAT_DIR) $(MAKECMD) distclean cd ..\..\..\win # # tar # tar : distclean cd ..\.. tar cvfz nsf-$(FULLVERSION).tar.gz nsf-$(FULLVERSION)/* cd nsf-$(FULLVERSION)\win # # XOTcl Shells # ../nsfsh.exe: $(XOTCLSHOBJS) $(TCLIMPLIB) $(TMP_DIR)\nsf.res $(link32) $(ldebug) $(conlflags) $(TMP_DIR)\nsf.res -stack:2300000 \ -out:$@ $(conlibsdll) $(TCLIMPLIB) $(XOTCLSHOBJS) ../xowish.exe: $(XOWISHOBJS) $(TCLIMPLIB) $(TKIMPLIB) $(TMP_DIR)\nsf.res $(link32) $(ldebug) $(guilflags) $(TMP_DIR)\nsf.res -out:$@ \ $(guilibsdll) $(TCLIMPLIB) $(TKIMPLIB) $(XOTCLLIB) $(XOWISHOBJS) nsfsh: ../nsfsh.exe xowish: ../xowish.exe nsfshells: nsfsh xowish