diff --git a/mantle/Makefile b/mantle/Makefile index 2a9f044771..c9939de072 100644 --- a/mantle/Makefile +++ b/mantle/Makefile @@ -4,8 +4,11 @@ DESTDIR ?= ARCH:=$(shell uname -m) .PHONY: build test vendor clean -build: - ./build +build: cosa/cosa_v1.go + ./build cmd/* + +cosa/cosa_v1.go: ../src/schema/v1.json Makefile + ./build schema .PHONY: install install: bin/ore bin/kola bin/plume bin/kolet diff --git a/mantle/build b/mantle/build index c2e6a61efd..7192f6cebc 100755 --- a/mantle/build +++ b/mantle/build @@ -7,7 +7,7 @@ cd $(dirname $0) source ./env if [[ $# -eq 0 ]]; then - set -- cmd/* + set -- cmd/* schema fi version=$(git describe --tags --always --dirty) @@ -73,8 +73,11 @@ cross_build() { done } -schema_generate -for cmd in "$@"; do - cmd=$(basename "${cmd}") - host_build "${cmd}" +for arg in "$@"; do + if [ "${arg}" = "schema" ]; then + schema_generate + else + cmd=$(basename "${arg}") + host_build "${cmd}" + fi done