~ubuntu-branches/ubuntu/quantal/orpie/quantal

« back to all changes in this revision

Viewing changes to Makefile.in

  • Committer: Bazaar Package Importer
  • Author(s): Uwe Steinmann
  • Date: 2004-09-20 14:18:45 UTC
  • Revision ID: james.westby@ubuntu.com-20040920141845-j092sbrg4hd0nfsf
Tags: upstream-1.4.1
ImportĀ upstreamĀ versionĀ 1.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# sample Makefile for Objective Caml
 
3
# Copyright (C) 2001 Jean-Christophe FILLIATRE
 
4
#
 
5
# modified 10/26/2003 by Paul Pelzl, for the purpose of building Orpie
 
6
 
7
# This library is free software; you can redistribute it and/or
 
8
# modify it under the terms of the GNU Library General Public
 
9
# License version 2, as published by the Free Software Foundation.
 
10
 
11
# This library is distributed in the hope that it will be useful,
 
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
14
 
15
# See the GNU Library General Public License version 2 for more details
 
16
# (enclosed in the file LGPL).
 
17
 
 
18
# where to install the binaries
 
19
prefix=@prefix@
 
20
exec_prefix=@exec_prefix@
 
21
BINDIR=$(DESTDIR)/@bindir@
 
22
 
 
23
# where to install the man page
 
24
MANDIR=$(DESTDIR)/@mandir@
 
25
 
 
26
# other variables set by ./configure
 
27
OCAMLC       = @OCAMLC@
 
28
OCAMLOPT     = @OCAMLOPT@
 
29
OCAMLDEP     = @OCAMLDEP@
 
30
OCAMLLIB     = @OCAMLLIB@
 
31
OCAMLBEST    = @OCAMLBEST@
 
32
OCAMLLEX     = @OCAMLLEX@
 
33
OCAMLYACC    = @OCAMLYACC@
 
34
OCAMLVERSION = @OCAMLVERSION@
 
35
OCAMLWIN32   = @OCAMLWIN32@
 
36
EXE          = @EXE@
 
37
 
 
38
CURSES_LIB = @CURSES_LIB@
 
39
GSL_LIB    = @GSL_LIB@
 
40
 
 
41
INCLUDES = -I ./curses -I ./gsl -I ./units
 
42
BFLAGS   = -pp camlp4o -g $(INCLUDES) -thread
 
43
OFLAGS   = -pp camlp4o $(INCLUDES) -thread
 
44
BLFLAGS  = -custom -cclib '$(CURSES_LIB) $(GSL_LIB) -lm'
 
45
OLFLAGS  = -cclib '$(CURSES_LIB) $(GSL_LIB) -lm'
 
46
DEPFLAGS = -pp camlp4o
 
47
 
 
48
# main target
 
49
#############
 
50
 
 
51
NAME  = orpie
 
52
NAME2 = orpie-curses-keys
 
53
 
 
54
all: $(OCAMLBEST)
 
55
 
 
56
 
 
57
 
 
58
# bytecode and native-code compilation
 
59
######################################
 
60
 
 
61
CMO = big_int_str.cmo gsl_assist.cmo install.cmo operations.cmo utility.cmo rcfile.cmo \
 
62
           version.cmo rpc_stack.cmo add.cmo sub.cmo mult.cmo div.cmo inv.cmo pow.cmo \
 
63
                solvelin.cmo rpc_calc.cmo txtin_parser.cmo txtin_lexer.cmo interface.cmo interface_draw.cmo \
 
64
                interface_main.cmo main.cmo
 
65
CMX = $(CMO:.cmo=.cmx)
 
66
CMA = nums.cma bigarray.cma str.cma unix.cma threads.cma
 
67
CMXA = $(CMA:.cma=.cmxa)
 
68
 
 
69
CURSES_CMO = curses/curses.cmo
 
70
CURSES_CMX = curses/curses.cmx
 
71
CURSES_COBJS = curses/ml_curses.o
 
72
CURSES_BOBJS = $(CURSES_CMO) $(CURSES_COBJS)
 
73
CURSES_OOBJS = $(CURSES_CMX) $(CURSES_COBJS)
 
