home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / os9 / 1624 < prev    next >
Encoding:
Text File  |  1993-01-21  |  4.6 KB  |  107 lines

  1. Newsgroups: comp.os.os9
  2. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!torn!watserv2.uwaterloo.ca!watserv1!babbage.uwaterloo.ca!bcwhite
  3. From: bcwhite@babbage.uwaterloo.ca (Brian C. White)
  4. Subject: GCC Makefile
  5. Message-ID: <C17nC2.1Kt@watserv1.uwaterloo.ca>
  6. Sender: news@watserv1.uwaterloo.ca
  7. Organization: University of Waterloo
  8. Date: Thu, 21 Jan 1993 15:36:01 GMT
  9. Lines: 96
  10.  
  11. Some people have been saying that they can't get GCC or GPP to work with
  12. the standard Microware 'make' utility.  I've included my makefile template
  13. below.
  14.  
  15. The uWare 'make' is not nearly so bad as people claim.  I havn't found a
  16. task where it won't work with a little message.  There are also some
  17. features of it which are undocumented.  For example you can, unlike v7make,
  18. redefine the builtin rules for making ".r" files from ".c" files.  Also,
  19. the first line of the makefile is read as though it was put on the command
  20. line (I usually put "-bo" on the first line for this reason).
  21.  
  22. Anyway, here is my makefile template...  To use GPP, just change $(CC).
  23.  
  24. -bo
  25. ******************************************************************************
  26. **
  27. **   MyProject -- MakeFile
  28. **
  29.  
  30. SDIR = /wherever                # Directory where source files can be found
  31. ODIR = /R0                      # Directory where output files are to be kept
  32. LIB  = /DD/LIB                  # Directory where library files can be found
  33. DDIR = /DD/DEFS                 # Directory where .h files can be found
  34. RDIR = /H2/RELS/wherever        # Directory where .r files are to be kept
  35. TDIR = /R0                      # Directory where temp files are to be kept
  36.  
  37. CC      = gcc                                           # Use GCC
  38. #CDEBUG = -fomit-frame-pointer                          # Debug flags
  39. CDEBUG  = -DDEBUG -g -W                                 # Debug flags
  40. CINCL   =                                               # Extra header file dir
  41. COPTS   =                                               # Compiler options
  42. COPTMZ1 = -o68 -O -fstrength-reduce -fforce-mem         # Compiler optimization
  43. COPTMZ2 = -fcombine-regs -fdefer-pop                    # Compiler optimization
  44. COPTMZ  = $(COPTMZ1) $(COPTMZ2)                         # Compiler optimization
  45. #COPTMZ =                                               # Compiler optimization
  46. CFLAGS  = $(CDEBUG) $(COPTS) $(COPTMZ) $(CINCL)         # All flags together
  47.  
  48. ASM     = r68                                           # Assembler program
  49. AFLAGS  = -q                                            # Assembler flags
  50.  
  51. LMODULE = -e=1 -p=0555                                  # Module settings
  52. LOPTS   =                                               # Link options
  53. LLIBS   = -L$(LIB)/GCC -L$(LIB)/USR                     # More lib dirs
  54. LFLAGS  = $(LOPTS)
  55.  
  56. P2C     = p2c                                           # Pascal preprocessor
  57.  
  58. STDLIBS = -l=$(LIB)/GCC/gnulib.l -l=$(LIB)/clibn.l -l=$(LIB)/math.l -l=$(LIB)/usr.l
  59. CPPLIBS = -l=$(LIB)/GCC/libgpp.l -l=$(LIB)/GCC/gpp.l    # C++ libraries
  60. CIO     = -l=$(LIB)/cio.l                               # Use CIO
  61. CGFX    = -l=$(LIB)/USR/cgfx.l                          # Graphic routines
  62. PLIB    = -l=$(LIB)/P2C/libp2c.l                        # Pascal (p2c)
  63. RAND    = -l=$(LIB)/USR/rand.l                          # Random numbers
  64. CURSES  = -l=$(LIB)/USR/effocurses.l                    # Curses
  65. TERMCAP = -l=$(LIB)/termlib.l                           # Termcap
  66. BLARSLIB= -l=$(LIB)/USR/blarslib.l                      # B.Larson Unix stuff
  67. OS9LIB  = -l=$(LIB)/USR/os9lib.l                        # OS9 Unix stuff
  68.  
  69. OFLAGS  = $(CPPLIBS)                                    # "Collect" (GPP) flags
  70.  
  71. *----------------------------------------------------------------------------*
  72.  
  73. maze:       maze.r
  74.             l68 $(LIB)/cstart.r $(RDIR)/$*.r $(CGFX) $(RAND) $(STDLIBS) \
  75.             -e=1 -p=0555 -o=$(ODIR)/$@
  76.  
  77. stformat:   stformat.r
  78.             l68 $(LIB)/cstart.r $(RDIR)/$*.r $(STDLIBS) \
  79.             -l=/dd/usr/dcmd.l -e=1 -p=0555 -o=$(ODIR)/$@
  80.  
  81. vt100:      vt100.r
  82.             l68 $(LIB)/cstart.r $(RDIR)/$*.r $(STDLIBS) \
  83.             -e=1 -p=0555 -o=$(ODIR)/$@
  84.  
  85. alias:      dummy.r
  86.             l68 $(RDIR)/dummy.r -o=$(ODIR)/$@ -l=$(LIB)/usr.l
  87.  
  88. cleantdir:  always
  89.             @dir $(TDIR) >-$(TDIR)/mydir
  90.             del $(TDIR)/*
  91.  
  92. *----------------------------------------------------------------------------*
  93.  
  94. .c.r:
  95.     $(CC) $*.c -c -o $(RDIR)/$*.r $(CFLAGS)
  96. .c.a:
  97.     $(CC) $*.c -c -o $(TDIR)/$*.a $(CFLAGS) -S
  98. .a.r:
  99.     r68 $*.a -o=$(RDIR)/$*.r 
  100. .p.r:
  101.     $(P2C) $*.p -v -o $(TDIR)/$*.c #16k
  102.     $(CC) $(TDIR)/$*.c -c -o $(RDIR)/$*.r $(CFLAGS)
  103.  
  104. vt100.r:    vt100.c
  105. dummy.r:    dummy.a
  106.  
  107.