X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=Makefile.am;h=f6e2f329f34d6d48b3673706376a28a612fd40a2;hb=9a049cb107efab5b03dae694d8c7bf9b97655450;hp=11997d7354a64acd27e05950dae018a0d1f92210;hpb=153276d53f879786956bd7c2a4d3b97ef13c9adc;p=goaljobs.git diff --git a/Makefile.am b/Makefile.am index 11997d7..f6e2f32 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,43 +15,66 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +include common-rules.mk + ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ COPYING \ + goaljobs \ + goaljobs_config.ml.in \ + goaljobs.ml \ + goaljobs.mli \ + goaljobs.pod \ + goaljobs-reference.pod \ + goaljobs.spec \ + goaljobs.spec.in \ + html/.gitignore \ + META.in \ NOTES \ + pa_goal.ml \ README \ - $(sources) - -CLEANFILES = *~ - -OCAMLCFLAGS = -g -package unix -OCAMLOPTFLAGS = $(OCAMLCFLAGS) + TODO SUBDIRS = . examples tests sources = \ - test.ml \ + goaljobs_config.ml \ goaljobs.ml \ goaljobs.mli -noinst_SCRIPTS = test +bin_SCRIPTS = goaljobs -test: goaljobs.cmx - $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $< -o $@ +# These targets are noinst because we use a custom install hook to +# install them, and are _SCRIPTS because automake doesn't know how to +# compile OCaml code. +noinst_SCRIPTS = goaljobs.cma goaljobs.cmxa pa_goal.cmo -# Dependencies. +# Library. +goaljobs.cma: goaljobs_config.cmo goaljobs.cmo + $(OCAMLFIND) ocamlc -a -o $@ $(OCAMLCFLAGS) $(OCAMLCPACKAGES) $^ -%.cmi: %.mli - $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ -%.cmo: %.ml - $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ -%.cmx: %.ml - $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@ +goaljobs.cmxa: goaljobs_config.cmx goaljobs.cmx + $(OCAMLFIND) ocamlopt -a -o $@ $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $^ +# Preprocessor for goaljobs scripts. +pa_goal.cmo: pa_goal.ml + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -package camlp4.lib -linkpkg \ + -pp $(CAMLP4OF) -c $< -o $@ + +# Install. +install-data-hook: + mkdir -p $(DESTDIR)$(OCAMLLIB) + $(OCAMLFIND) install \ + -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \ + goaljobs \ + META goaljobs.cma goaljobs.cmxa pa_goal.cmo *.cmi $(srcdir)/*.mli + rm $(DESTDIR)$(OCAMLLIB)/goaljobs/pa_goal.cmi + +# Dependencies. depend: .depend -.depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml) +.depend: $(sources) rm -f $@ $@-t $(OCAMLFIND) ocamldep -I $(abs_srcdir) $^ | \ $(SED) 's/ *$$//' | \ @@ -62,9 +85,59 @@ depend: .depend -include .depend -SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly +rpm: dist + rpmbuild -ta $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz -# License check. +if HAVE_POD2MAN + +man_MANS = goaljobs.1 goaljobs-reference.1 +goaljobs.1: goaljobs.pod + $(POD2MAN) -c "Goaljobs" --release $(PACKAGE)-$(VERSION) $< > $@-t + mv $@-t $@ + +goaljobs-reference.1: goaljobs-reference.pod + $(POD2MAN) -c "Goaljobs" --release $(PACKAGE)-$(VERSION) $< > $@-t + mv $@-t $@ + +goaljobs.1.txt: goaljobs.pod + pod2text $< > $@-t + mv $@-t $@ + +goaljobs-reference.1.txt: goaljobs-reference.pod + pod2text $< > $@-t + mv $@-t $@ + +endif + +if HAVE_OCAMLDOC + +# HTML library documentation. +# XXX The list below probably changes with every ocamldoc version. +# How can we use a wildcard? +doc_DATA = \ + html/Goaljobs.html \ + html/index_attributes.html \ + html/index_classes.html \ + html/index_class_types.html \ + html/index_exceptions.html \ + html/index.html \ + html/index_methods.html \ + html/index_modules.html \ + html/index_module_types.html \ + html/index_types.html \ + html/index_values.html \ + html/style.css \ + html/type_Goaljobs.html + +$(doc_DATA): stamp-ocamldoc +stamp-ocamldoc: goaljobs.mli goaljobs.ml + rm -f $@ + $(OCAMLFIND) ocamldoc -html -d html $(OCAMLCPACKAGES) $^ + touch $@ + +endif + +# License check. licensecheck: licensecheck $$(git ls-files)