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.win < prev    next >
Encoding:
Makefile  |  1995-11-14  |  2.4 KB  |  92 lines

  1. #*************************************************************#
  2. #**                                                         **#
  3. #**                 Microsoft RPC Examples                  **#
  4. #**                   mandel Application                    **#
  5. #**            Copyright(c) Microsoft Corp. 1992-1995       **#
  6. #**                                                         **#
  7. #*************************************************************#
  8.  
  9. # The same source code is used to build either a standalone version
  10. # or an RPC client of the Microsoft Windows (R) Mandelbrot sample
  11. # application.  The flag RPC determines which version is built.
  12. # To build a standalone version, use the command
  13. #     >nmake cleanall
  14. #     >set NOTRPC=1
  15. #     >nmake
  16. # To build the RPC client, use the commands:
  17. #     >nmake cleanall
  18. #     >set NOTRPC=
  19. #     >nmake
  20.  
  21. !ifdef NOTRPC
  22. RPCFLAG =
  23. !else
  24. RPCFLAG = -DRPC
  25. !endif
  26.  
  27. cc= cl
  28. cflags= -c -AL -Gsw -Oas -Zpe -Zi
  29. linker= link
  30. lflags= /CO /NOD
  31.  
  32. .c.obj:
  33.    $(cc) $(cflags) -DWIN16 $(RPCFLAG) $<
  34.  
  35. !ifdef NOTRPC
  36. all: mandel.exe
  37. !else
  38. all: client.exe
  39. idl: mdlrpc.h
  40. !endif
  41.  
  42. # Update the resource if necessary
  43. mandel.res: mandel.rc mandel.h
  44.     rc -r mandel.rc
  45.  
  46. # Update the executable file if necessary, and if so, add the resource back in.
  47. mandel: mandel.exe
  48. mandel.exe: mandel.obj remote.obj calc.obj mandel.def mandel.res
  49.     $(linker) $(lflags) mandel remote calc, mandel.exe, , \
  50.     libw llibcew, mandel.def
  51.     rc mandel.res mandel.exe
  52.  
  53. client: client.exe
  54. client.exe: mandel.obj remote.obj mdlrpc_c.obj mandel.def mandel.res
  55.     $(linker) $(lflags) mandel remote mdlrpc_c, client.exe, , \
  56.     libw llibcew rpcw rpcndrw, mandel.def
  57.     rc mandel.res client.exe
  58.  
  59. # Compile differently for RPC and standalone versions
  60.  
  61. !ifdef NOTRPC
  62. mandel.obj: mandel.c mandel.h
  63.  
  64. remote.obj: remote.c mandel.h
  65.  
  66. calc.obj  : calc.c mandel.h
  67.  
  68. !else
  69. mandel.obj: mandel.c mandel.h mdlrpc.h
  70.  
  71. remote.obj: remote.c mandel.h mdlrpc.h
  72.  
  73. mdlrpc_c.obj : mdlrpc_c.c mdlrpc.h
  74.     $(cc) $(cflags) mdlrpc_c.c
  75.  
  76. !endif
  77.  
  78. mdlrpc.h mdlrpc_c.c : mdlrpc.idl mdlrpc.acf
  79.    midl -oldnames -env win16 -cpp_cmd $(cc) -cpp_opt "-E" mdlrpc.idl
  80.  
  81. # Clean up everything
  82. cleanall : clean
  83.     -del *.exe
  84.  
  85. # Clean up everything but the .EXEs
  86. clean :
  87.     -del *.obj
  88.     -del *.map
  89.     -del mandel.res
  90.     -del mdlrpc_c.c
  91.     -del mdlrpc.h
  92.