74
 
 
75
GSL_CMO = gsl/gsl_error.cmo gsl/gsl_blas.cmo gsl/gsl_complex.cmo gsl/gsl_matrix.cmo gsl/gsl_matrix_complex.cmo \
 
76
                gsl/gsl_vector.cmo gsl/gsl_vector_complex.cmo gsl/gsl_vector_flat.cmo gsl/gsl_matrix_flat.cmo \
 
77
                gsl/gsl_vector_complex_flat.cmo gsl/gsl_matrix_complex_flat.cmo gsl/gsl_vectmat.cmo \
 
78
                gsl/gsl_permut.cmo gsl/gsl_linalg.cmo gsl/gsl_fun.cmo
 
79
GSL_CMX = $(GSL_CMO:.cmo=.cmx)
 
80
GSL_COBJS = gsl/mlgsl_error.o gsl/mlgsl_blas.o gsl/mlgsl_blas_complex.o gsl/mlgsl_complex.o \
 
81
                 gsl/mlgsl_matrix_complex.o gsl/mlgsl_matrix_double.o gsl/mlgsl_vector_double.o gsl/mlgsl_permut.o \
 
82
                 gsl/mlgsl_linalg.o gsl/mlgsl_linalg_complex.o gsl/mlgsl_fun.o gsl/mlgsl_math.o gsl/mlgsl_sf.o
 
83
GSL_BOBJS = $(GSL_COBJS) $(GSL_CMO)
 
84
GSL_OOBJS = $(GSL_COBJS) $(GSL_CMX)
 
85
 
 
86
UNITS_CMO = units/units.cmo units/constants.cmo
 
87
UNITS_CMX = $(UNITS_CMO:.cmo=.cmx)
 
88
 
 
89
TEST_CMO = big_int_str.cmo gsl_assist.cmo install.cmo operations.cmo utility.cmo rcfile.cmo \
 
90
           version.cmo rpc_stack.cmo add.cmo sub.cmo mult.cmo div.cmo inv.cmo pow.cmo \
 
91
                solvelin.cmo rpc_calc.cmo txtin_parser.cmo txtin_lexer.cmo calc_test.cmo
 
92
TEST_CMX = $(TEST_CMO:.cmo=.cmx)
 
93
 
 
94
GENERATED = version.ml
 
95
 
 
96
# special case: generated parser depends on the .cmi file
 
97
txtin_parser.cmo: txtin_parser.ml txtin_parser.cmi
 
98
        $(OCAMLC) -c $(BFLAGS) $<
 
99
 
 
100
txtin_parser.cmx: txtin_parser.ml txtin_parser.cmi
 
101
        $(OCAMLOPT) -c $(OFLAGS) $<
 
102
 
 
103
byte: $(NAME).byte $(NAME2).byte
 
104
opt: $(NAME).opt $(NAME2).opt
 
105
static: $(NAME).static-opt $(NAME2).static-opt
 
106
 
 
107
$(NAME).byte: $(CURSES_BOBJS) $(GSL_BOBJS) $(UNITS_CMO) $(CMO)
 
108
        $(OCAMLC) $(BFLAGS) $(BLFLAGS) -o $@ $(CURSES_BOBJS) $(CMA) $(GSL_BOBJS) $(UNITS_CMO) $(CMO) 
 
109
 
 
110
$(NAME2).byte: $(CURSES_BOBJS) utility.cmo curses-keys.cmo
 
111
        $(OCAMLC) $(BFLAGS) $(BLFLAGS) -o $@ $(CURSES_BOBJS) $(CMA) utility.cmo curses-keys.cmo
 
112
 
 
113
$(NAME).opt: $(CURSES_OOBJS) $(GSL_OOBJS) $(UNITS_CMX) $(CMX)
 
114
        $(OCAMLOPT) $(OFLAGS) -o $@ $(CURSES_OOBJS) $(CMXA) $(GSL_OOBJS) $(UNITS_CMX) $(CMX) $(OLFLAGS)
 
115
 
 
116
$(NAME2).opt: $(CURSES_OOBJS) utility.cmx curses-keys.cmx
 
117
        $(OCAMLOPT) $(OFLAGS) -o $@ $(CURSES_OOBJS) $(CMXA) utility.cmx curses-keys.cmx $(OLFLAGS)
 
