From d393510bfbb9b2d7708b760434f004896e273e0d Mon Sep 17 00:00:00 2001 From: Stephen Skeirik <7319434+sskeirik@users.noreply.github.com> Date: Mon, 14 Sep 2020 15:03:23 -0400 Subject: [PATCH] Update Makefile install logic Co-authored-by: Everett Hildenbrandt --- Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index cfff8a1a3..55baa2766 100644 --- a/Makefile +++ b/Makefile @@ -27,10 +27,19 @@ plugin-c/blockchain.o: plugin-c/proto/msg.pb.h .PHONY: install clean +DESTDIR ?= +INSTALL_PREFIX ?= /usr/local +INSTALL_DIR := $(DESTDIR)$(INSTALL_PREFIX) +INSTALL_INCLUDE := $(INSTALL_DIR)/include/kframework + PLUGIN_NAMESPACE := blockchain-k-plugin -install: - @mkdir -p $(PREFIX)/$(PLUGIN_NAMESPACE) - cp plugin/* $(PREFIX)/$(PLUGIN_NAMESPACE) +K_SOURCES := krypto.md + +install: $(patsubst %, $(INSTALL_INCLUDE)/$(PLUGIN_NAMESPACE)/%, $(K_SOURCES)) + +$(INSTALL_INCLUDE)/$(PLUGIN_NAMESPACE)/%.md: plugin/%.md + @mkdir -p $(dir $@) + cp $< $@ clean: rm -rf */*.o */*/*.o plugin/proto/*.pb.* build deps/libff/build