[MLton-commit] r7242

Matthew Fluet fluet at mlton.org
Fri Oct 9 09:57:40 PDT 2009


Fallback to SML/NJ ml-lex and ml-yacc.
----------------------------------------------------------------------

U   mlton/trunk/mlton/front-end/Makefile
U   mlton/trunk/mlyacc/Makefile

----------------------------------------------------------------------

Modified: mlton/trunk/mlton/front-end/Makefile
===================================================================
--- mlton/trunk/mlton/front-end/Makefile	2009-10-09 16:57:37 UTC (rev 7241)
+++ mlton/trunk/mlton/front-end/Makefile	2009-10-09 16:57:39 UTC (rev 7242)
@@ -1,4 +1,5 @@
-## Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
+## Copyright (C) 2009 Matthew Fluet.
+ # Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
  #    Jagannathan, and Stephen Weeks.
  # Copyright (C) 1997-2000 NEC Research Institute.
  #
@@ -11,6 +12,26 @@
 BIN := $(BUILD)/bin
 PATH := $(BIN):$(shell echo $$PATH)
 
+ifeq (mllex, $(shell if mllex >/dev/null 2>&1 || [ $$? != 127 ] ; then echo mllex; fi))
+MLLEX := mllex
+else
+ifeq (ml-lex, $(shell if ml-lex >/dev/null 2>&1 || [ $$? != 127 ] ; then echo ml-lex; fi))
+MLLEX := ml-lex
+else
+MLLEX := no-mllex
+endif
+endif
+
+ifeq (mlyacc, $(shell if mlyacc >/dev/null 2>&1 || [ $$? != 127 ] ; then echo mlyacc; fi))
+MLYACC := mlyacc
+else
+ifeq (ml-yacc, $(shell if ml-lex >/dev/null 2>&1 || [ $$? != 127 ] ; then echo ml-yacc; fi))
+MLYACC := ml-yacc
+else
+MLYACC := no-mlyacc
+endif
+endif
+
 .PHONY: all
 all: ml.lex.sml ml.grm.sig ml.grm.sml mlb.lex.sml mlb.grm.sig mlb.grm.sml
 
@@ -20,20 +41,20 @@
 
 ml.lex.sml: ml.lex
 	rm -f ml.lex.sml
-	mllex ml.lex
+	$(MLLEX) ml.lex
 	chmod -w ml.lex.sml
 
 ml.grm.sig ml.grm.sml: ml.grm
 	rm -f ml.grm.*
-	mlyacc ml.grm
+	$(MLYACC) ml.grm
 	chmod -w ml.grm.*
 
 mlb.lex.sml: mlb.lex
 	rm -f mlb.lex.sml
-	mllex mlb.lex
+	$(MLLEX) mlb.lex
 	chmod -w mlb.lex.sml
 
 mlb.grm.sig mlb.grm.sml: mlb.grm
 	rm -f mlb.grm.*
-	mlyacc mlb.grm
+	$(MLYACC) mlb.grm
 	chmod -w mlb.grm.*

Modified: mlton/trunk/mlyacc/Makefile
===================================================================
--- mlton/trunk/mlyacc/Makefile	2009-10-09 16:57:37 UTC (rev 7241)
+++ mlton/trunk/mlyacc/Makefile	2009-10-09 16:57:39 UTC (rev 7242)
@@ -17,6 +17,26 @@
 NAME := mlyacc
 PATH := $(BIN):$(shell echo $$PATH)
 
+ifeq (mllex, $(shell if mllex >/dev/null 2>&1 || [ $$? != 127 ] ; then echo mllex; fi))
+MLLEX := mllex
+else
+ifeq (ml-lex, $(shell if ml-lex >/dev/null 2>&1 || [ $$? != 127 ] ; then echo ml-lex; fi))
+MLLEX := ml-lex
+else
+MLLEX := no-mllex
+endif
+endif
+
+ifeq (mlyacc, $(shell if mlyacc >/dev/null 2>&1 || [ $$? != 127 ] ; then echo mlyacc; fi))
+MLYACC := mlyacc
+else
+ifeq (ml-yacc, $(shell if ml-lex >/dev/null 2>&1 || [ $$? != 127 ] ; then echo ml-yacc; fi))
+MLYACC := ml-yacc
+else
+MLYACC := no-mlyacc
+endif
+endif
+
 all:	$(NAME)
 
 $(NAME): $(NAME).mlb $(shell PATH="$(BIN):$$PATH" && "$(MLTON)" -stop f $(NAME).mlb)
@@ -25,12 +45,12 @@
 
 src/yacc.lex.sml: src/yacc.lex
 	rm -f src/yacc.lex.sml && \
-		mllex src/yacc.lex && \
+		$(MLLEX) src/yacc.lex && \
 		chmod -w src/yacc.lex.sml
 
 src/yacc.grm.sig src/yacc.grm.sml: src/yacc.grm
 	rm -f src/yacc.grm.* && \
-		mlyacc src/yacc.grm && \
+		$(MLYACC) src/yacc.grm && \
 		chmod -w src/yacc.grm.*
 
 doc/mlyacc.ps:




More information about the MLton-commit mailing list