summaryrefslogtreecommitdiff
path: root/otherlibs/graph/Makefile
blob: 4cef66712a355db4999866a20d42427b13ac8ecb (plain)
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
#########################################################################
#                                                                       #
#                            Objective Caml                             #
#                                                                       #
#            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
#                                                                       #
#   Copyright 1999 Institut National de Recherche en Informatique et    #
#   en Automatique.  All rights reserved.  This file is distributed     #
#   under the terms of the GNU Library General Public License.          #
#                                                                       #
#########################################################################

# $Id$

# Makefile for the portable graphics library

include ../../config/Makefile

CC=$(BYTECC)
CFLAGS=-I../../byterun $(X11_INCLUDES) -O $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS)
CAMLC=../../boot/ocamlrun ../../ocamlc -I ../../stdlib
CAMLOPT=../../boot/ocamlrun ../../ocamlopt -I ../../stdlib
MKLIB=../../tools/ocamlmklib

OBJS=open.o draw.o fill.o color.o text.o \
  image.o make_img.o dump_img.o point_col.o sound.o events.o \
  subwindow.o

CAMLOBJS=graphics.cmo graphicsX11.cmo

all: libgraphics.a graphics.cmi graphics.cma

allopt: libgraphics.a graphics.cmi graphics.cmxa

libgraphics.a: $(OBJS)
	$(MKLIB) -o graphics $(OBJS) $(X11_LINK)

graphics.cma: $(CAMLOBJS)
	$(MKLIB) -ocamlc '$(CAMLC)' -o graphics $(CAMLOBJS) $(X11_LINK)

graphics.cmxa: $(CAMLOBJS:.cmo=.cmx)
	$(MKLIB) -ocamlopt '$(CAMLOPT)' -o graphics $(CAMLOBJS:.cmo=.cmx) $(X11_LINK)

partialclean:
	rm -f *.cm*

clean: partialclean
	rm -f *.a *.so *.o

install:
	test -f libgraphics.so && cp libgraphics.so $(LIBDIR)/libgraphics.so
	cp libgraphics.a $(LIBDIR)/libgraphics.a
	cd $(LIBDIR); $(RANLIB) libgraphics.a
	cp graphics.cm[ia] graphicsX11.cmi graphics.mli graphicsX11.mli $(LIBDIR)

installopt:
	cp graphics.cmxa graphics.a $(LIBDIR)
	cd $(LIBDIR); $(RANLIB) graphics.a

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

.mli.cmi:
	$(CAMLC) -c $<
.ml.cmo:
	$(CAMLC) -c $<
.ml.cmx:
	$(CAMLOPT) -c $(COMPFLAGS) $<

depend:
	gcc -MM $(CFLAGS) *.c > .depend
	../../boot/ocamlrun ../../tools/ocamldep *.mli *.ml >> .depend

include .depend