85 lines · plain
1##2## Name: Makefile.msvc3## Purpose: Makefile for IMath library and associated tools4## for Microsoft Visual Studio 20055## Author: Matus Horvath <matus.horvath@nextra.sk>6##7## Copyright (C) 2006 Matus Horvath. Permission has been granted to use,8## modify, and redistribute this file according to the terms of the IMath9## license.10##11## Usage: nmake /f Makefile.msvc12##13 14# --- begin configuration section ---15 16## Settings for Microsoft Windows systems using nmake.17## To build with debugging, add DEBUG=Y on the "nmake" command line.18CC=cl.exe19LD=link.exe20CFLAGS=$(CFLAGS) -nologo -I. -D_CRT_SECURE_NO_DEPRECATE $(DCFLAGS)21LDFLAGS=$(LDFLAGS) -nologo $(DLDFLAGS)22LIBS=$(DLIBS)23 24!if "$(DEBUG)" == "Y"25DCFLAGS=-ZI -Od -DDEBUG=1 -DTRACEABLE_FREE=126DLDFLAGS=-DEBUG27#DLIBS=-lefence28!else29DCFLAGS=-O2 -Ob230DLDFLAGS=31#DLIBS=32!endif33 34## Visual Studio C/C++ 2005 compiler supports "long long" 64-bit type. 35CFLAGS=$(CFLAGS) -DUSE_LONG_LONG36 37# --- end of configuration section ---38TARGETS=imtest.exe pi.exe bintest.exe findprime.exe39HDRS=imath.h imrat.h iprime.h imdrover.h rsamath.h40SRCS=$(HDRS:.h=.c) $(TARGETS:.exe=.c)41OBJS=$(SRCS:.c=.obj)42EXAMPLES=input.exe basecvt.exe rounding.exe43 44.c.obj:45 $(CC) $(CFLAGS) -c $<46 47all: objs examples test48 49objs: $(OBJS)50 51# Because Visual Studio does not permit Unix shell syntax, you will52# have to run the tests manually once the "test" target is built.53test: imtest.exe pi.exe54# @ echo ""55# @ echo "Running tests, you should not see any 'FAILED' lines here."56# @ echo "If you do, please see doc.txt for how to report a bug."57# @ echo ""58# (cd tests && ./test.sh)59 60$(EXAMPLES): imath.obj imrat.obj iprime.obj examples/$*.obj61 @move $*.obj examples/$*.obj62 $(LD) $(LDFLAGS) -out:$@ $** $(LIBS)63 64examples: $(EXAMPLES)65 66imtest.exe: imtest.obj imath.obj imrat.obj imdrover.obj67 $(LD) $(LDFLAGS) -out:$@ $** $(LIBS)68 69pi.exe: pi.obj imath.obj70 $(LD) $(LDFLAGS) -out:$@ $** $(LIBS)71 72findprime.exe: findprime.obj imath.obj iprime.obj73 $(LD) $(LDFLAGS) -out:$@ $** $(LIBS)74 75rtest.exe: rtest.obj imath.obj rsamath.obj76 $(LD) $(LDFLAGS) -out:$@ $** $(LIBS)77 78bintest.exe: imath.obj bintest.obj79 $(LD) $(LDFLAGS) -out:$@ $** $(LIBS)80 81clean:82 del /q /f *.exe *.obj examples\*.obj83 84# End of Makefile.msvc85