118
 
 
119
# static build seems to require mashing all the C objects into a library
 
120
$(NAME).static-opt: $(UNITS_CMX) $(CMX) $(CURSES_OOBJS) $(GSL_OOBJS) my-static-libs
 
121
        $(OCAMLOPT) $(OFLAGS) -I . -ccopt -static -cclib '-lmycurses -lmygsl $(CURSES_LIB) $(GSL_LIB) -lm' -o $@ $(CMXA) \
 
122
        curses.cmx $(GSL_CMX) $(UNITS_CMX) $(CMX)
 
123
        strip $(NAME).static-opt
 
124
 
 
125
$(NAME2).static-opt: $(CURSES_OOBJS) utility.cmx curses-keys.cmx my-static-libs
 
126
        $(OCAMLOPT) $(OFLAGS) -I . -ccopt -static -cclib '-lmycurses $(CURSES_LIB) -lm' -o $@ $(CMXA) curses.cmx \
 
127
        utility.cmx curses-keys.cmx
 
128
        strip $(NAME2).static-opt
 
129
 
 
130
my-static-libs:
 
131
        ar cr libmycurses.a curses/*.o
 
132
        ar cr libmygsl.a gsl/*.o
 
133
 
 
134
# calculator testing program
 
135
test.opt: $(CURSES_OOBJS) $(GSL_OOBJS) $(UNITS_CMX) $(TEST_CMX)
 
136
        $(OCAMLOPT) $(OFLAGS) -o $@ $(CURSES_OOBJS) $(CMXA) $(GSL_OOBJS) $(UNITS_CMX) $(TEST_CMX) $(OLFLAGS)
 
137
 
 
138
 
 
139
VERSION=1.4.1
 
140
 
 
141
version.ml: Makefile
 
142
        echo "let version = \""$(VERSION)"\"" > version.ml
 
143
        echo "let date = \""`date`"\"" >> version.ml
 
144
 
 
145
 
 
146
# installation
 
147
##############
 
148
 
 
149
install-indep: 
 
150
        mkdir -p $(BINDIR)
 
151
        if test "$(prefix)" = "/usr"; then \
 
152
                mkdir -p $(DESTDIR)/etc; \
 
153
        install -m 644 orpierc $(DESTDIR)/etc; \
 
154
        else \
 
155
                mkdir -p $(DESTDIR)/$(prefix)/etc; \
 
156
                install -m 644 orpierc $(DESTDIR)/$(prefix)/etc; \
 
157
        fi
 
158
        install -m 644 -D doc/orpie.1 $(MANDIR)/man1/orpie.1
 
159
        install -m 644 -D doc/orpie-curses-keys.1 $(MANDIR)/man1/orpie-curses-keys.1
 
160
        install -m 644 -D doc/orpierc.5 $(MANDIR)/man5/orpierc.5
 
161
 
 
162
install: install-indep
 
163
        install -m 755 -D $(NAME).$(OCAMLBEST) $(BINDIR)/$(NAME)$(EXE)
 
164
        install -m 755 -D $(NAME2).$(OCAMLBEST) $(BINDIR)/$(NAME2)$(EXE)
 
165
 
 
166
install-byte: install-indep
 
167
        install -m 755 -D $(NAME).byte $(BINDIR)/$(NAME)$(EXE)
 
168
        install -m 755 -D $(NAME2).byte $(BINDIR)/$(NAME2)$(EXE)
 
169
 
 
170
install-opt: install-indep
 
171
        install -m 755 -D $(NAME).opt $(BINDIR)/$(NAME)$(EXE)
 
172
        install -m 755 -D $(NAME2).opt $(BINDIR)/$(NAME2)$(EXE)
 
173
 
 
174
install-static: install-indep
 
175
        install -m 755 -D $(NAME).static-opt $(BINDIR)/$(NAME)$(EXE)
 
176
        install -m 755 -D $(NAME2).static-opt $(BINDIR)/$(NAME2)$(EXE)
 
177
 
 
178
uninstall:
 
179
        rm -f $(BINDIR)/$(NAME)$(EXE)
 
180
        rm -f $(BINDIR)/$(NAME2)$(EXE)
 
181
        if test "$(prefix)" = "/usr"; then\
 
182
        rm -f /etc/orpierc; \
 
183
        else rm -f $(DESTDIR)/$(prefix)/etc/orpierc; \
 
184
        fi
 
185
        rm -f $(MANDIR)/man1/orpie.1
 
186
        rm -f $(MANDIR)/man1/orpie-curses-keys.1
 
187
        rm -f $(MANDIR)/man5/orpierc.5
 
188
 
 
189
 
 
190
# generic rules
 
191
###############
 
192
 
 
193
.SUFFIXES:
 
194
 
 
195
 
 
196
# GSL build rules
 
197
gsl-opt: $(GSL_OOBJS)
 
198
gsl-byte: $(GSL_BOBJS)
 
199
 
 
200
GSL_INCLUDES = -I ./gsl
 
201
GSL_BFLAGS = -g $(GSL_INCLUDES) -thread
 
202
GSL_OFLAGS = $(GSL_INCLUDES) -thread
 
203
GSL_CFLAGS = -Wall -fPIC -DPIC
 
204
 
 
205
gsl/%.cmi : gsl/%.mli
 
206
        $(OCAMLC) -c $(GSL_BFLAGS) $<
 
207
 
 
208
gsl/%.cmo : gsl/%.ml
 
209
        $(OCAMLC) -c $(GSL_BFLAGS) $<
 
210
 
 
211
gsl/%.o : gsl/%.ml
 
212
        $(OCAMLOPT) -c $(GSL_OFLAGS) $<
 
213
 
 
214
gsl/%.cmx : gsl/%.ml
 
215
        $(OCAMLOPT) -c $(GSL_OFLAGS) $<
 
216
 
 
217
gsl/%.o : gsl/%.c
 
218
        cd gsl && $(OCAMLC) -ccopt "$(GSL_CFLAGS)" -c $*.c
 
219
 
 
220
 
 
221
# curses build rules
 
222
curses-opt: $(CURSES_OOBJS)
 
223
curses-byte: $(CURSES_BOBJS)
 
224
 
 
225
CURSES_INCLUDES = -I ./curses
 
226
CURSES_BFLAGS = -g $(CURSES_INCLUDES) -thread
 
227
CURSES_OFLAGS = $(CURSES_INCLUDES) -thread
 
228
CURSES_CFLAGS = -Wall -fPIC -DPIC
 
229
 
 
230
curses/%.cmi : curses/%.mli
 
231
        $(OCAMLC) -pp cpp -c $(CURSES_BFLAGS) $<
 
232
 
 
233
curses/%.cmo : curses/%.ml
 
234
        $(OCAMLC) -pp cpp -c $(CURSES_BFLAGS) $<
 
235
 
 
236
curses/%.o : curses/%.ml
 
237
        $(OCAMLOPT) -pp cpp -c $(CURSES_OFLAGS) $<
 
238
 
 
239
curses/%.cmx : curses/%.ml
 
240
        $(OCAMLOPT) -pp cpp -c $(CURSES_OFLAGS) $<
 
241
 
 
242
curses/%.o : curses/%.c
 
243
        cd curses && $(OCAMLC) -ccopt "$(CURSES_CFLAGS)" -c $*.c
 
244
 
 
245
 
 
246
# Units build rules
 
247
gsl-opt: $(UNITS_CMX)
 
248
gsl-byte: $(UNITS_CMO)
 
249
 
 
250
UNITS_INCLUDES = -I ./units
 
251
UNITS_BFLAGS = -g $(UNITS_INCLUDES) -thread
 
252
UNITS_OFLAGS = $(UNITS_INCLUDES) -thread
 
253
 
 
254
units/%.cmi : units/%.mli
 
255
        $(OCAMLC) -c $(UNITS_BFLAGS) $<
 
256
 
 
257
units/%.cmo : units/%.ml
 
258
        $(OCAMLC) -c $(UNITS_BFLAGS) $<
 
259
 
 
260
units/%.o : units/%.ml
 
261
        $(OCAMLOPT) -c $(UNITS_OFLAGS) $<
 
262
 
 
263
units/%.cmx : units/%.ml
 
264
        $(OCAMLOPT) -c $(UNITS_OFLAGS) $<
 
265
 
 
266
 
 
267
# generic build rules for toplevel directory
 
268
%.cmi : %.mli
 
269
        $(OCAMLC) -c $(BFLAGS) $<
 
270
 
 
271
%.cmo : %.ml
 
272
        $(OCAMLC) -c $(BFLAGS) $<
 
273
 
 
274
%.o : %.ml
 
275
        $(OCAMLOPT) -c $(OFLAGS) $<
 
276
 
 
277
%.cmx : %.ml
 
278
        $(OCAMLOPT) -c $(OFLAGS) $<
 
279
 
 
280
%.ml : %.mll
 
281
        $(OCAMLLEX) $<
 
282
 
 
283
%.ml : %.mly
 
284
        $(OCAMLYACC) -v $<
 
285
 
 
286
%.mli : %.mly
 
287
        $(OCAMLYACC) -v $<
 
288
 
 
289
 
 
290
 
 
291
# Emacs tags
 
292
############
 
293
 
 
294
tags:
 
295
        find . -name "*.ml*" | sort -r | xargs \
 
296
        etags "--regex=/let[ \t]+\([^ \t]+\)/\1/" \
 
297
              "--regex=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \
 
298
              "--regex=/and[ \t]+\([^ \t]+\)/\1/" \
 
299
              "--regex=/type[ \t]+\([^ \t]+\)/\1/" \
 
300
              "--regex=/exception[ \t]+\([^ \t]+\)/\1/" \
 
301
              "--regex=/val[ \t]+\([^ \t]+\)/\1/" \
 
302
              "--regex=/module[ \t]+\([^ \t]+\)/\1/"
 
303
 
 
304
# vi tags
 
305
#########
 
306
 
 
307
vtags:
 
308
        otags -vi -o tags *.ml
 
309
 
 
310
 
 
311
# Makefile is rebuilt whenever Makefile.in or configure.in is modified
 
312
######################################################################
 
313
 
 
314
Makefile: Makefile.in config.status
 
315
        ./config.status
 
316
 
 
317
config.status: configure
 
318
        ./config.status --recheck
 
319
 
 
320
configure: configure.in
 
321
        autoconf 
 
322
 
 
323
# clean
 
324
#######
 
325
 
 
326
partly-clean::
 
327
        rm -f *.cm[iox] *.o *.a *~ txtin*.ml txtin*.mli *.output
 
328
        rm -f $(GENERATED) parser.output
 
329
        rm -f $(NAME).byte $(NAME).opt $(NAME2).byte $(NAME2).opt $(NAME).static-opt $(NAME2).static-opt
 
330
        rm -f *.aux *.log $(NAME).tex $(NAME).dvi $(NAME).ps
 
331
 
 
332
gsl-clean::
 
333
        rm -f gsl/*.cm[iox] gsl/*.o *~
 
334
 
 
335
curses-clean::
 
336
        rm -f curses/*.cm[iox] curses/*.o *~
 
337
 
 
338
units-clean::
 
339
        rm -f units/*.cm[iox] units/*.o *~
 
340
 
 
341
clean:: partly-clean gsl-clean curses-clean units-clean
 
342
 
 
343
dist-clean distclean:: clean
 
344
        rm -f Makefile config.cache config.log config.status install.ml
 
345
 
 
346
 
 
347
# depend
 
348
########
 
349
 
 
350
depend::
 
351
        $(MAKE) txtin_lexer.ml
 
352
        $(MAKE) txtin_parser.ml
 
353
        $(OCAMLDEP) -pp camlp4o $(INCLUDES) *.ml *.mli > depend
 
354
        $(OCAMLDEP) -pp camlp4o $(INCLUDES) units/*.ml units/*.mli >> depend
 
355
        $(OCAMLDEP) -pp cpp -I ./curses curses/*.ml curses/*.mli >> depend
 
356
        $(OCAMLDEP) -I ./gsl gsl/*.ml gsl/*.mli >> depend
 
357
 
 
358
 
 
359
include depend
 
360
 
 
361
 
 
362
# arch-tag: DO_NOT_CHANGE_bdb62873-ffd0-4d79-819e-880467e18f28