home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / CPG.ZIP / MAKEFILE < prev   
Encoding:
Text File  |  1987-04-10  |  2.3 KB  |  88 lines

  1. ######################################################
  2. #    Makefile for cpg
  3. #        may require slight modifying for
  4. #        some dos make's, will require a change
  5. #        for unix make (.c.o inference)
  6. #        for different compilers, just change the
  7. #        CC, LD, LIB, and flags options.
  8. #
  9. ######################################################
  10.  
  11. #    some system defaults
  12. #
  13. CC=\msc\msc
  14. LD=\msc\cl
  15. SRCLIST=nul.lst
  16. OBJLIST=nul.cod
  17. ASMLIST=
  18. LIB=c:\msc\lib\small\slibc
  19. # LINKFLAGS = -STACK:4000 -NOI -CPARMAXALLOC:1
  20. LINKFLAGS = 
  21. CFLAGS =
  22.  
  23. ######################################################
  24. #    Now, for some definitions 
  25. ######################################################
  26. #    this will allow us to build arc files for distibution
  27. #    
  28. ARCPROD = cpg.arc
  29. #
  30. #    this isn't alwasy needed, but for arc's it's nice
  31. DOC = cpg.doc
  32. MAKEFILE = makefile
  33.  
  34. ######################################################
  35. #    this is a key entry, it's what we want when we're done
  36. ######################################################
  37. PRODUCT=cpg.exe
  38.  
  39. ######################################################
  40. #    what we have to work with
  41. #
  42. SRC = cpg.c getopt.c
  43.  
  44. ######################################################
  45. #    what we want the intermediates to be
  46. #
  47. OBJS = cpg.obj getopt.obj
  48.  
  49. ######################################################
  50. #    how we convert the SRC to OBJ
  51. #
  52. *.obj : *.c
  53.         $(CC) $(CFLAGS) $*.c,$*.obj,$(SRCLIST),$(OBJLIST);
  54.  
  55. ######################################################
  56. #    placed here for some compatibility with odd make's
  57. all:    $(PRODUCT)
  58.  
  59. ######################################################
  60. #    finally, how we get from the OBJ's to the final executable
  61. #
  62. $(PRODUCT):        $(OBJS)
  63.     $(LD)  $(LINKFLAGS) -Fo$(PRODUCT) $(OBJS) -link $(LIB);
  64.  
  65.     
  66. ######################################################
  67. #    a little house cleaning...
  68. #
  69. clean:
  70.     del  *.lst
  71.     del  *.cod
  72.     del  *.obj
  73.     del  $(PRODUCT) err
  74.  
  75. ######################################################
  76. #    arc maint for distribution
  77. #    NOTE:    because of the dependancy on $(MAKEFILE)
  78. #        if it is touched, arc will force a complete
  79. #        recompile to insure a current copy for
  80. #        re-distribution!!  
  81. #
  82. arc: $(PRODUCT) $(SRC) $(MAKEFILE) $(DOC)
  83.     del $(ARCPROD)
  84.     arc a $(ARCPROD) $(PRODUCT) 
  85.     arc a $(ARCPROD) $(SRC) 
  86.     arc a $(ARCPROD) $(MAKEFILE) 
  87.     arc a $(ARCPROD) $(DOC)
  88.