# -*- Makefile -*- # # This is a Microsoft Visual C NMAKE makefile to use in building the # Jim interpreter. # # Usage: # nmake -f Makefile.vc clean all # # To build a debug build, add DEBUG=1 to the command line. To build # for profiling, add PROFILE=1. eg: # nmake -f Makefile.vc DEBUG=1 clean all # # # Copyright (C) 2005 Pat Thoyts # #------------------------------------------------------------------------- # $Id: Makefile.vc,v 1.12 2005/04/06 14:16:56 patthoyts Exp $ #------------------------------------------------------------------------- SRCDIR =. !ifndef DEBUG DEBUG =0 !endif !ifndef PROFILE PROFILE =0 !endif !if $(DEBUG) OUTDIR =Debug CFLAGS =-Od -Zi -GZ -MDd -D_DEBUG LDFLAGS=-debug:full -debugtype:cv !else OUTDIR =Release CFLAGS =-O2 -Op -Gs -MD -DNDEBUG LDFLAGS=-release -opt:ref -opt:icf,3 !endif !if $(PROFILE) CFLAGS =$(CFLAGS) -Zi LDFLAGS=$(LDFLAGS) -profile -map !endif !if "$(OS)" == "Windows_NT" RMDIR = rmdir /s /q !else RMDIR = deltree /y !endif TMPDIR =$(OUTDIR)\Objects CC =cl -nologo LD =link -nologo # -Fd$(TMPDIR)^\ CFLAGS =$(CFLAGS) -W3 -GX -YX -Fp$(TMPDIR)^\ INC = DEFS =-DWIN32 LIBS = all: jim win32 win32com win32api jim: setup $(OUTDIR)\jim.exe jimwish: setup $(OUTDIR)\jimwish.exe dll: setup $(OUTDIR)\jim.dll win32: setup $(OUTDIR)\jim-win32-1.0.dll win32api: setup $(OUTDIR)\jim-win32api-1.0.dll win32com: setup $(OUTDIR)\jim-win32com-1.0.dll $(OUTDIR)\jim.exe: $(TMPDIR)\jim.obj $(TMPDIR)\jimsh.obj @$(LD) $(LDFLAGS) -out:$@ $** $(LIBS) $(OUTDIR)\jim.dll: $(TMPDIR)\jim.obj @$(LD) $(LDFLAGS) -dll -out:$@ $** $(LIBS) $(OUTDIR)\jim-win32-1.0.dll: $(TMPDIR)\jim-win32.obj @$(LD) $(LDFLAGS) -dll -out:$@ $** $(LIBS) $(OUTDIR)\jim-win32api-1.0.dll: $(TMPDIR)\jim-win32api.obj @$(LD) $(LDFLAGS) -dll -out:$@ $** $(LIBS) $(OUTDIR)\jim-win32com-1.0.dll: $(TMPDIR)\jim-win32com.obj @$(LD) $(LDFLAGS) -dll -out:$@ $** $(LIBS) $(OUTDIR)\jimwish.exe: $(TMPDIR)\jim.obj $(TMPDIR)\jimwish.obj @$(LD) $(LDFLAGS) -out:$@ $** $(LIBS) user32.lib .PHONY: all jim dll win32 win32api win32com #------------------------------------------------------------------------- setup: @if not exist $(OUTDIR) mkdir $(OUTDIR) @if not exist $(TMPDIR) mkdir $(TMPDIR) test: jim $(OUTDIR)\jim.exe test.tcl clean: @if exist $(TMPDIR)\NUL $(RMDIR) $(TMPDIR) >NUL realclean: clean @if exist $(OUTDIR)\NUL $(RMDIR) $(OUTDIR) >NUL #------------------------------------------------------------------------- .SUFFIXES:.c .cpp {$(SRCDIR)}.c{$(TMPDIR)}.obj:: @$(CC) $(CFLAGS) $(DEFS) $(INC) -Fa$(TMPDIR)\ -Fo$(TMPDIR)\ -c @<< $< << {$(SRCDIR)}.cpp{$(TMPDIR)}.obj:: @$(CC) $(CFLAGS) $(DEFS) $(INC) -Fo$(TMPDIR)\ -c @<< $< << #-------------------------------------------------------------------------