File: Makefile.in

package info (click to toggle)
orpie 1.5.2-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 1,924 kB
  • ctags: 2,720
  • sloc: ml: 13,872; ansic: 3,754; makefile: 310; sh: 11; python: 11
file content (368 lines) | stat: -rw-r--r-- 10,639 bytes parent folder | download
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
#
# sample Makefile for Objective Caml
# Copyright (C) 2001 Jean-Christophe FILLIATRE
#
# modified 10/26/2003 by Paul Pelzl, for the purpose of building Orpie
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License version 2, as published by the Free Software Foundation.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 
# See the GNU Library General Public License version 2 for more details
# (enclosed in the file LGPL).

# where to install the binaries, rcfiles, manpages, etc.
prefix      = @prefix@
exec_prefix = @exec_prefix@
sysconfdir  = @sysconfdir@
datarootdir = @datarootdir@
BINDIR      = $(DESTDIR)/@bindir@
MANDIR      = $(DESTDIR)/@mandir@

# other variables set by ./configure
OCAMLC       = @OCAMLC@
OCAMLOPT     = @OCAMLOPT@
OCAMLDEP     = @OCAMLDEP@
OCAMLLIB     = @OCAMLLIB@
OCAMLBEST    = @OCAMLBEST@
OCAMLLEX     = @OCAMLLEX@
OCAMLYACC    = @OCAMLYACC@
OCAMLVERSION = @OCAMLVERSION@
OCAMLWIN32   = @OCAMLWIN32@
EXE          = @EXE@
DEFS         = @DEFS@
CC           = @CC@
CFLAGS       = @CFLAGS@
CPPFLAGS     = @CPPFLAGS@
LDFLAGS      = @LDFLAGS@


CURSES_LIB = @CURSES_LIB@
GSL_LIB    = @GSL_LIB@

INCLUDES = -I ./curses -I ./gsl -I ./units
BFLAGS   = -pp camlp4o -g $(INCLUDES) -thread
OFLAGS   = -pp camlp4o $(INCLUDES) -thread
BLFLAGS  = -custom -cclib '$(LDFLAGS) $(CURSES_LIB) $(GSL_LIB) -lm'
OLFLAGS  = -cclib '$(LDFLAGS) $(CURSES_LIB) $(GSL_LIB) -lm'
DEPFLAGS = -pp camlp4o

# main target
#############

NAME  = orpie
NAME2 = orpie-curses-keys

all: $(OCAMLBEST)



# bytecode and native-code compilation
######################################

CMO = big_int_str.cmo gsl_assist.cmo install.cmo operations.cmo utility.cmo \
	   version.cmo rcfile.cmo rpc_stack.cmo add.cmo sub.cmo mult.cmo div.cmo inv.cmo \
		pow.cmo solvelin.cmo rpc_calc.cmo txtin_parser.cmo txtin_lexer.cmo \
		statefile.cmo interface.cmo interface_draw.cmo interface_main.cmo main.cmo
CMX = $(CMO:.cmo=.cmx)
CMA = nums.cma bigarray.cma str.cma unix.cma threads.cma
CMXA = $(CMA:.cma=.cmxa)

CURSES_CMO = curses/curses.cmo
CURSES_CMX = curses/curses.cmx
CURSES_COBJS = curses/ml_curses.o
CURSES_BOBJS = $(CURSES_CMO) $(CURSES_COBJS)
CURSES_OOBJS = $(CURSES_CMX) $(CURSES_COBJS)

GSL_CMO = gsl/gsl_error.cmo gsl/gsl_blas.cmo gsl/gsl_complex.cmo gsl/gsl_matrix.cmo gsl/gsl_matrix_complex.cmo \
		gsl/gsl_vector.cmo gsl/gsl_vector_complex.cmo gsl/gsl_vector_flat.cmo gsl/gsl_matrix_flat.cmo \
		gsl/gsl_vector_complex_flat.cmo gsl/gsl_matrix_complex_flat.cmo gsl/gsl_vectmat.cmo \
		gsl/gsl_permut.cmo gsl/gsl_linalg.cmo gsl/gsl_fun.cmo gsl/gsl_sf.cmo gsl/gsl_math.cmo
