# -*- 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.10 2005/03/09 13:42:02 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 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 jim: setup $(OUTDIR)\jim.exe dll: setup $(OUTDIR)\jim.dll win32: setup $(OUTDIR)\jim-win32.dll win32api: setup $(OUTDIR)\jim-win32api.dll win32com: setup $(OUTDIR)\jim-win32com.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.dll: $(TMPDIR)\jim-win32.obj @$(LD) $(LDFLAGS) -dll -out:$@ $** $(LIBS) $(OUTDIR)\jim-win32api.dll: $(TMPDIR)\jim-win32api.obj @$(LD) $(LDFLAGS) -dll -out:$@ $** $(LIBS) $(OUTDIR)\jim-win32com.dll: $(TMPDIR)\jim-win32com.obj @$(LD) $(LDFLAGS) -dll -out:$@ $** $(LIBS) .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 /q /s $(TMPDIR) >NUL realclean: clean @if exist $(OUTDIR)\NUL rmdir /q /s $(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 @<< $< << #-------------------------------------------------------------------------