"eof" is no longer a write command.
[external/ragel.git] / ragel / Makefile.in
index 9b252a7..8ce2a9f 100644 (file)
@@ -1,5 +1,5 @@
 #
-#   Copyright 2001-2006 Adrian Thurston <thurston@cs.queensu.ca>
+#   Copyright 2001-2007 Adrian Thurston <thurston@complang.org>
 #
 
 #   This file is part of Ragel.
 #   along with Ragel; if not, write to the Free Software
 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
 
-INCS += -I../common -I../aapl
+INCS += -I../common -I../aapl -I../redfsm
 DEFS +=
 
-CFLAGS += -g -Wall
+CXXFLAGS += -g -Wall
 LDFLAGS +=
 
 CC_SRCS = \
@@ -31,24 +31,36 @@ CC_SRCS = \
 
 GEN_SRC = rlscan.cpp rlparse.h rlparse.cpp
 
-LIBS += @LIBS@
-PREFIX = @prefix@
+RAGEL_LIBS = ../common/common.a \
+       ../redfsm/redfsm.a \
+       ../rlgen-cd/rlgen-cd.a \
+       ../rlgen-java/rlgen-java.a \
+       ../rlgen-ruby/rlgen-ruby.a \
+       ../rlgen-csharp/rlgen-csharp.a \
+       ../rlgen-dot/rlgen-dot.a
 
-BUILD_PARSERS = @BUILD_PARSERS@
+LIBS = $(RAGEL_LIBS)
+MINGW_LIBS = -lpsapi
 
 #*************************************
 
-# Programs
+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)
 
 # Rules.
-all: ragel
+all: ragel$(EXEEXT)
 
-ragel: $(GEN_SRC) $(OBJS)
+ragel$(EXEEXT): $(GEN_SRC) $(OBJS) $(RAGEL_LIBS)
        $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
 
 ifeq ($(BUILD_PARSERS),true)
@@ -59,14 +71,18 @@ rlparse.h: rlparse.kh
 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 $< | rlcodegen -G2 -o $@
+       ragel -G2 -o $@ $<
 
 endif
 
 %.o: %.cpp
        @$(CXX) -M $(DEFS) $(INCS) $< > .$*.d
-       $(CXX) -c $(CFLAGS) $(DEFS) $(INCS) -o $@ $<
+       $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCS) -o $@ $<
 
 distclean: clean
        rm -f Makefile 
@@ -79,7 +95,7 @@ clean:
        rm -f tags .*.d *.o ragel $(EXTRA_CLEAN)
 
 install: all
-       install -d $(PREFIX)/bin
-       install -s ragel $(PREFIX)/bin/ragel
+       install -d $(DESTDIR)$(prefix)/bin
+       install -s ragel $(DESTDIR)$(prefix)/bin/ragel
 
 -include $(DEPS)