Created
November 11, 2019 20:22
-
-
Save nilsmagnus/908e518f7d1e657c2b19671d7cda41aa to your computer and use it in GitHub Desktop.
HVA I $@ $< * ER EN MAKEFILE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: clean build | |
PROTOC=protoc | |
PROTOC_GO=protoc-gen-go | |
DOCKERIMAGE="golang:1.13.3-buster" | |
leiaschema: generated main.go | |
go build -o $@ | |
generated: *.proto | |
$(if $(shell which $(PROTOC)),,echo "No protoc found"; exit 1) | |
$(if $(shell which $(PROTOC_GO)),,echo "No protoc-gen-go found"; exit 1) | |
@rm -rf $@ && mkdir $@ | |
@$(PROTOC) *.proto --go_out=$@ || rm -rf $@/ | |
@echo "Generated go files from "$< | |
%.docker: generated | |
$(if $(shell which docker),@echo "Found docker on path",@echo "Docker not installed"; exit 1) | |
docker pull $(subst .docker,,$@) | |
touch $@ | |
docker: build golang\:1.13.3-buster.docker | |
touch $@ | |
clean: | |
@rm -rf generated | |
@echo "Cleaned" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment