Permalink
Browse files

[fix] Makefile: install plugins

  • Loading branch information...
OpaOnWindowsNow committed Oct 21, 2011
1 parent 8135068 commit 2f55085594bd3607588890cdb75214e5346a3aa6
Showing with 29 additions and 1 deletion.
  1. +29 −1 Makefile
View
@@ -83,7 +83,21 @@ define install-package
@$(INSTALL) $(BUILD_DIR)/$*.opx/_build/*.cmxa "$(STDLIB_DIR)/$*.opx/_build/"
endef
+define install-plugin
+@printf "Installing into $(STDLIB_DIR)/$*.opp^[[K\r"
+@mkdir -p "$(STDLIB_DIR)/$*.opp"
+@$(INSTALL) $(BUILD_DIR)/$*.opp/*.cmi "$(STDLIB_DIR)/$*.opp/";
+@$(INSTALL) $(BUILD_DIR)/$*.opp/*.cmx "$(STDLIB_DIR)/$*.opp/";
+@if [ -d "$(BUILD_DIR)/$*.opp/plugins/$*/" ]; then \
+ mkdir -p "$(STDLIB_DIR)/$*.opp/plugins/$*/" ; \
+ $(INSTALL) $(BUILD_DIR)/$*.opp/plugins/$*/*.js "$(STDLIB_DIR)/$*.opp/plugins/$*/" ; \
+fi
+endef
+
+
+
OPA_PACKAGES := $(shell cd stdlib && ./all_packages.sh)
+OPA_PLUGINS := $(shell cd stdlib && ./all_plugins.sh)
# Rules installing everything that has been compiled
#
@@ -109,6 +123,20 @@ install-packages: $(addprefix install-packageopt-,$(OPA_PACKAGES))
install-all-packages: $(addprefix install-package-,$(OPA_PACKAGES))
@printf "Installation to $(STDLIB_DIR) done.\n"
+install-pluginopt-%:
+ $(if $(wildcard $(BUILD_DIR)/$*.opp/),$(install-plugin))
+
+install-plugin-%:
+ $(install-plugin)
+
+install-plugins: $(addprefix install-pluginopt-,$(OPA_PLUGINS))
+ @printf "Installation to $(STDLIB_DIR) done.\n"
+
+install-all-plugins: $(addprefix install-plugin-,$(OPA_PLUGINS))
+ @printf "Installation to $(STDLIB_DIR) done.\n"
+
+
+
install-bin:
@printf "Installing into $(INSTALL_DIR)/bin\r"
@mkdir -p $(INSTALL_DIR)/bin
@@ -136,7 +164,7 @@ install-doc:
fi
@printf "Installation to $(INSTALL_DIR)/share/doc/opa done.\n"
-install: install-bin install-lib install-share install-packages install-doc
+install: install-bin install-lib install-share install-plugins install-packages install-doc
@printf "Installation into $(INSTALL_DIR) done.\n"
.PHONY: uninstall

0 comments on commit 2f55085

Please sign in to comment.