File: Makefile.in

package info (click to toggle)
ocamlcreal 0.7-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, squeeze, stretch, wheezy
  • size: 384 kB
  • ctags: 751
  • sloc: ml: 2,699; ansic: 1,067; makefile: 15
file content (272 lines) | stat: -rw-r--r-- 5,764 bytes parent folder | download | duplicates (3)
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272

###########################################################################
# DO NOT EDIT (automatically generated by ./configure)
###########################################################################

# where to install the binaries
prefix=@prefix@
exec_prefix=@exec_prefix@
BINDIR=@bindir@

# where to install the man page
MANDIR=@mandir@

OCAMLC = @OCAMLC@
OCAMLOPT = @OCAMLOPT@
OCAMLLEX = @OCAMLLEX@
OCAMLYACC= @OCAMLYACC@

INCLUDES = -I mlgmp
BFLAGS = -g $(INCLUDES)
OFLAGS = -unsafe $(INCLUDES)

CMO = cr.cmo creal.cmo
CMI = $(CMO:.cmo=.cmi)
MLI = $(CMO:.cmo=.mli)
CMX = $(CMO:.cmo=.cmx)

CRCMO=cr.cmo
CRCMX = $(CRCMO:.cmo=.cmx)

CMA = creal.cma
CMXA = creal.cmxa

GMPCMA = mlgmp/gmp.cma
GMPCMXA = mlgmp/gmp.cmxa

all: @OCAMLBEST@ test.@OCAMLBEST@ test_cr.@OCAMLBEST@ ecalc.@OCAMLBEST@

byte: $(GMPCMA) $(CMA) $(CRCMO) cmpf.cmo
opt:  $(GMPCMA) $(CMA) $(GMPCMXA) $(CMXA) $(CRCMO) $(CRCMX) cmpf.cmx

$(CMA): libcreal.a $(GMPCMA) $(CMO)
	ocamlmklib -linkall -o creal $(GMPCMA) $(CMO) -lgmp

$(CMXA):libcreal.a $(GMPCMX) $(CMX)
	ocamlmklib -linkall -o creal $(GMPCMX) $(CMX) -lgmp

libcreal.a: mlgmp/mlgmp_z.o mlgmp/mlgmp_q.o mlgmp/mlgmp_misc.o
	ocamlmklib -oc creal $^ -lgmp
	ranlib $@

GMPCMO=mlgmp/gmp.cmo

$(GMPCMA): mlgmp/libmlgmp.a $(GMPCMO)
	$(OCAMLC) -custom -a -o $@ $^ -cclib "-Lmlgmp -lmlgmp -lgmp"

GMPCMX=mlgmp/gmp.cmx

$(GMPCMXA): mlgmp/libmlgmp.a $(GMPCMX)
	$(OCAMLOPT) -a -o $@ $^ -cclib "-Lmlgmp -lmlgmp -lgmp"

mlgmp/libmlgmp.a: mlgmp/mlgmp_z.o mlgmp/mlgmp_q.o mlgmp/mlgmp_misc.o
	rm -f $@
	ar rc $@ $^
	ranlib $@

TESTCMO=test.cmo
TESTCMX=$(TESTCMO:.cmo=.cmx)

test.opt: $(CMXA) $(TESTCMX)
	$(OCAMLOPT) $(OFLAGS) -o $@ $^ -cclib "-L."

test.byte: $(CMA) $(TESTCMO)
	$(OCAMLC) $(BFLAGS) -o $@ $^ -cclib "-L."

TESTCRCMO=test_cr.cmo
TESTCRCMX=$(TESTCRCMO:.cmo=.cmx)

test_cr.opt: $(CMXA) $(TESTCRCMX)
	$(OCAMLOPT) $(OFLAGS) -o $@ $^ -cclib "-L."

test_cr.byte: $(CMA) $(TESTCRCMO)
	$(OCAMLC) $(BFLAGS) -o $@ $^ -cclib "-L."

md.opt: $(CMXA) md.ml
	$(OCAMLOPT) $(OFLAGS) -o $@ $^ -cclib "-L."
md_cr.opt: $(CMXA) md_cr.ml
	$(OCAMLOPT) $(OFLAGS) -o $@ $^ -cclib "-L."

TRACECMO=trace.cmo
TRACECMX=$(TRACECMO:.cmo=.cmx)

trace.opt: $(CMXA) $(TRACECMX)
	$(OCAMLOPT) $(OFLAGS) -o $@ graphics.cmxa $^  -cclib "-L."

trace.byte: $(CMA) $(TRACECMO)
	$(OCAMLC) $(BFLAGS) -o $@ graphics.cma $^ -cclib "-L."

CALCCMO=calc.cmo
CALCCMX=$(CALCCMO:.cmo=.cmx)

ecalc.opt: $(CMXA) $(CALCCMX)
	$(OCAMLOPT) $(OFLAGS) -o $@ $^ -cclib "-L."

ecalc.byte: $(CMA) $(CALCCMO)
	$(OCAMLC) $(BFLAGS) -o $@ $^ -cclib "-L."

GENERATED=calc.ml

GMPPP=gmp_pp.cmo install_gmp_pp.cmo

