summaryrefslogtreecommitdiff
path: root/lex
diff options
context:
space:
mode:
authorSébastien Hinderer <Sebastien.Hinderer@inria.fr>2020-06-17 09:29:56 +0200
committerSébastien Hinderer <Sebastien.Hinderer@inria.fr>2020-06-18 11:16:55 +0200
commitbdd9ca391e3a56253d7480b07bb1a8aac361904c (patch)
tree438b71b4bc6a4e11fa9a4056cbbca722bce5fed3 /lex
parent41e4dc1dc8e156dd10a63124ce061ac1588d0aef (diff)
downloadocaml-bdd9ca391e3a56253d7480b07bb1a8aac361904c.tar.gz
Add the $(EXE) suffix to all programs at build rather than install time
This commit touches neither boot/ocamlc nor boot/ocamllex It has the side-effect of fixing the cleanup rules which did not use the $(EXE) extension when removing a file although it was produced with the $(EXE) extension.
Diffstat (limited to 'lex')
-rw-r--r--lex/Makefile14
1 files changed, 9 insertions, 5 deletions
diff --git a/lex/Makefile b/lex/Makefile
index 86ac86b4ee..c928d737d4 100644
--- a/lex/Makefile
+++ b/lex/Makefile
@@ -19,11 +19,11 @@ ROOTDIR = ..
include $(ROOTDIR)/Makefile.common
-CAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc
+CAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc$(EXE)
CAMLC = $(BOOT_OCAMLC) -strict-sequence -nostdlib \
-I $(ROOTDIR)/boot -use-prims $(ROOTDIR)/runtime/primitives
-CAMLOPT = $(CAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib -I $(ROOTDIR)/stdlib
+CAMLOPT = $(CAMLRUN) $(ROOTDIR)/ocamlopt$(EXE) -nostdlib -I $(ROOTDIR)/stdlib
COMPFLAGS = -absname -w +a-4-9-41-42-44-45-48 -warn-error A \
-safe-string -strict-sequence -strict-formats -bin-annot
LINKFLAGS =
@@ -36,19 +36,23 @@ DEPINCLUDES =
OBJS=cset.cmo syntax.cmo parser.cmo lexer.cmo table.cmo lexgen.cmo \
compact.cmo common.cmo output.cmo outputbis.cmo main.cmo
+programs := ocamllex ocamllex.opt
+
+$(foreach program, $(programs), $(eval $(call PROGRAM_SYNONYM,$(program))))
+
.PHONY: all allopt opt.opt # allopt and opt.opt are synonyms
all: ocamllex
allopt: ocamllex.opt
opt.opt: allopt
-ocamllex: $(OBJS)
+ocamllex$(EXE): $(OBJS)
$(CAMLC) $(LINKFLAGS) -compat-32 -o $@ $^
-ocamllex.opt: $(OBJS:.cmo=.cmx)
+ocamllex.opt$(EXE): $(OBJS:.cmo=.cmx)
$(CAMLOPT_CMD) -o $@ $^
clean::
- rm -f ocamllex ocamllex.opt
+ rm -f $(programs) $(programs:=.exe)
rm -f *.cmo *.cmi *.cmx *.cmt *.cmti *.o *.obj
parser.ml parser.mli: parser.mly