Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Makefile for bison
  2. # etu, to every rule it is inserted *.c, didn't
  3. # know how to compile them otherwise
  4. # usage: make SYSTEM=(SYS5|BSD)
  5. # where the installed binary goes
  6. BINDIR = /usr/local/lbin
  7. # where the parsers go
  8. PARSERDIR = /usr/lib/bison
  9. # names of parser files
  10. PFILE = bison.simple
  11. PFILE1 = bison.hairy
  12. # It is unwise ever to compile a program without symbols.
  13. CFLAGS = -g
  14. PFILES = -DXPFILE=\"$(PARSERDIR)/$(PFILE)\" \
  15. -DXPFILE1=\"$(PARSERDIR)/$(PFILE1)\"
  16. OBJECTS = LR0.o allocate.o closure.o conflicts.o derives.o files.o \
  17. getargs.o gram.o lalr.o \
  18. lex.o main.o nullable.o output.o print.o reader.o symtab.o \
  19. warshall.o
  20. start: bison
  21. clean:
  22. rm -f *.o core
  23. install: bison
  24. # without install
  25. cp bison $(BINDIR)
  26. strip $(BINDIR)/bison
  27. chmod 755 $(BINDIR)/bison
  28. chown bin $(BINDIR)/bison
  29. chgrp bin $(BINDIR)/bison
  30. cp $(PFILE) $(PFILE1) $(PARSERDIR)
  31. chmod 644 $(PARSERDIR)/$(PFILE) $(PARSERDIR)/$(PFILE1)
  32. chown bin $(PARSERDIR)/$(PFILE) $(PARSERDIR)/$(PFILE1)
  33. chgrp bin $(PARSERDIR)/$(PFILE) $(PARSERDIR)/$(PFILE1)
  34. # with install (bsd)
  35. # install bison $(BINDIR)
  36. # install -c $(PFILE) $(PFILE1) $(PARSERDIR)
  37. bison: $(OBJECTS)
  38. $(CC) -g -o bison $(OBJECTS)
  39. # This file is different to pass the parser file names
  40. # to the compiler.
  41. files.o: files.c files.h new.h gram.h
  42. $(CC) -c $(CFLAGS) $(PFILES) files.c
  43. tar:
  44. tar -cf bison.tar $(PFILE) $(PFILE1) COPYING LR0.c MIAU Makefile \
  45. allocate.c bison.hairy bison.simple closure.c conflicts.c \
  46. derives.c files.c files.h getargs.c gram.c gram.h lalr.c \
  47. lex.c lex.h machine.h main.c new.h nullable.c output.c print.c \
  48. reader.c references state.h symtab.c symtab.h types.h \
  49. warshall.c
  50. compress -f bison.tar
  51. LR0.o: machine.h new.h gram.h state.h LR0.c
  52. closure.o: machine.h new.h gram.h closure.c
  53. conflicts.o: machine.h new.h files.h gram.h state.h conflicts.c
  54. derives.o: new.h types.h gram.h derives.c
  55. getargs.o: files.h getargs.c
  56. lalr.o: machine.h types.h state.h new.h gram.h lalr.c
  57. lex.o: files.h symtab.h lex.h lex.c
  58. main.o: machine.h main.c
  59. nullable.o: types.h gram.h new.h nullable.c
  60. output.o: machine.h new.h files.h gram.h state.h output.c
  61. print.o: machine.h new.h files.h gram.h state.h print.c
  62. reader.o: files.h new.h symtab.h lex.h gram.h reader.c
  63. symtab.o: new.h symtab.h gram.h symtab.c
  64. warshall.o: machine.h warshall.c
  65. # etu, the following added
  66. allocate.o: allocate.c
  67. files.o: files.c
  68. gram.o: gram.c