GSL_CMX = $(GSL_CMO:.cmo=.cmx)
GSL_COBJS = gsl/mlgsl_error.o gsl/mlgsl_blas.o gsl/mlgsl_blas_complex.o gsl/mlgsl_complex.o gsl/mlgsl_blas_float.o \
		 gsl/mlgsl_blas_complex_float.o gsl/mlgsl_matrix_complex.o gsl/mlgsl_matrix_double.o gsl/mlgsl_matrix_float.o \
		 gsl/mlgsl_matrix_complex_float.o gsl/mlgsl_vector_double.o gsl/mlgsl_vector_float.o \
		 gsl/mlgsl_permut.o gsl/mlgsl_linalg.o gsl/mlgsl_linalg_complex.o gsl/mlgsl_fun.o gsl/mlgsl_math.o gsl/mlgsl_sf.o
GSL_BOBJS = $(GSL_COBJS) $(GSL_CMO)
GSL_OOBJS = $(GSL_COBJS) $(GSL_CMX)

UNITS_CMO = units/units.cmo
UNITS_CMX = $(UNITS_CMO:.cmo=.cmx)

TEST_CMO = big_int_str.cmo gsl_assist.cmo install.cmo operations.cmo utility.cmo \
	   version.cmo rpc_stack.cmo add.cmo sub.cmo mult.cmo div.cmo inv.cmo pow.cmo \
		solvelin.cmo rpc_calc.cmo txtin_parser.cmo txtin_lexer.cmo calc_test.cmo
TEST_CMX = $(TEST_CMO:.cmo=.cmx)

GENERATED = version.ml

# special case: generated parser depends on the .cmi file
txtin_parser.cmo: txtin_parser.ml txtin_parser.cmi
	$(OCAMLC) -c $(BFLAGS) $<

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

byte: $(NAME).byte $(NAME2).byte
opt: $(NAME).opt $(NAME2).opt
static: $(NAME).static-opt $(NAME2).static-opt

$(NAME).byte: $(CURSES_BOBJS) $(GSL_BOBJS) $(UNITS_CMO) $(CMO)
	$(OCAMLC) $(BFLAGS) $(BLFLAGS) -o $@ $(CURSES_BOBJS) $(CMA) $(GSL_BOBJS) $(UNITS_CMO) $(CMO) 

$(NAME2).byte: $(CURSES_BOBJS) curses_assist.cmo curses_keys.cmo
	$(OCAMLC) $(BFLAGS) $(BLFLAGS) -o $@ $(CURSES_BOBJS) $(CMA) curses_assist.cmo curses_keys.cmo

$(NAME).opt: $(CURSES_OOBJS) $(GSL_OOBJS) $(UNITS_CMX) $(CMX)
	$(OCAMLOPT) $(OFLAGS) -o $@ $(CURSES_OOBJS) $(CMXA) $(GSL_OOBJS) $(UNITS_CMX) $(CMX) $(OLFLAGS)

$(NAME2).opt: $(CURSES_OOBJS) curses_assist.cmx curses_keys.cmx
	$(OCAMLOPT) $(OFLAGS) -o $@ $(CURSES_OOBJS) $(CMXA) curses_assist.cmx curses_keys.cmx $(OLFLAGS)

# static build seems to require mashing all the C objects into a library
$(NAME).static-opt: $(UNITS_CMX) $(CMX) $(CURSES_OOBJS) $(GSL_OOBJS) my-static-libs
	$(OCAMLOPT) $(OFLAGS) -I . -ccopt -static -cclib '$(LDFLAGS) -lmycurses -lmygsl $(CURSES_LIB) $(GSL_LIB) -lm' -o $@ $(CMXA) \
	curses.cmx $(GSL_CMX) $(UNITS_CMX) $(CMX)
	strip $(NAME).static-opt

