home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Source / GNU / cc / bison / Makefile < prev    next >
Makefile  |  1992-06-24  |  4KB  |  132 lines

  1. # Makefile for bison
  2.  
  3. # root directory for temporary files
  4. OBJROOT = .
  5.  
  6. # place where .o files are put
  7. OFILE_DIR = $(OBJROOT)/obj
  8.  
  9. # root directory for place where symbols and other precious derived files are kept
  10. SYMROOT = .
  11.  
  12. # place to look for dependents
  13. VPATH = $(OFILE_DIR)
  14.  
  15. PRODUCT= bison
  16. DESTDIR=
  17. # where the installed binary goes
  18. BINDIR = $(DESTDIR)/usr/local/bin
  19. IFLAGS = -s
  20.  
  21. # where the parsers go
  22. PARSERDIR = $(DESTDIR)/usr/local/lib
  23.  
  24. # names of parser files
  25. PFILE = bison.simple
  26. PFILE1 = bison.hairy
  27.  
  28. # It is unwise ever to compile a program without symbols.
  29. CFLAGS = -bsd -g
  30.  
  31. PFILES = -DXPFILE=\"$(PARSERDIR)/$(PFILE)\" \
  32.      -DXPFILE1=\"$(PARSERDIR)/$(PFILE1)\"
  33.  
  34. CFILES = LR0.c allocate.c closure.c conflicts.c derives.c files.c    \
  35.       getargs.c gram.c lalr.c lex.c                    \
  36.       main.c nullable.c output.c print.c reader.c reduce.c symtab.c    \
  37.       warshall.c version.c                        \
  38.       getopt.c
  39.  
  40. HFILES = files.h gram.h lex.h machine.h new.h state.h symtab.h types.h
  41.  
  42. INSTALL_FILES = Makefile $(CFILES) $(HFILES) bison.hairy bison.simple
  43.  
  44. OBJS = $(CFILES:.c=.o) vers.o
  45.  
  46. all: bison.NEW
  47.  
  48.  
  49. #
  50. # Building PRODUCT
  51. #
  52.  
  53. $(OFILE_DIR) $(SYMROOT):
  54.     mkdirs $@
  55.  
  56. ${PRODUCT}.NEW: $(OFILE_DIR) ${OBJS} $(SYMROOT)
  57.     $(CC) $(CFLAGS) $(RC_CFLAGS) -o $(SYMROOT)/$@ ${OBJS} ${LIBS} -lsys_s
  58.  
  59. vers.c:
  60.     @rm -f $@
  61.     vers_string -c ${PRODUCT} > $(OFILE_DIR)/$@
  62.  
  63. .c.o:
  64.     $(CC) $(CFLAGS) $(RC_CFLAGS) -c $*.c -o $(OFILE_DIR)/$*.o
  65.  
  66. #
  67. # Standard targets
  68. #
  69. ${PRODUCT}:    $$@.NEW
  70.  
  71. clean:    
  72.     -/bin/rm -rf obj
  73.     -rm -f *.o *.NEW vers.c
  74.     -rm -f ${PRODUCT} ${DERIVED} ${INTERMEDIATES} ${GARBAGE}
  75.     -rm -f Makedep
  76.     touch Makedep
  77.  
  78. install: ${DSTROOT}${BINDIR} ${DSTROOT}$(PARSERDIR) all
  79.     install -m 555 ${IFLAGS} $(SYMROOT)/bison.NEW ${DSTROOT}${BINDIR}/${PFX}bison
  80.     cp $(PFILE) $(PFILE1) ${DSTROOT}$(PARSERDIR)
  81.     chmod 444 ${DSTROOT}${PARSERDIR}/${PFILE}
  82.     chmod 444 ${DSTROOT}${PARSERDIR}/${PFILE1}
  83.  
  84. installsrc installGNUsrc:
  85.     mkdirs $(SRCROOT)
  86.     chmod 755 $(SRCROOT)
  87.     tar cf - $(INSTALL_FILES) | (cd $(SRCROOT); tar xf -)
  88.     chmod 444 $(SRCROOT)/*
  89.  
  90. ${DSTROOT}${BINDIR} ${DSTROOT}$(PARSERDIR):; mkdirs $@
  91.  
  92. local: ${LCLROOT}${BINDIR} ${LCLROOT}$(PARSERDIR) all
  93.     install ${IFLAGS} bison.NEW ${LCLROOT}${BINDIR}/${PFX}bison
  94.     cp $(PFILE) $(PFILE1) ${LCLROOT}$(PARSERDIR)
  95.     chmod 444 ${LCLROOT}${PARSERDIR}/${PFILE}
  96.     chmod 444 ${LCLROOT}${PARSERDIR}/${PFILE1}
  97.  
  98. ${LCLROOT}${BINDIR} ${LCLROOT}$(PARSERDIR):; mkdirs $@
  99.  
  100. bison-dist.tar:
  101.     tar cvf bison-dist.tar \
  102.         COPYING Makefile REFERENCES bison.1 bison.simple bison.hairy \
  103.         LR0.c allocate.c closure.c conflicts.c \
  104.         derives.c files.c getargs.c gram.c lalr.c lex.c main.c \
  105.         nullable.c output.c print.c reader.c symtab.c warshall.c \
  106.         files.h gram.h lex.h machine.h new.h state.h symtab.h types.h \
  107.         bison.cld build.com vmsgetargs.c vmshlp.mar
  108. bison-dist.tar.Z: bison-dist.tar
  109.     compress < bison-dist.tar > bison-dist.tar.Z
  110.  
  111. # This file is different to pass the parser file names
  112. # to the compiler.
  113. files.o: files.c files.h new.h gram.h
  114.     $(CC) -c $(CFLAGS) $(RC_CFLAGS) $(PFILES) files.c -o $(OFILE_DIR)/$@
  115.  
  116. LR0.o: machine.h new.h gram.h state.h
  117. closure.o: machine.h new.h gram.h
  118. conflicts.o: machine.h new.h files.h gram.h state.h
  119. derives.o: new.h types.h gram.h
  120. getargs.o: files.h
  121. lalr.o: machine.h types.h state.h new.h gram.h
  122. lex.o: files.h symtab.h lex.h
  123. main.o: machine.h
  124. nullable.o: types.h gram.h new.h
  125. output.o: machine.h new.h files.h gram.h state.h
  126. print.o: machine.h new.h files.h gram.h state.h
  127. reader.o: files.h new.h symtab.h lex.h gram.h
  128. reduce.o: files.h new.h machine.h gram.h
  129. symtab.o: new.h symtab.h gram.h
  130. warshall.o: machine.h
  131.  
  132.