ocamlgmp: mlgmp/gmp.cma $(GMPPP)
	ocamlmktop -custom -o $@ $^

CREALPP=creal_pp.cmo install_creal_pp.cmo

ocamlcreal: creal.cma $(GMPPP) $(CREALPP)
	ocamlmktop -o $@ $^ -cclib "-L."

test: test.opt
	./test.opt -check -p 50

bench: test.opt
	echo -n `date +"%a %d/%m/%Y %H:%M"` >> bench.log
	/usr/bin/time -f "  user = %Us system = %Ss" -o bench.log -a ./test.opt -silent -p 100

# install
#########

GMPBYTEFILES = mlgmp/gmp.cma mlgmp/gmp.cmi mlgmp/gmp.mli mlgmp/libmlgmp.a
GMPOPTFILES = mlgmp/gmp.cmxa mlgmp/gmp.a
BYTEFILES = $(CMA) $(CMI) $(MLI)
OPTFILES = $(CMXA) creal.a libcreal.a

LIBDIR = @OCAMLLIB@/creal

install: install-prog install-lib install-toplevels

install-lib: install-lib-@OCAMLBEST@

install-prog: install-prog-@OCAMLBEST@

install-lib-byte:
	mkdir -p $(LIBDIR)
	cp -f $(BYTEFILES) $(GMPBYTEFILES) $(LIBDIR)

install-prog-byte:
	mkdir -p $(BINDIR)
	cp ecalc.byte $(BINDIR)/ecalc

install-lib-opt:
	mkdir -p $(LIBDIR)
	cp -f $(BYTEFILES) $(GMPBYTEFILES) $(LIBDIR)
	cp -f $(OPTFILES) $(GMPOPTFILES) $(LIBDIR)

install-prog-opt:
	mkdir -p $(BINDIR)
	cp ecalc.opt $(BINDIR)/ecalc

install-toplevels:
	if test -f ocamlgmp; then \
	  cp -f ocamlgmp $(BINDIR); \
	  cp -f gmp_pp.cmi $(LIBDIR); \
	fi
	if test -f ocamlcreal; then \
	  cp -f ocamlcreal $(BINDIR); \
	  cp -f creal_pp.cmi $(LIBDIR); \
	fi

local:
	cp ecalc.opt $$HOME/bin/$$OSTYPE/ecalc

# l.p.
######

doc: creal.dvi

WEBFILES = macros.tex creal.mli creal.ml

creal.tex: $(WEBFILES)
	ocamlweb --no-index $(WEBFILES) -o $@

creal.dvi: creal.tex
	latex creal && latex creal

creal.ps: creal.dvi
	dvips creal.dvi -o

creal.ps.gz: creal.ps
	gzip -f --best creal.ps

# export
########

VERSION=@VERSION@
NAME=creal-$(VERSION)

SOURCES = *.mli *.ml mlgmp/*.mli mlgmp/*.ml \
	  mlgmp/*.c mlgmp/*.h \
	  calc.mll configure configure.in \
          Makefile.in creal.spec.in .depend README COPYING LGPL CHANGES

FTP=$(HOME)/WWW/ftp/ocaml/ds

export:: creal.ps.gz $(SOURCES)
	mkdir -p export/$(NAME)
	cp --parents $(SOURCES) export/$(NAME)
	(cd export; tar cf $(NAME).tar $(NAME); \
	gzip -f --best $(NAME).tar)
	cp -f creal.mli creal.ps.gz export/$(NAME).tar.gz $(FTP)
	caml2html -d $(FTP) cr.mli creal.mli
	ocamldoc -html -d $(FTP)/../creal -I mlgmp creal.mli cr.mli

# generic rules :
#################

.SUFFIXES: .mli .ml .cmi .cmo .cmx .mll .mly

.mli.cmi:
	$(OCAMLC) -c $(BFLAGS) $<

.ml.cmo:
	$(OCAMLC) -c $(BFLAGS) $<

.c.o:
	$(OCAMLC) -ccopt "-o $@" -c $< 

.ml.o:
	$(OCAMLOPT) -c $(OFLAGS) $<

.ml.cmx:
	$(OCAMLOPT) -c $(OFLAGS) $<

.mll.ml:
	$(OCAMLLEX) $<

.mly.ml:
	$(OCAMLYACC) -v $<

.mly.mli:
	$(OCAMLYACC) -v $<


# myself
########

Makefile: Makefile.in config.status
	./config.status

config.status: configure
	./config.status --recheck

configure: configure.in
	autoconf 

# clean and depend
##################

clean:
	rm -f *~ *.a *.cm[aiox] *.cmxa *.o *.aux *.log
	rm -f mlgmp/*~ mlgmp/*.cm[aiox] mlgmp/*.o mlgmp/*.a mlgmp/*.cmxa
	rm -f $(GENERATED)
	rm -f creal.tex creal.dvi creal.ps creal.ps.gz
	rm -f test.byte test.opt ecalc.byte ecalc.opt
	rm -f ocamlgmp ocamlcreal

depend: $(GENERATED)
	rm -f .depend
	@OCAMLDEP@ $(INCLUDES) mlgmp/*.mli mlgmp/*.ml *.mli *.ml > .depend

include .depend