home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / rpc / mandel / makefile < prev    next >
Encoding:
Makefile  |  1997-10-15  |  3.0 KB  |  103 lines

  1. #*************************************************************#
  2. #**                                                         **#
  3. #**                 Microsoft RPC Examples                  **#
  4. #**               Mandelbrot RPC Application                **#
  5. #**            Copyright(c) Microsoft Corp. 1991-1995       **#
  6. #**                                                         **#
  7. #*************************************************************#
  8. # The same source code is used to build either a standalone
  9. # or an RPC version of the Microsoft Windows (R) Mandelbrot
  10. # sample application.  The flag RPC determines which version
  11. # is built.  To build a standalone version, use the commands:
  12. #     >nmake cleanall
  13. #     >set NOTRPC=1
  14. #     >nmake
  15. # To build the RPC version, use the commands:
  16. #     >nmake cleanall
  17. #     >set NOTRPC=
  18. #     >nmake
  19. !include <ntwin32.mak>
  20.  
  21. !if "$(CPU)" == "i386"
  22. cflags = $(cflags) -D_CRTAPI1=_cdecl -D_CRTAPI2=_cdecl
  23. !else
  24. cflags = $(cflags) -D_CRTAPI1= -D_CRTAPI2=
  25. !endif
  26.  
  27. !ifdef NOTRPC
  28. RPCFLAG =
  29. !else
  30. RPCFLAG = -DRPC
  31. !endif
  32.  
  33. .c.obj:
  34.    $(cc) $(cdebug) $(cflags) $(cvarsdll) $(RPCFLAG) $<
  35.  
  36. # Targets
  37. # The RPC version produces client and server executables.
  38. # The standalone version produces a single exe file, "mandel".
  39.  
  40. !ifndef NOTRPC
  41. all: client.exe server.exe
  42. !else
  43. all: mandel.exe
  44. !endif
  45.  
  46. mandel.exe: mandel.obj remote.obj mandel.def mandel.rbj calc.obj
  47.     $(link) $(linkdebug) $(guiflags) -out:mandel.exe -map:mandel.map \
  48.       mandel.obj remote.obj calc.obj mandel.rbj $(guilibsdll)
  49.  
  50. client.exe: mandel.obj remote.obj mandel.def mandel.rbj mdlrpc_c.obj
  51.     $(link) $(linkdebug) $(guiflags) -out:client.exe -map:client.map \
  52.       mandel.obj remote.obj mdlrpc_c.obj \
  53.       mandel.rbj rpcrt4.lib $(guilibsdll)
  54.  
  55. server.exe: server.obj calc.obj mdlrpc_s.obj
  56.     $(link) $(linkdebug) $(conflags) -out:server.exe -map:server.map \
  57.       server.obj calc.obj mdlrpc_s.obj \
  58.       rpcrt4.lib $(conlibsdll)
  59.  
  60. # Update the resource if necessary
  61. mandel.rbj: mandel.rc mandel.h
  62.     rc -r mandel.rc
  63.     cvtres -$(CPU) mandel.res -o mandel.rbj
  64.  
  65. # Object file dependencies
  66.  
  67. # server only built for RPC version; always needs mdlrpc.h
  68. server.obj: server.c mandel.h mdlrpc.h
  69.  
  70. # Compile differently for RPC, standalone versions
  71. !ifndef NOTRPC
  72. mandel.obj: mandel.c mandel.h mdlrpc.h
  73. remote.obj: remote.c mandel.h mdlrpc.h
  74. calc.obj  : calc.c mandel.h mdlrpc.h
  75. !else
  76. mandel.obj: mandel.c mandel.h
  77. remote.obj: remote.c mandel.h
  78. calc.obj  : calc.c mandel.h
  79. !endif
  80.  
  81. # client stub
  82. mdlrpc_c.obj : mdlrpc_c.c mdlrpc.h
  83.  
  84. # server stub file
  85. mdlrpc_s.obj : mdlrpc_s.c mdlrpc.h
  86.  
  87. # Stubs and header file from the IDL file
  88. mdlrpc.h mdlrpc_c.c mdlrpc_s.c: mdlrpc.idl mdlrpc.acf
  89.     midl -oldnames -cpp_cmd $(cc) -cpp_opt "-E" mdlrpc.idl
  90.  
  91. clean:
  92.     -del client.exe
  93.     -del server.exe
  94.     -del mandel.exe
  95.  
  96. cleanall:  clean
  97.     -del *.obj
  98.     -del *.map
  99.     -del *.res
  100.     -del *.rbj
  101.     -del mdlrpc_*.c
  102.     -del mdlrpc.h
  103.