PACKAGE = @PACKAGE@ VERSION = @VERSION@ INCLUDEDIR = @OCAML_INCLUDE_DIR@ PREFIX = OBJECTS_C = ml_gtk_mathview.o OBJECTS = gtk_mathview.cmo gtkMathView.cmo gMathView.cmo OBJECTS_OPT = gtkMathView.cmx gtk_mathview.cmx gMathView.cmx INST = META gMathView.mli gMathView.cmi gtkMathView.cmi gtk_mathview.cmi DIST_FILES = \ AUTHORS COPYING ChangeLog LICENSE Makefile.in NEWS README \ configure.in gMathView.ml gMathView.mli gtkMathView.ml \ gtk_mathview.ml ml_gtk_mathview.c META.in .depend debian/ test/ \ configure lablgtkmathview.spec lablgtkmathview.spec.in DOC_FILES = AUTHORS COPYING ChangeLog NEWS README REQUIRES = gdome2 lablgtk PREDICATES = MLFLAGS = -labels OCAMLC = ocamlfind ocamlc $(MLFLAGS) OCAMLOPT = ocamlfind ocamlopt $(MLFLAGS) OCAMLDEP = ocamldep ARCHIVE = $(PACKAGE).cma ARCHIVE_A = $(PACKAGE).a ARCHIVE_SO = dll$(PACKAGE).so ARCHIVE_OPT = $(PACKAGE).cmxa TESTDIR = ./test TMPDIR = .test TMPPKGDIR = $(TMPDIR)/$(PACKAGE) all: $(ARCHIVE) $(ARCHIVE_SO) $(TESTDIR)/test opt: $(OBJECTS_C) $(ARCHIVE_OPT) $(ARCHIVE_A) $(ARCHIVE_SO) #$(TESTDIR)/test.opt dist: rm -rf $(PACKAGE)-$(VERSION) mkdir $(PACKAGE)-$(VERSION) cp -a $(DIST_FILES) $(DOC_FILES) $(PACKAGE)-$(VERSION) tar cvfz $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) rm -rf $(PACKAGE)-$(VERSION) ml_gtk_mathview.o: ml_gtk_mathview.c gcc -c -I$(INCLUDEDIR) -fPIC `ocamlfind query -i-format lablgtk` `glib-config --cflags` `gtk-config --cflags` `gtkmathview-config --cflags` `gdome-config --cflags` `ocamlfind query -i-format gdome2` $< .SUFFIXES: .cmo .cmi .cmx .ml .mli .ml.cmo: $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \ -c $< .mli.cmi: $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \ -c $< .ml.cmx: $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \ -c $< depend: *.ml *.mli $(OCAMLDEP) *.ml *.mli >.depend include .depend $(ARCHIVE): $(OBJECTS) $(ARCHIVE_SO) $(OCAMLC) -a -package "$(REQUIRES)" \ -predicates "$(PREDICATES)" -o $@ $^ \ -cclib "`glib-config --libs` `gdome-config --libs` `gtkmathview-config --libs`" -dllib -l$(PACKAGE) $(ARCHIVE_OPT) $(ARCHIVE_A): $(OBJECTS_OPT) INSTPATH=`ocamlfind query gdome2` ; \ $(OCAMLOPT) -a -package "$(REQUIRES)" \ -predicates "$(PREDICATES)" -o $@ $^ \ -cclib "`glib-config --libs` `gdome-config --libs` `gtkmathview-config --libs`" \ -cclib "`echo $$INSTPATH | sed "s/\\(.*\\)\\/gdome2/\\1/"`/$(PACKAGE)/$(ARCHIVE_SO)" $(ARCHIVE_SO): $(OBJECTS_C) gcc -shared -o $@ $< `gtkmathview-config --libs` -lmlgdome -L `ocamlfind query gdome2` -Xlinker -rpath -Xlinker `ocamlfind query gdome2` $(TESTDIR)/test: $(OBJECTS_C) $(ARCHIVE) $(TESTDIR)/test.ml mkdir -p $(TMPPKGDIR) cp $(OBJECTS_C) $(ARCHIVE_SO) $(ARCHIVE) $(INST) $(TMPPKGDIR) cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make rm -r $(TMPDIR) $(TESTDIR)/test.opt: $(OBJECTS_C) $(ARCHIVE_A) $(ARCHIVE_OPT) $(TESTDIR)/test.ml mkdir -p $(TMPPKGDIR) cp $(OBJECTS_C) $(ARCHIVE_A) $(ARCHIVE_OPT) $(INST) $(TMPPKGDIR) cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make opt rm -r $(TMPDIR) install: test ! -f $(ARCHIVE_OPT) || extra="$(ARCHIVE_A) $(ARCHIVE_OPT)" ; \ if [ "$(PREFIX)" = "" ]; then \ ocamlfind install $(PACKAGE) $(OBJECTS_C) $(ARCHIVE) $(ARCHIVE_SO) $(INST) $$extra; \ else \ ocamlfind install -destdir $(PREFIX) $(PACKAGE) $(OBJECTS_C) $(ARCHIVE) $(ARCHIVE_SO) $(INST) $$extra; \ fi uninstall: ocamlfind remove $(PACKAGE) clean: rm -f *.o *.cm? $(ARCHIVE) $(ARCHIVE_A) $(ARCHIVE_SO) $(ARCHIVE_OPT) cd $(TESTDIR) ; make clean rm -rf $(TMPDIR) distclean: clean rm -f config.log config.cache config.status Makefile META lablgtkmathview.spec cd $(TESTDIR) ; make distclean