X-Git-Url: https://git.yukkurigames.com/?p=string-lerp.git;a=blobdiff_plain;f=Makefile;fp=Makefile;h=c20843c966eee1ec2955cc009ee76773d5b88c38;hp=fb4849c1923eaae3713d274424aa244c859f28c8;hb=c94dec1af72801e7e46c2e8fed3f09667f41d8e1;hpb=4c3e2d57468012099df78961480fc9634cca9829 diff --git a/Makefile b/Makefile index fb4849c..c20843c 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,10 @@ PKGNAME := string-lerp fallback = $(firstword $(shell command -v $(1)) $(2)) -git = $(shell GIT_DIR=$(firstword $(2) $(srcdir) .)/.git $(GIT) $(1)) -git_ls-tree = $(call git,ls-tree -r --name-only $(1),$(2)) -git_tag = $(call git,name-rev --tags --name-only $(call git,rev-parse $(1),$(2)),$(2)) - GIT ?= git +git_ls-tree = $(shell $(GIT) ls-tree -r --name-only $(1)) +git_tag = $(shell $(GIT) name-rev --tags --name-only $(shell $(GIT) rev-parse $(1))) + NPM ?= npm NPMBINDIR := ./node_modules/.bin JSTEST ?= $(NPMBINDIR)/jstest @@ -68,12 +67,12 @@ build/dist/$(PKGNAME)-undefined.zip build/dist/$(PKGNAME)-undefined.tar.gz: .SECONDEXPANSION: build/dist/$(PKGNAME)-%.zip: $$(call git_ls-tree,$$*) @mkdir -p $(@D) - $(GIT) archive --prefix=$(PKGNAME)-$*/ --output=$@ $* + $(GIT) archive --prefix=$(PKGNAME)-$*/ --output=$@ $* || ($(RM) $@ && exit 1) .SECONDEXPANSION: build/dist/$(PKGNAME)-%.tar.gz: $$(call git_ls-tree,$$*) @mkdir -p $(@D) - $(GIT) archive --prefix=$(PKGNAME)-$*/ --output=$@ $* + $(GIT) archive --prefix=$(PKGNAME)-$*/ --output=$@ $* || ($(RM) $@ && exit 1) dist: check $(addprefix build/dist/$(PKGNAME)-$(call git_tag,HEAD),.zip .tar.gz)