home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / primcuts.zip / DebugTerminal / sample / makefile < prev    next >
Makefile  |  2000-06-25  |  2KB  |  82 lines

  1. .SUFFIXES:
  2. .SUFFIXES: .c .obj .h .rc .res .def .exe
  3.  
  4. # Don't echo commands
  5. .SILENT:
  6.  
  7. BASENAME = TestApplication
  8.  
  9.  
  10. # terminal - include debug code and debug terminal
  11. # yes - include debug code
  12. # no - no debug code, fully optimized
  13. DEBUG = terminal
  14.  
  15. !if "$(DEBUG)" == "yes" || "$(DEBUG)" == "terminal"
  16. CC_DBG = /Ti+ /Tx+ /O-
  17. !if "$(DEBUG)" == "terminal"
  18. CC_TERM = /DDEBUG
  19. !endif
  20. !else
  21. CC_DBG = /Ti- /O+ /G5 /Gi+ /Gf+
  22. !endif
  23.  
  24.  
  25. .c.obj:
  26.    icc /C /Gd+ /Gm+ $(CC_DBG) $(CC_TERM) /Q+ /Wall+ppc-ppt- %s
  27.  
  28.  
  29. #.c.obj:
  30. #!IFDEF DEBUG
  31. #!  IF "$(DEBUG)" == "yes"
  32. #       @icc /C /Gd+ /Gm+ /Ti+ /Tx+ /O- /Q+ /Wall+ppc-ppt- %s
  33. #!  ELIF "$(DEBUG)" == "terminal"
  34. #       @icc /C /Gd+ /Gm+ /Ti+ /Tx+ /O- /Q+ /DDEBUG /Wall+ppc-ppt- %s
  35. #!  ELSE
  36. #       @icc /C /Gd+ /Gm+ /G5 /Gi+ /Gf+ /Ti- /O+ /Q+ /Wall+ppc-ppt- %s
  37. #!  ENDIF
  38. #!ELSE
  39. #!  ERROR DEBUG macro is not defined.
  40. #!ENDIF
  41.  
  42.  
  43. .rc.res:
  44.        @rc -n -r -i . %s
  45.  
  46. OBJS = $(BASENAME).obj ClientWindow.obj
  47.  
  48. all: $(BASENAME).exe
  49.  
  50. $(BASENAME).obj: $(@B).c resource.h
  51.  
  52. ClientWindow.obj: $(@B).c resource.h
  53.  
  54. $(BASENAME).res: $(@B).rc resource.h $(@B).ico
  55.  
  56. $(BASENAME).exe: $(OBJS) $(@B).res $(@B).def
  57.    ilink /nologo @<<
  58.    /noinformation /exec /out:$(@B) /map:$(@B)
  59. !if "$(DEBUG)" == "yes" || "$(DEBUG)" == "terminal"
  60.    /debug
  61. !elif "$(DEBUG)" == "no"
  62.    /exepack:2 /nodebug /optfunc
  63. !else
  64. !error DEBUG macro error.
  65. !endif
  66.    $(OBJS)
  67.    $(@B).def
  68. <<
  69.    rc -x2 -n $(@B).res $@
  70.    dllrname /Q /R $@ cppom30=os2om30
  71.    pkzip /add /silent last_successful_build *.c *.h *.rc *.def makefile
  72.  
  73.  
  74.  
  75. clean:
  76.    del *.obj
  77.    del *.res
  78.    del *.exe
  79.    del *.map
  80.    del last_successful_build.zip
  81.  
  82.