# makefile to compile MCPP version 2.7.1 and later for Visual C / nmake # 2008/11 kmatsui # You must first edit BINDIR, LIBDIR and INCDIR according to your system. # To make compiler-independent-build of MCPP do: # nmake # To make Visual-C-specific-build of MCPP do: # nmake COMPILER=MSC # To re-compile MCPP using Visual-C-specific-build of MCPP do: # nmake COMPILER=MSC PREPROCESSED=1 # To link kmmalloc V.2.5.3 (malloc() package of kmatsui) or later do: # (Note: Visual C 2005 and 2008 cannot coexist with kmmalloc) # nmake [PREPROCESSED=1] KMMALLOC=1 # To make mcpp.lib (subroutine-build of mcpp) do: # nmake MCPP_LIB=1 mcpplib # nmake MCPP_LIB=1 mcpplib_install # To make testmain.c (sample to use mcpp.lib) against mcpp.lib do # (add 'DLL_IMPORT=1' to link against the DLL): # nmake [OUT2MEM=1] testmain # nmake [OUT2MEM=1] testmain_install # To use this Makefile in IDE of Visual C, include $(targ)_install target # in $(targ) target, since the IDE can't handle install target. NAME = mcpp CC = cl CFLAGS = $(CFLAGS) -Za -c # -Zi # Add -Zi for debugging on Visual C / IDE LINKFLAGS = -Fe$(NAME) # -Zi CPPFLAGS = $(CPPFLAGS) -D_CRT_SECURE_NO_DEPRECATE # -Za # -D_CRT_SECURE_NO_DEPRECATE for Visual C 2005, 2008 # -Za should not be specified for compiler-independent-built MCPP !if "$(COMPILER)"=="MSC" CPPFLAGS = $(CPPFLAGS) -DCOMPILER=MSC # BINDIR : Adjust to your system. # for Visual C 2003 #BINDIR = "$(MSVCDIR)"\bin # for Visual C 2005, 2008 BINDIR = "$(VCINSTALLDIR)"\bin !else # compiler-independent-build: use compiler-independent directory BINDIR = \PUB\bin !endif !ifdef KMMALLOC MEM_MACRO = -DKMMALLOC -D_MEM_DEBUG -DXMALLOC MEMLIB = kmmalloc_debug.lib !else MEM_MACRO = MEMLIB = !endif OBJS = main.obj directive.obj eval.obj expand.obj support.obj system.obj \ mbchar.obj $(NAME).exe : $(OBJS) $(CC) $(LINKFLAGS) $(OBJS) $(MEMLIB) #install : # Visual C++ / IDE "makefile project" does not have "make install" command copy /b $(NAME).exe $(BINDIR)\$(NAME).exe !ifdef PREPROCESSED # make a "pre-preprocessed" header file to recompile MCPP with MCPP. mcpp.H : system.H internal.H $(BINDIR)\$(NAME) $(CPPFLAGS) $(LANG) $(MEM_MACRO) preproc.c mcpp.H $(OBJS) : mcpp.H system.H: noconfig.H !else $(OBJS) : noconfig.H main.obj directive.obj eval.obj expand.obj support.obj system.obj mbchar.obj: \ system.H internal.H !endif !ifdef PREPROCESSED .c.obj : $(BINDIR)\$(NAME) -DPREPROCESSED $(CPPFLAGS) $< $(