home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 1.ddi / CLIBSRC.ZIP / CLIB.MAK < prev    next >
Encoding:
Text File  |  1992-06-10  |  3.2 KB  |  142 lines

  1. # CLIB.MAK
  2. #
  3. # To compile all changed modules and replace (or add) both old and new objects
  4. # in an existing (or new) library, type
  5. #
  6. #       MAKE all
  7. #
  8. # To clean up (i.e., delete) all object files and temporary files, type
  9. #
  10. #       MAKE -DTARGET clean
  11. #
  12. # The memory model must be specified in one of two ways.  You can
  13. # set the environment variable MODEL before running MAKE:
  14. #
  15. #       SET MODEL=x
  16. #
  17. # or you can use the -D command line switch:
  18. #
  19. #       MAKE -DMODEL=x
  20. #
  21. # where x is the letter s, c, m, l, or h.  Using -D overrides the
  22. # environment variable.
  23. #
  24. # To make a library for Windows, use -DWINDOWS on the command line.
  25. # To make a DLL for Windows, use -DWINDLL.
  26. # To make an import library for Windows, use -DIMPORT.
  27.  
  28. !if $d(WINDLL)
  29. MODEL = l
  30. !endif
  31.  
  32. !if !$d(MODEL)
  33. !error MODEL not defined. Use -DMODEL=x on command line, or SET MODEL=x.
  34. !endif
  35.  
  36. !if '$(MODEL)'=='h' && $d(WINDOWS)
  37.  
  38. all :
  39.         echo Can't make a huge model WINDOWS library
  40.  
  41. clean :
  42.         echo Can't clean up a huge model WINDOWS library
  43.  
  44. !else
  45.  
  46. # ALL - compile changed sources and add all objects (old and new) to library
  47.  
  48. all :   compile archive
  49.  
  50. !if $d(WINDOWS)
  51.  
  52. LIBNAME = cw$(MODEL)
  53. OBJDIR  = w$(MODEL)
  54. TC      = $(TC) +..\winlib\turboc.cfg
  55. TASM    = tasm -D_Windows -D_WINDOWS -o
  56. OBJECTS = lib1 lib2 lib3 lib5
  57.  
  58. !elif $d(WINDLL)
  59.  
  60. LIBNAME = crtldll
  61. OBJDIR  = ..\winlib\d
  62. TC      = $(TC) +..\winlib\tcdll.cfg
  63. TASM    = tasm -D_Windows -D_WINDOWS -D_BUILDRTLDLL -o
  64. OBJECTS = lib1 lib2 lib3 lib5
  65.  
  66. !else
  67.  
  68. LIBNAME = c$(MODEL)
  69. OBJECTS = lib1 lib2 lib3 lib4 lib5
  70.  
  71. !endif
  72.  
  73. !include "..\rules.mak"
  74.  
  75. !include "clibobj.mak"
  76.  
  77. lib1 : $(OBJS1)
  78. lib2 : $(OBJS2)
  79. lib3 : $(OBJS3)
  80. lib4 : $(OBJS4)
  81. lib5 : $(OBJS5)
  82.  
  83. # gregistr.obj cannot be built in tiny model.
  84.  
  85. !if '$(MODEL)'=='s' && !$d(WINDOWS) && !$d(WINDLL)
  86. gregistr.obj: gregistr.c
  87.         $(TC) -ms -n$(OBJDIR) $?
  88. !endif
  89.  
  90. # ARCHIVE - add all objects to a new library.
  91.  
  92. !if $d(WINDLL)
  93.  
  94. archive :
  95.         makersp "%s\n" &&|
  96.         $(OBJS5)
  97. |       >> ..\winlib\dllmak.rsp
  98.         makersp "+%s &\n" &&|
  99.         $(OBJS1)
  100.         $(OBJS2)
  101.         $(OBJS3)
  102. |       > clibmak.rsp
  103.         if exist $(LIBDIR)\$(LIBNAME).lib del $(LIBDIR)\$(LIBNAME).lib
  104.         cd ..\winlib\d
  105.         $(TLIB) ..\$(LIBDIR)\$(LIBNAME) /C @..\..\clib\clibmak.rsp,nul
  106.         if exist ..\$(LIBDIR)\*.bak del ..\$(LIBDIR)\*.bak
  107.         cd ..\..\clib
  108.         del *.rsp
  109.  
  110. !elif $d(WINDOWS)
  111.  
  112. archive :
  113.         if exist $(LIBDIR)\$(LIBNAME).lib del $(LIBDIR)\$(LIBNAME).lib
  114.         makersp "+$(OBJDIR)\\\\%s &\n" &&|
  115.         $(OBJS1)
  116.         $(OBJS2)
  117.         $(OBJS3)
  118.         $(OBJS5)
  119. |       > clibmak.rsp
  120.         $(TLIB) $(LIBDIR)\$(LIBNAME) /C @clibmak.rsp,nul
  121.         if exist $(LIBDIR)\*.bak del $(LIBDIR)\*.bak
  122.         del *.rsp
  123.  
  124. !else
  125.  
  126. archive :
  127.         if exist $(LIBDIR)\$(LIBNAME).lib del $(LIBDIR)\$(LIBNAME).lib
  128.         makersp "+$(OBJDIR)\\\\%s &\n" &&|
  129.         $(OBJS1)
  130.         $(OBJS2)
  131.         $(OBJS3)
  132.         $(OBJS4)
  133.         $(OBJS5)
  134. |       > clibmak.rsp
  135.         $(TLIB) $(LIBDIR)\$(LIBNAME) /C @clibmak.rsp,nul
  136.         if exist $(LIBDIR)\*.bak del $(LIBDIR)\*.bak
  137.         del *.rsp
  138.  
  139. !endif          # if $d(WINDLL)
  140.  
  141. !endif          # if huge model WINDOWS
  142.