$(NAME2).static-opt: $(CURSES_OOBJS) curses_assist.cmx curses_keys.cmx my-static-libs
	$(OCAMLOPT) $(OFLAGS) -I . -ccopt -static -cclib '$(LDFLAGS) -lmycurses $(CURSES_LIB) -lm' -o $@ $(CMXA) curses.cmx \
	curses_assist.cmx curses_keys.cmx
	strip $(NAME2).static-opt

my-static-libs:
	ar cr libmycurses.a curses/*.o
	ar cr libmygsl.a gsl/*.o

# calculator testing program
test.opt: $(GSL_OOBJS) $(UNITS_CMX) $(TEST_CMX)
	$(OCAMLOPT) $(OFLAGS) -o $@ $(CMXA) $(GSL_OOBJS) $(UNITS_CMX) $(TEST_CMX) -cclib '$(GSL_LIB) -lm'


VERSION=1.5.2

version.ml: Makefile
	echo "let version = \""$(VERSION)"\"" > version.ml
	echo "let date = \""`date`"\"" >> version.ml


# installation
##############

install-indep: 
	mkdir -p $(BINDIR)
	mkdir -p $(DESTDIR)/$(sysconfdir)
	mkdir -p $(MANDIR)/man1
	mkdir -p $(MANDIR)/man5
	install -m 644 orpierc $(DESTDIR)/$(sysconfdir)
	install -m 644 doc/orpie.1 $(MANDIR)/man1/orpie.1
	install -m 644 doc/orpie-curses-keys.1 $(MANDIR)/man1/orpie-curses-keys.1
	install -m 644 doc/orpierc.5 $(MANDIR)/man5/orpierc.5

install: install-indep
	install -m 755 $(NAME).$(OCAMLBEST) $(BINDIR)/$(NAME)$(EXE)
	install -m 755 $(NAME2).$(OCAMLBEST) $(BINDIR)/$(NAME2)$(EXE)

install-byte: install-indep
	install -m 755 $(NAME).byte $(BINDIR)/$(NAME)$(EXE)
	install -m 755 $(NAME2).byte $(BINDIR)/$(NAME2)$(EXE)

install-opt: install-indep
	install -m 755 $(NAME).opt $(BINDIR)/$(NAME)$(EXE)
	install -m 755 $(NAME2).opt $(BINDIR)/$(NAME2)$(EXE)

install-static: install-indep
	install -m 755 -D $(NAME).static-opt $(BINDIR)/$(NAME)$(EXE)
	install -m 755 -D $(NAME2).static-opt $(BINDIR)/$(NAME2)$(EXE)

uninstall:
	rm -f $(BINDIR)/$(NAME)$(EXE)
	rm -f $(BINDIR)/$(NAME2)$(EXE)
	rm -f $(DESTDIR)/$(sysconfdir)/orpierc
	rm -f $(MANDIR)/man1/orpie.1
	rm -f $(MANDIR)/man1/orpie-curses-keys.1
	rm -f $(MANDIR)/man5/orpierc.5


# generic rules
###############

.SUFFIXES:


# GSL build rules
gsl-opt: $(GSL_OOBJS)
gsl-byte: $(GSL_BOBJS)

GSL_INCLUDES = -I ./gsl
GSL_BFLAGS = -g $(GSL_INCLUDES) -thread
GSL_OFLAGS = $(GSL_INCLUDES) -thread
GSL_CFLAGS = @GSL_CFLAGS@ $(CPPFLAGS) $(CFLAGS) -DHAVE_INLINE -DHAVE_FENV -g -O2

gsl/%.cmi : gsl/%.mli
	$(OCAMLC) -c $(GSL_BFLAGS) $<

gsl/%.cmo : gsl/%.ml
	$(OCAMLC) -c $(GSL_BFLAGS) $<

gsl/%.o : gsl/%.ml
	$(OCAMLOPT) -c $(GSL_OFLAGS) $<

gsl/%.cmx : gsl/%.ml
	$(OCAMLOPT) -c $(GSL_OFLAGS) $<

gsl/%.o : gsl/%.c
	cd gsl && $(OCAMLC) -ccopt "$(GSL_CFLAGS)" -c $*.c


# curses build rules
curses-opt: $(CURSES_OOBJS)
curses-byte: $(CURSES_BOBJS)

curses/curses.ml:	curses/curses.ml.in curses/functions.c
	$(MAKE) -C curses

curses/functions.c:	curses/functions.c.in
	$(MAKE) -C curses

CURSES_INCLUDES = -I ./curses
CURSES_BFLAGS = -g $(CURSES_INCLUDES) -thread
CURSES_OFLAGS = $(CURSES_INCLUDES) -thread
CURSES_CFLAGS = -Wall -fPIC -DPIC $(CPPFLAGS) $(CFLAGS)

curses/%.cmi : curses/%.mli
	$(OCAMLC) -c $(CURSES_BFLAGS) $<

curses/%.cmo : curses/%.ml
	$(OCAMLC) -c $(CURSES_BFLAGS) $<

curses/%.o : curses/%.ml
	$(OCAMLOPT) -c $(CURSES_OFLAGS) $<

curses/%.cmx : curses/%.ml
	$(OCAMLOPT) -c $(CURSES_OFLAGS) $<

curses/%.o : curses/%.c
	cd curses && $(OCAMLC) -ccopt "$(CURSES_CFLAGS)" -c $*.c


# Units build rules
gsl-opt: $(UNITS_CMX)
gsl-byte: $(UNITS_CMO)

UNITS_INCLUDES = -I ./units
UNITS_BFLAGS = -g $(UNITS_INCLUDES) -thread
UNITS_OFLAGS = $(UNITS_INCLUDES) -thread

units/%.cmi : units/%.mli
	$(OCAMLC) -c $(UNITS_BFLAGS) $<

units/%.cmo : units/%.ml
	$(OCAMLC) -c $(UNITS_BFLAGS) $<

units/%.o : units/%.ml
	$(OCAMLOPT) -c $(UNITS_OFLAGS) $<

units/%.cmx : units/%.ml
	$(OCAMLOPT) -c $(UNITS_OFLAGS) $<


# generic build rules for toplevel directory
%.cmi : %.mli
	$(OCAMLC) -c $(BFLAGS) $<

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

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

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

%.ml : %.mll
	$(OCAMLLEX) $<

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

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



# Emacs tags
############

tags:
	find . -name "*.ml*" | sort -r | xargs \
	etags "--regex=/let[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/and[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/type[ \t]+\([^ \t]+\)/\1/" \
              "--regex=/exception[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/val[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/module[ \t]+\([^ \t]+\)/\1/"

# vi tags
#########

vtags:
	otags -vi -o tags *.ml


# Makefile is rebuilt whenever Makefile.in or configure.in is modified
######################################################################

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

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

configure: configure.in
	autoconf 

# clean
#######

partly-clean::
	rm -f *.cm[iox] *.o *.a *~ txtin*.ml txtin*.mli *.output
	rm -f $(GENERATED) parser.output
	rm -f $(NAME).byte $(NAME).opt $(NAME2).byte $(NAME2).opt $(NAME).static-opt $(NAME2).static-opt
	rm -f *.aux *.log $(NAME).tex $(NAME).dvi $(NAME).ps

gsl-clean::
	rm -f gsl/*.cm[iox] gsl/*.o *~

curses-clean::
	rm -f curses/*.cm[iox] curses/*.o *~

units-clean::
	rm -f units/*.cm[iox] units/*.o *~

clean:: partly-clean gsl-clean curses-clean units-clean

dist-clean distclean:: clean
	rm -f Makefile config.cache config.log config.status install.ml


# depend
########

depend::
	$(MAKE) txtin_lexer.ml
	$(MAKE) txtin_parser.ml
	$(OCAMLDEP) -pp camlp4o $(INCLUDES) *.ml *.mli > depend
	$(OCAMLDEP) -pp camlp4o $(INCLUDES) units/*.ml units/*.mli >> depend
	$(OCAMLDEP) -pp cpp -I ./curses curses/*.ml curses/*.mli >> depend
	$(OCAMLDEP) -I ./gsl gsl/*.ml gsl/*.mli >> depend

include depend


# arch-tag: DO_NOT_CHANGE_bdb62873-ffd0-4d79-819e-880467e18f28