1# Copyright (C) 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 14# C-compiler flags 15CFLAGS=/O2 16 17# Regular expression support 18# REGEX should have one of the values POSIX, OLDPOSIX, PCRE, or be unset. All 19# the named options use the POSIX regular expression API. POSIX includes the 20# "regex.h" header file, OLDPOSIX also includes the "sys/types.h" header file, 21# and PCRE uses the "pcreposix.h" header file. The latter also requires 22# linking with pcreposix.lib for proper operation. 23# REGEXLIBS should provide any options necessary for linking all the libraries 24# required for the regular expression code 25REGEX= 26REGEXLIBS= 27 28 29CSOURCES=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 30LSOURCES=src\lexer.l 31GSOURCES=src\grammar.g 32OBJECTS=$(CSOURCES:.c=.obj) $(LSOURCES:.l=.obj) $(GSOURCES:.g=.obj) 33 34all: LLnextgen 35 36clean: 37 del src\*.obj src\grammar.c src\grammar.h src\lexer.c 38 39dist-clean: clean 40 del LLnextgen.exe 41 42LLnextgen: $(OBJECTS) 43 $(CC) /FeLLnextgen $(OBJECTS) $(LDLIBS) $(REGEXLIBS) 44 45src\lexer.c: src\lexer.c.dist 46 copy src\lexer.c.dist src\lexer.c 47 48src\grammar.c: src\grammar.c.dist 49 copy src\grammar.c.dist src\grammar.c 50 51src\grammar.h: src\grammar.h.dist 52 copy src\grammar.h.dist src\grammar.h 53 54src\grammar.obj: src\grammar.h 55src\io.obj: src\grammar.h 56src\lexer.obj: src\grammar.h 57src\main.obj: src\grammar.h 58src\printInput.obj: src\grammar.h 59 60.c.obj: 61 $(CC) $(CFLAGS) /DREGEX=$(REGEX) /c $< /Fo$@ 62