-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.in
132 lines (99 loc) · 3.61 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Makefile for SMLFormat
# $Id: Makefile.in,v 1.21 2007/12/13 08:59:46 katsu Exp $
srcdir = @srcdir_smlformat@
builddir = @builddir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
include @top_builddir@/commonrule
VPATH = @srcdir_smlformat@
TARGETS = bin/smlformat
LEXFILES = $(srcdir)/generator/main/ml.lex
YACCFILES = $(srcdir)/generator/main/ml.grm
GENSOURCES = $(LEXFILES:.lex=.lex.sml) \
$(YACCFILES:.grm=.grm.sml) \
$(YACCFILES:.grm=.grm.sig) \
$(YACCFILES:.grm=.grm.desc)
SOURCES = generator/main/Ast.sml \
generator/main/AstUtil.sml \
generator/main/BasicFormattersEnv.sml \
generator/main/call-main.sml \
generator/main/Constants_MLton.sml \
generator/main/ErrorQueue.sml \
generator/main/FormatTemplate.sml \
generator/main/FormatterGenerator.sml \
generator/main/Main.sml \
generator/main/MLParser.sml \
generator/main/PPGMain.sml \
generator/main/TokenTable.sml \
generator/main/Utility.sml \
$(GENSOURCES)
OBJS = $(filter %.o,$(SOURCES:.sml=.o))
DEPENDS = $(filter %.d,$(SOURCES:.sml=.d))
LIBFILES = smlformat-lib.smi \
formatlib/main/AssocResolver.smi \
formatlib/main/BASIC_FORMATTERS.sig \
formatlib/main/BasicFormatters.smi \
formatlib/main/FORMAT_EXPRESSION.sig \
formatlib/main/FormatExpression.smi \
formatlib/main/FormatExpressionTypes.smi \
formatlib/main/PreProcessedExpression.smi \
formatlib/main/PreProcessor.smi \
formatlib/main/PrettyPrinter.smi \
formatlib/main/PRINTER_PARAMETER.sig \
formatlib/main/PrinterParameter.smi \
formatlib/main/SMLFORMAT.sig \
formatlib/main/SMLFormat.smi \
formatlib/main/Truncator.smi
LIBOBJS = $(filter-out smlformat-lib.o,$(filter %.o,$(LIBFILES:.smi=.o)))
LIBDEPENDS = $(filter-out smlformat-lib.d,$(filter %.d,$(LIBFILES:.smi=.d)))
.PHONY: all
all: $(TARGETS) $(LIBOBJS)
.PHONY: install
install: $(TARGETS) $(LIBFILES) $(LIBOBJS)
$(INSTALL) -D -m 755 $(TARGETS) '$(DESTDIR)$(bindir)'
$(INSTALL) -d -m 755 '$(DESTDIR)$(libdir_smlformat)'
$(INSTALL) -d -m 755 '$(DESTDIR)$(libdir_smlformat)/formatlib'
$(INSTALL) -d -m 755 '$(DESTDIR)$(libdir_smlformat)/formatlib/main'
set -x; for i in $(LIBFILES) $(LIBOBJS); do \
$(INSTALL_DATA) '$(srcdir)/'"$$i" \
'$(DESTDIR)$(libdir_smlformat)/'"$$i";\
done
bin/smlformat: $(srcdir)/generator/main/call-main.smi $(OBJS)
@echo " SML# [$@]"
@$(MAKESML) $(SMLFLAGS) -o $@ $<
%.o: %.sml
@echo " SML# [$@]"
@$(MAKESML) $(SMLFLAGS) -c $<
%.d: %.sml
@echo " GEN [$@]"
@$(SHELL) -ec '$(MAKESML) -MM $(SMLFLAGS) $< \
| sed "s|\(.\)\.o[ :]*|\1.o $@ : |g" > $@; \
[ -s $@ ] || rm -rf $@'
# remove default rules
%.lex:
$(srcdir)/generator/main/ml.lex.sml: generator/main/ml.lex
@echo " [MLLex] $@"
@$(MLLEX) $(srcdir)/generator/main/ml.lex
# remove default rules
%.grm:
$(srcdir)/generator/main/ml.grm.sml $(srcdir)/generator/main/ml.grm.sig: $(srcdir)/generator/main/ml.grm
@echo " [MLYacc] $@"
@$(MLYACC) $(srcdir)/generator/main/ml.grm
.PHONY: doc
doc: doc/api/index.html
doc/api/index.html: $(srcdir)/formatlib/smldoc.cfg $(LIBFILES)
mkdir -p ./doc/api
$(SMLDOC) -a $(srcdir)/formatlib/smldoc.cfg --directory=./doc/api
ifeq (,$(findstring $(MAKECMDGOALS),clean))
include $(DEPENDS)
include $(LIBDEPENDS)
endif
.PHONY: clean
clean:
-rm -f $(GENSOURCES)
-rm -f $(TARGETS)
-rm -f $(OBJS) $(LIBOBJS)
-rm -f $(DEPENDS)
-rm -f $(LIBDEPENDS)
-rm -rf ./doc/api
# # Makefile.in ends here.