Previous Topic: Security ProcessingNext Topic: Overview of an Example Makefile for UNIX


Overview of an Example Makefile for Windows

The steps used to compile and link your C/C++ application vary depending on the environment chosen. The example makefile shown may require modifications to work in your environment.

Note: Setup the compiler environment before executing the makefile using %VS100COMNTOOLS%vsvars32.bat for Visual Studio 2010 and %VS110COMNTOOLS%vsvars32.bat for Visual Studio 2012. If building a 64-bit application, you will also need to execute %VSINSTALLDIR%vcvarsall.bat x64.

Description

Example Makefile

Clean up previous files and set command values.

ALL : "cproxy.obj" "cproxy.exe" makeok


CLEAN :
  -@erase "cproxy.obj"
  -@erase "cproxy.exe"

-@erase "cproxy.pdb"

-@erase "cproxy.sbr"
  @echo Example C Proxy program: clean done

 
CPP=cl.exe
CPP_PROJ=/nologo /I"$(IEFH)" -DWIN32 /MD /W3 /Gm /GX /Zi /Od /D "WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /Fo /Fd /FD /c

Dependencies - this is definitely not required in the standard makefile, but is shown here for completeness.

CPP_DEP=\
  ".\p900.h"\
  {$(IEFH)}"cisrvtcp.h"\
  {$(IEFH)}"ciconst.h"\
  {$(IEFH)}"citrantb.h"\
  {$(IEFH)}"civewdef.h"\
  {$(IEFH)}"proxycfg.h"\
  {$(IEFH)}"proxyexe.h"\
  {$(IEFH)}"proxytrc.h"\
  {$(IEFH)}"proxyxit.h"

Compile definition

.c .obj::
   $(CPP) $(CPP_PROJ) $(<R).c

Link definition - The libraries you link with are csuxxn.lib and pxrtxxn.lib in the CA Gen directory.

Note: xx refers to the current release of CA Gen. For the current release number, see the Release Notes.

Note: YYY refers to either X86 for 32-bit or X64 for 64-bit.

LINK32=link.exe

 
LINK32_FLAGS=”$(IEFH)\csuxxn.lib” “$(IEFH)\pxrtxxn.lib” /nologo\
/subsystem:console /incremental:no /debug /machine:YYY/out:"cproxy.exe"\

LINK32_OBJS="cproxy.obj"

Executable definition

"cproxy.exe": $(LINK32_OBJS) $(CPP_DEP)
  $(LINK32) $(LINK32_FLAGS) $(LINK32_OBJS)

Completion message

makeok :
  @echo C Proxy API program make successful.