Makefile.in 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Copyright (C) 2005,2006,2008 G.P. Halkes
  2. # This program is free software: you can redistribute it and/or modify
  3. # it under the terms of the GNU General Public License version 3, as
  4. # published by the Free Software Foundation.
  5. #
  6. # This program is distributed in the hope that it will be useful,
  7. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. # GNU General Public License for more details.
  10. #
  11. # You should have received a copy of the GNU General Public License
  12. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. .POSIX:
  14. # C-compiler flags
  15. CFLAGS=-O2
  16. # Installation prefix
  17. prefix=/usr/local
  18. # Regular expression support
  19. # REGEX should have one of the values POSIX, OLDPOSIX, PCRE, or be unset. All
  20. # the named options use the POSIX regular expression API. POSIX includes the
  21. # "regex.h" header file, OLDPOSIX also includes the "sys/types.h" header file,
  22. # and PCRE uses the "pcreposix.h" header file. The latter also requires
  23. # linking with -lpcreposix for proper operation.
  24. # REGEXLIBS should provide any options necessary for linking all the libraries
  25. # required for the regular expression code
  26. REGEX=
  27. REGEXLIBS=
  28. INSTALL=install
  29. bindir=$(prefix)/bin
  30. docdir=$(prefix)/share/doc/LLnextgen-0.5.5
  31. mandir=$(prefix)/share/man/man1
  32. CSOURCES=src/argcount.c src/clash.c src/depend.c src/freeData.c src/generate.c src/generateCommon.c src/generateLLgenStyle.c src/generateTS.c src/globals.c src/io.c src/list.c src/main.c src/nonRuleAnalysis.c src/option.c src/os.c src/printInput.c src/ruleAnalysis.c src/scope.c src/set.c src/traceTokens.c src/clashStrings.c
  33. LSOURCES=src/lexer.l
  34. GSOURCES=src/grammar.g
  35. OBJECTS=$(CSOURCES:.c=.o) $(LSOURCES:.l=.o) $(GSOURCES:.g=.o)
  36. all: LLnextgen
  37. .PHONY: all install clean dist-clean mr-proper
  38. install: LLnextgen
  39. $(INSTALL) -d $(bindir)
  40. $(INSTALL) LLnextgen $(bindir)
  41. $(INSTALL) -d $(mandir)
  42. $(INSTALL) -m 644 doc/LLnextgen.1 $(mandir)
  43. $(INSTALL) -d $(docdir)
  44. $(INSTALL) -m 644 README COPYING TODO Changelog $(docdir)
  45. $(INSTALL) -m 644 doc/LLnextgen.ps.gz doc/LLnextgen.pdf $(docdir)
  46. $(INSTALL) -m 644 doc/calculator.g doc/threadsafe.g $(docdir)
  47. clean:
  48. rm -rf src/*.o src/grammar.c src/grammar.h src/lexer.c
  49. dist-clean: clean
  50. rm -rf LLnextgen
  51. mr-proper: dist-clean
  52. rm -rf config.log Makefile
  53. LLnextgen: $(OBJECTS)
  54. $(CC) $(LDFLAGS) -o LLnextgen $(OBJECTS) $(LDLIBS) $(REGEXLIBS)
  55. src/lexer.c: src/lexer.c.dist
  56. cp src/lexer.c.dist src/lexer.c
  57. src/grammar.c: src/grammar.c.dist
  58. cp src/grammar.c.dist src/grammar.c
  59. src/grammar.h: src/grammar.h.dist
  60. cp src/grammar.h.dist src/grammar.h
  61. src/grammar.o: src/grammar.h
  62. src/io.o: src/grammar.h
  63. src/lexer.o: src/grammar.h
  64. src/main.o: src/grammar.h
  65. src/printInput.o: src/grammar.h
  66. .c.o:
  67. $(CC) $(CFLAGS) -DREGEX=$(REGEX) -c $< -o $@