# # Copyright 2001-2008 Adrian Thurston # # This file is part of Ragel. # # Ragel is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # Ragel is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ragel; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA INCS += -I../aapl DEFS += CXXFLAGS += -g -Wall LDFLAGS += CC_SRCS = \ main.cpp parsetree.cpp parsedata.cpp fsmstate.cpp fsmbase.cpp \ fsmattach.cpp fsmmin.cpp fsmgraph.cpp fsmap.cpp \ rlscan.cpp rlparse.cpp inputdata.cpp common.cpp \ redfsm.cpp gendata.cpp \ cdcodegen.cpp \ cdtable.cpp cdftable.cpp cdflat.cpp \ cdfflat.cpp cdgoto.cpp cdfgoto.cpp \ cdipgoto.cpp cdsplit.cpp \ javacodegen.cpp \ rubycodegen.cpp rubytable.cpp rubyftable.cpp \ rubyflat.cpp rubyfflat.cpp rbxgoto.cpp \ cscodegen.cpp cstable.cpp csftable.cpp csflat.cpp \ csfflat.cpp csgoto.cpp csfgoto.cpp \ csipgoto.cpp cssplit.cpp \ dotcodegen.cpp \ xmlcodegen.cpp \ GEN_SRC = version.h rlscan.cpp rlparse.h rlparse.cpp \ xmlscan.cpp xmlparse.h LIBS = MINGW_LIBS = -lpsapi #************************************* prefix = @prefix@ BUILD_PARSERS = @BUILD_PARSERS@ EXEEXT = @EXEEXT@ CXX = @CXX@ ifeq ($(EXEEXT), .exe) LIBS += $(MINGW_LIBS) endif # Get objects and dependencies from sources. OBJS = $(CC_SRCS:%.cpp=%.o) DEPS = $(CC_SRCS:%.cpp=.%.d) # Get the version info. include ../version.mk # Rules. all: ragel$(EXEEXT) ragel$(EXEEXT): $(GEN_SRC) $(OBJS) $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) version.h: ../version.mk echo '#define VERSION "$(VERSION)"' > version.h echo '#define PUBDATE "$(PUBDATE)"' >> version.h echo '#define PREFIX "$(prefix)"' >> version.h ifeq ($(BUILD_PARSERS),true) rlparse.h: rlparse.kh kelbt -o $@ $< rlparse.cpp: rlparse.kl rlparse.kh kelbt -o $@ $< # This dependency comes from the import of the parser defines # into the scanner. rlscan.cpp: rlparse.h rlscan.cpp: rlscan.rl ragel -G2 -o $@ $< xmlparse.h: xmlparse.kh kelbt -o $@ $< xmlparse.cpp: xmlparse.kl xmlparse.kh kelbt -o $@ $< xmlscan.cpp: xmlscan.rl ragel -G2 -o xmlscan.cpp xmlscan.rl xmltags.cpp: xmltags.gperf gperf -L C++ -t $< > $@ endif %.o: %.cpp @$(CXX) -M $(DEFS) $(INCS) $< > .$*.d $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCS) -o $@ $< distclean: clean rm -f Makefile ifeq ($(BUILD_PARSERS),true) EXTRA_CLEAN = $(GEN_SRC) endif clean: rm -f tags .*.d *.o ragel $(EXTRA_CLEAN) install: all install -d $(DESTDIR)$(prefix)/bin install -s ragel $(DESTDIR)$(prefix)/bin/ragel -include $(DEPS)