### Configuration section # The name of the Zlib library. Usually -lz ZLIB_LIB=-lz # The directory containing the Zlib library (libz.a or libz.so) ZLIB_LIBDIR=/usr/local/lib # The directory containing the Zlib header file (zlib.h) ZLIB_INCLUDE=/usr/local/include # Where to install the library. By default: sub-directory 'zip' of # OCaml's standard library directory. INSTALLDIR=/usr/local/lib/ocaml/site-lib/zip ### End of configuration section OCAMLC=ocamlc -g OCAMLOPT=ocamlopt OCAMLDEP=ocamldep OCAMLMKLIB=ocamlmklib OBJS=zlib.cmo zip.cmo gzip.cmo C_OBJS=zlibstubs.o all: libcamlzip.a zip.cma allopt: libcamlzip.a zip.cmxa zip.cma: $(OBJS) $(OCAMLMKLIB) -o zip -oc camlzip $(OBJS) \ -L$(ZLIB_LIBDIR) $(ZLIB_LIB) zip.cmxa: $(OBJS:.cmo=.cmx) $(OCAMLMKLIB) -o zip -oc camlzip $(OBJS:.cmo=.cmx) \ -L$(ZLIB_LIBDIR) $(ZLIB_LIB) libcamlzip.a: $(C_OBJS) $(OCAMLMKLIB) -oc camlzip $(C_OBJS) \ -L$(ZLIB_LIBDIR) $(ZLIB_LIB) .SUFFIXES: .mli .ml .cmo .cmi .cmx .mli.cmi: $(OCAMLC) -c $< .ml.cmo: $(OCAMLC) -c $< .ml.cmx: $(OCAMLOPT) -c $< .c.o: $(OCAMLC) -c -ccopt "-fno-common" -ccopt -I$(ZLIB_INCLUDE) $< clean: rm -f *.cm* rm -f *.o *.a install: mkdir -p $(INSTALLDIR) ${BSD_INSTALL_DATA} zip.cma zip.cmi gzip.cmi zip.mli gzip.mli libcamlzip.a $(INSTALLDIR) if test -f dllcamlzip.so; then \ ${BSD_INSTALL_DATA} dllcamlzip.so $(INSTALLDIR); \ installdir=$(INSTALLDIR); \ fi installopt: ${BSD_INSTALL_DATA} zip.cmxa zip.a zip.cmx gzip.cmx $(INSTALLDIR) depend: gcc -MM -I$(ZLIB_INCLUDE) *.c > .depend ocamldep *.mli *.ml >> .depend include .depend