MAKEFILE 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. # For sysV, you must uncomment the following lines
  20. #CFLAGS = -g -DUSG
  21. #LIBS = -lPW
  22. #and comment out the assignment of CFLAGS below.
  23. #Also, if getopt.c gives any trouble, delete it from OBJECTS.
  24. #so the system's getopt will be used.
  25. DESTDIR=
  26. # where the installed binary goes
  27. BINDIR = $(DESTDIR)/usr/local/bin
  28. # where the parsers go
  29. PARSERDIR = $(DESTDIR)/usr/local/lib
  30. # where manual pages go and what their extensions should be
  31. MANDIR = $(DESTDIR)/usr/man/manl
  32. MANEXT = l
  33. # names of parser files
  34. PFILE = bison.simple
  35. PFILE1 = bison.hairy
  36. # It is unwise ever to compile a program without symbols.
  37. CFLAGS = -g
  38. PFILES = -DXPFILE=\"$(PARSERDIR)/$(PFILE)\" \
  39. -DXPFILE1=\"$(PARSERDIR)/$(PFILE1)\"
  40. OBJECTS = LR0.o allocate.o closure.o conflicts.o derives.o files.o \
  41. getargs.o gram.o lalr.o lex.o \
  42. main.o nullable.o output.o print.o reader.o reduce.o symtab.o \
  43. warshall.o version.o \
  44. getopt.o
  45. start: bison
  46. clean:
  47. rm -f *.o core bison
  48. install: bison
  49. install bison $(BINDIR)
  50. -cd $(PARSERDIR); rm -f $(PFILE) $(PFILE1)
  51. # Copy bison.simple, inserting directory name into the #line commands.
  52. awk -f mergedir.awk dir=$(PARSERDIR) $(PFILE) > $(PARSERDIR)/$(PFILE)
  53. cp $(PFILE1) $(PARSERDIR)
  54. install -c bison.1 $(MANDIR)/bison.$(MANEXT)
  55. chmod a+r $(PARSERDIR)/$(PFILE) $(PARSERDIR)/$(PFILE1)
  56. chmod a+r $(MANDIR)/bison.$(MANEXT)
  57. bison: $(OBJECTS)
  58. $(CC) $(LDFLAGS) -o bison $(OBJECTS) $(LIBS)
  59. dist: bison.tar bison.tar.Z
  60. .PHONY: bison.tar
  61. bison.tar:
  62. -rm -rf temp
  63. mkdir temp
  64. mkdir temp/bison
  65. ln COPYING ChangeLog Makefile REFERENCES bison.1 \
  66. bison.simple bison.hairy mergedir.awk \
  67. LR0.c allocate.c closure.c conflicts.c derives.c \
  68. files.c getargs.c gram.c lalr.c lex.c main.c nullable.c \
  69. output.c print.c reader.c reduce.c symtab.c version.c \
  70. warshall.c files.h gram.h lex.h machine.h new.h state.h \
  71. symtab.h system.h types.h bison.cld build.com vmsgetargs.c \
  72. vmshlp.mar README bison.texinfo bison.info* \
  73. temp/bison
  74. cp ../lib/getopt.c temp/bison
  75. cd temp; tar chf ../bison.tar bison
  76. -rm -rf temp
  77. bison.tar.Z: bison.tar
  78. compress < bison.tar > bison.tar.Z
  79. TAGS: *.c *.h
  80. etags *.c *.h
  81. # This file is different to pass the parser file names
  82. # to the compiler.
  83. files.o: files.c files.h new.h gram.h
  84. $(CC) -c $(CFLAGS) $(PFILES) files.c
  85. LR0.o: machine.h new.h gram.h state.h
  86. closure.o: machine.h new.h gram.h
  87. conflicts.o: machine.h new.h files.h gram.h state.h
  88. derives.o: new.h types.h gram.h
  89. getargs.o: files.h
  90. lalr.o: machine.h types.h state.h new.h gram.h
  91. lex.o: files.h symtab.h lex.h
  92. main.o: machine.h
  93. nullable.o: types.h gram.h new.h
  94. output.o: machine.h new.h files.h gram.h state.h
  95. print.o: machine.h new.h files.h gram.h state.h
  96. reader.o: files.h new.h symtab.h lex.h gram.h
  97. reduce.o: files.h new.h machine.h gram.h
  98. symtab.o: new.h symtab.h gram.h
  99. warshall.o: machine.h