diff --git a/.gitignore b/.gitignore index 6acd3bc..4802fdc 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ *.cmx[as] *.cmti *.annot +src/META +test/test.byt +test/test.exe diff --git a/Changelog b/Changelog index 791b18b..72a3999 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,9 @@ +- GPR#6: provide findlib-install target to install everything using ocamlfind +- Issue#3: make sur the stublibs/ directory exists before installing DLLs + inside it. +- Issue#4: wrong DLL file names for Win32 ports, causing errors at + installation time. + Release 1.1 (2017-10-13): - Install .cmx files as well. diff --git a/Makefile b/Makefile index 6a5d08f..b40e588 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,16 @@ install: $(MAKE) -C src install $(MAKE) -C toplevel install +findlib-install: + $(MAKE) -C src findlib-install + $(MAKE) -C toplevel install + uninstall: $(MAKE) -C src uninstall $(MAKE) -C toplevel uninstall -.PHONY: all test clean install uninstall +findlib-uninstall: + $(MAKE) -C src findlib-uninstall + $(MAKE) -C toplevel uninstall + +.PHONY: all test clean install uninstall findlib-install findlib-uninstall diff --git a/src/META b/src/META.in similarity index 72% rename from src/META rename to src/META.in index 66ac170..b5678b7 100644 --- a/src/META +++ b/src/META.in @@ -1,6 +1,8 @@ # This META is the one provided by findlib when the "num" library was # part of the core OCaml distribution. For backward compatibility, -# it installs into OCaml's standard library directory, not in a subdirectory +# it is installed into OCaml's standard library directory. If the +# directory line below is removed, then it's installed in a +# subdirectory, as normal for a findlib package. requires = "num.core" requires(toploop) = "num.core,num-top" diff --git a/src/Makefile b/src/Makefile index 97dc074..8a88035 100644 --- a/src/Makefile +++ b/src/Makefile @@ -5,6 +5,7 @@ OCAMLMKLIB=ocamlmklib OCAMLFIND=ocamlfind INSTALL_DATA=install -m 644 INSTALL_DLL=install +INSTALL_DIR=install -d STDLIBDIR=$(shell $(OCAMLC) -where) include $(STDLIBDIR)/Makefile.config @@ -75,29 +76,43 @@ nat_stubs.$(O): bng.h nat.h TOINSTALL=nums.cma libnums.$(A) $(CMIS) $(CMIS:.cmi=.mli) $(CMIS:.cmi=.cmti) ifneq "$(ARCH)" "none" -TOINSTALL+=nums.cmxa nums.$(A) $(CMIS:.cmi=.cmx) +TOINSTALL+=nums.cmxa nums.$(A) $(CMXS) endif ifeq "$(NATDYNLINK)" "true" TOINSTALL+=nums.cmxs endif -TOINSTALL_STUBS=dllnums.$(SO) +ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" +TOINSTALL_STUBS=dllnums$(EXT_DLL) +else +TOINSTALL_STUBS= +endif install: + cp META.in META $(OCAMLFIND) install num META + rm -f META $(INSTALL_DATA) $(TOINSTALL) $(STDLIBDIR) ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" + $(INSTALL_DIR) $(STDLIBDIR)/stublibs $(INSTALL_DLL) $(TOINSTALL_STUBS) $(STDLIBDIR)/stublibs endif -uninstall: +findlib-install: + grep -Fv '^' META.in > META + $(OCAMLFIND) install num META $(TOINSTALL) $(TOINSTALL_STUBS) + rm -f META + +findlib-uninstall: + $(OCAMLFIND) remove num + +uninstall: findlib-uninstall cd $(STDLIBDIR) && rm -f $(TOINSTALL) ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" cd $(STDLIBDIR)/stublibs && rm -f $(TOINSTALL_STUBS) endif - $(OCAMLFIND) remove num clean: - rm -f *.cm[ioxta] *.cmx[as] *.cmti *.$(O) *.$(A) *.$(SO) + rm -f *.cm[ioxta] *.cmx[as] *.cmti *.$(O) *.$(A) *$(EXT_DLL) depend: $(OCAMLDEP) -slash *.mli *.ml > .depend