home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 3.ddi / BATSRC.ZIP / RULES.MAK < prev    next >
Encoding:
Text File  |  1992-06-10  |  2.3 KB  |  99 lines

  1. # RULES.MAK - rules for compiling and building libraries
  2. #
  3. # This file is intended to be !included in a makefile.
  4. # If the following MAKE macros are not defined, they will be
  5. # assigned default values as described below:
  6. #
  7. #       MODEL   memory model, default s
  8. #       SRCDIR  source directory, default .
  9. #       OBJDIR  object directory, default $(MODEL)
  10. #       LIBDIR  library directory, default ..\lib
  11. #       LIBNAME name of library without path or extension, default c$(MODEL)
  12. #       OBJECTS list of objects that LIBNAME depends on, without path or
  13. #               extension.  If this list is too large for MAKE, use a list
  14. #               of fake targets that depend on sublists of object files.
  15. #       TC      name of the compiler, default bcc
  16. #       TASM    name of the assembler, default tasm
  17. #       TLIB    name of the librarian, default tlib /0
  18.  
  19. !if $d(SWAP)
  20. .swap
  21. !endif
  22.  
  23. !if !$d(MODEL)
  24. MODEL = s
  25. !endif
  26.  
  27. !if !$d(SRCDIR)
  28. SRCDIR = .
  29. !endif
  30.  
  31. !if !$d(OBJDIR)
  32. OBJDIR = $(MODEL)
  33. !endif
  34.  
  35. !if !$d(LIBDIR)
  36. LIBDIR = ..\lib
  37. !endif
  38.  
  39. !if !$d(LIBNAME)
  40. LIBNAME = c$(MODEL)
  41. !endif
  42.  
  43. !if !$d(TC)
  44. TC = bcc
  45. !endif
  46.  
  47. !if !$d(TASM)
  48. TASM = tasm
  49. !endif
  50.  
  51. !if !$d(TLIB)
  52. TLIB = tlib /0
  53. !endif
  54.  
  55. # If this is small model, compile C modules in TINY model
  56. # to avoid segment fixups in the object files.  This is necessary
  57. # because the small model library is used for both small and tiny
  58. # model programs.
  59.  
  60. !if '$(MODEL)'=='s' && !$d(WINDOWS)
  61. CMODEL = t
  62. !else
  63. CMODEL = $(MODEL)
  64. !endif
  65.  
  66. !if '$(SRCDIR)' != '.'
  67. .path.c   = $(SRCDIR)
  68. .path.cpp = $(SRCDIR)
  69. .path.cas = $(SRCDIR)
  70. .path.asm = $(SRCDIR)
  71. !endif
  72. .path.obj = $(OBJDIR)
  73. .path.lib = $(LIBDIR)
  74.  
  75. # How to compile modules.  For C modules, we just build a response
  76. # file that is passed to BCC later.  We also add the name to the
  77. # TLIB response file.
  78.  
  79. .c.obj :
  80.         $(TC) -m$(CMODEL) -n$(OBJDIR) { $<}
  81.  
  82. .cpp.obj :
  83.         $(TC) -m$(CMODEL) -n$(OBJDIR) { $<}
  84.  
  85. .cas.obj :
  86.         $(TC) -m$(CMODEL) -n$(OBJDIR) { $<}
  87.  
  88. .asm.obj :
  89.         $(TASM) -D__$(MODEL)__ $< , $(OBJDIR)\\
  90.  
  91. compile : $(OBJECTS)
  92.  
  93. clean :
  94.         echo Deleting all $(MODEL)-model libraries and objects
  95.         del $(OBJDIR)\*.obj
  96.         del $(LIBDIR)\$(LIBNAME).lib
  97.         del $(LIBDIR)\*.bak
  98.         del *.rsp
  99.