Debian Codegraph @

mlyacc/Makefile

raw symbols SCIP
1 ## Copyright (C) 2009,2013,2018-2022 Matthew Fluet.
2 # Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
3 # Jagannathan, and Stephen Weeks.
4 # Copyright (C) 1997-2000 NEC Research Institute.
5 #
6 # MLton is released under a HPND-style license.
7 # See the file MLton-LICENSE for details.
8 ##
9
10 ROOT := ..
11 include $(ROOT)/Makefile.config
12
13 ######################################################################
14
15 NAME := mlyacc
16
17 all: $(NAME)
18
19 $(NAME): $(shell $(MLBDEPS) $(NAME).mlb)
20 @echo 'Compiling $(NAME)'
21 "$(RUN_MLTON)" @MLton $(RUN_MLTON_RUNTIME_ARGS) -- $(RUN_MLTON_COMPILE_ARGS) -target $(TARGET) $(NAME).mlb
22
23 $(eval $(MK_COMMON_GOALS))
24
25 ifeq (true,$(call HAVE_CMD,$(RUN_MLLEX)))
26 src/%.lex.sml: src/%.lex
27 $(RM) $<.*
28 $(RUN_MLLEX) $<
29 $(MV) $<.sml $<.sml.in
30 $(SED) -e '' $<.sml.in > $<.sml
31 $(RM) $<.sml.in
32 $(CP) $<.sml $<.sml.boot
33 $(CHMOD) -w $<.*
34 else
35 src/%.lex.sml: src/%.lex.sml.boot
36 $(RM) $@
37 $(CP) $< $@
38 $(CHMOD) -w $@
39 endif
40
41 ifeq (true,$(call HAVE_CMD,$(RUN_MLYACC)))
42 src/%.grm.sig src/%.grm.sml: src/%.grm
43 $(RM) $<.*
44 $(RUN_MLYACC) $<
45 $(MV) $<.sig $<.sig.in
46 $(SED) -e '' $<.sig.in > $<.sig
47 $(RM) $<.sig.in
48 $(CP) $<.sig $<.sig.boot
49 $(MV) $<.sml $<.sml.in
50 $(SED) -e '' $<.sml.in > $<.sml
51 $(RM) $<.sml.in
52 $(CP) $<.sml $<.sml.boot
53 $(CHMOD) -w $<.*
54 else
55 src/%.grm.sig: src/%.grm.sig.boot
56 $(RM) $@
57 $(CP) $< $@
58 $(CHMOD) -w $@
59 src/%.grm.sml: src/%.grm.sml.boot
60 $(RM) $@
61 $(CP) $< $@
62 $(CHMOD) -w $@
63 endif
64
65
66 PDFLATEX := pdflatex
67
68 doc/mlyacc.pdf:
69 $(MAKE) -C doc mlyacc.pdf
70
71 mlyacc.pdf: doc/mlyacc.pdf
72 $(CP) doc/mlyacc.pdf .
73
74 DOCS :=
75 ifeq (true, $(call HAVE_CMD,$(PDFLATEX)))
76 DOCS += mlyacc.pdf
77 endif
78
79 .PHONY: docs
80 docs: $(DOCS)
81
82
83 .PHONY: test
84 test: $(NAME)
85 $(CP) ../mlton/front-end/ml.grm . \
86 $(NAME) ml.grm && \
87 $(DIFF) ml.grm.sig ../mlton/front-end/ml.grm.sig && \
88 $(DIFF) ml.grm.sml ../mlton/front-end/ml.grm.sml \
89 $(RM) ml.grm ml.grm.sig ml.grm.sml ml.grm.desc