home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / bison / makefile < prev    next >
Makefile  |  1990-06-25  |  4KB  |  117 lines

  1. # Makefile for bison
  2. #   Copyright (C) 1984, 1989 Bob Corbett and Free Software Foundation, Inc.
  3. #
  4. # This file is part of Bison, the GNU Compiler Compiler.
  5. #
  6. # Bison is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 1, or (at your option)
  9. # any later version.
  10. #
  11. # Bison is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with Bison; see the file COPYING.  If not, write to
  18. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # For sysV, you must uncomment the following lines
  21. #CFLAGS = -g -DUSG
  22. #LIBS = -lPW
  23. #and comment out the assignment of CFLAGS below.
  24. #Also, if getopt.c gives any trouble, delete it from OBJECTS.
  25. #so the system's getopt will be used.
  26.  
  27.  
  28. DESTDIR=
  29. # where the installed binary goes
  30. BINDIR = $(DESTDIR)/usr/local/bin
  31.  
  32. # where the parsers go
  33. PARSERDIR = $(DESTDIR)/usr/local/lib
  34.  
  35. # where manual pages go and what their extensions should be
  36. MANDIR = $(DESTDIR)/usr/man/manl
  37. MANEXT = l
  38.  
  39. # names of parser files
  40. PFILE = bison.simple
  41. PFILE1 = bison.hairy
  42.  
  43. # It is unwise ever to compile a program without symbols.
  44. CFLAGS = -g
  45.  
  46. PFILES = -DXPFILE=\"$(PARSERDIR)/$(PFILE)\" \
  47.      -DXPFILE1=\"$(PARSERDIR)/$(PFILE1)\"
  48.  
  49. OBJECTS = LR0.o allocate.o closure.o conflicts.o derives.o files.o    \
  50.       getargs.o gram.o lalr.o lex.o                    \
  51.       main.o nullable.o output.o print.o reader.o reduce.o symtab.o    \
  52.       warshall.o version.o                        \
  53.       getopt.o
  54.  
  55. start: bison
  56.  
  57. clean:
  58.     rm -f *.o core bison
  59.  
  60. install: bison
  61.     install bison $(BINDIR)
  62.     -cd $(PARSERDIR); rm -f $(PFILE) $(PFILE1)
  63. # Copy bison.simple, inserting directory name into the #line commands.
  64.     awk -f mergedir.awk dir=$(PARSERDIR) $(PFILE) > $(PARSERDIR)/$(PFILE)
  65.     cp $(PFILE1) $(PARSERDIR)
  66.     install -c bison.1 $(MANDIR)/bison.$(MANEXT)
  67.  
  68. bison: $(OBJECTS)
  69.     $(CC) $(LDFLAGS) -o bison $(OBJECTS) $(LIBS)
  70.  
  71. dist:    bison.tar bison.tar.Z
  72.  
  73. .PHONY: bison.tar
  74. bison.tar:
  75.     -rm -rf temp
  76.     mkdir temp
  77.     mkdir temp/bison
  78.     ln  COPYING ChangeLog Makefile REFERENCES bison.1 \
  79.         bison.simple bison.hairy mergedir.awk \
  80.         LR0.c allocate.c closure.c conflicts.c derives.c \
  81.         files.c getargs.c gram.c lalr.c lex.c main.c nullable.c \
  82.         output.c print.c reader.c reduce.c symtab.c version.c \
  83.         warshall.c files.h gram.h lex.h machine.h new.h state.h \
  84.         symtab.h system.h types.h bison.cld build.com vmsgetargs.c \
  85.         vmshlp.mar README bison.texinfo bison.info* \
  86.       temp/bison
  87.     cp ../lib/getopt.c temp/bison
  88.     cd temp; tar chf ../bison.tar bison
  89.     -rm -rf temp
  90.  
  91. bison.tar.Z: bison.tar
  92.     compress < bison.tar > bison.tar.Z
  93.  
  94. TAGS: *.c *.h
  95.     etags *.c *.h
  96.  
  97. # This file is different to pass the parser file names
  98. # to the compiler.
  99. files.o: files.c files.h new.h gram.h
  100.     $(CC) -c $(CFLAGS) $(PFILES) files.c
  101.  
  102. LR0.o: machine.h new.h gram.h state.h
  103. closure.o: machine.h new.h gram.h
  104. conflicts.o: machine.h new.h files.h gram.h state.h
  105. derives.o: new.h types.h gram.h
  106. getargs.o: files.h
  107. lalr.o: machine.h types.h state.h new.h gram.h
  108. lex.o: files.h symtab.h lex.h
  109. main.o: machine.h
  110. nullable.o: types.h gram.h new.h
  111. output.o: machine.h new.h files.h gram.h state.h
  112. print.o: machine.h new.h files.h gram.h state.h
  113. reader.o: files.h new.h symtab.h lex.h gram.h
  114. reduce.o: files.h new.h machine.h gram.h
  115. symtab.o: new.h symtab.h gram.h
  116. warshall.o: machine.h
  117.