X-Git-Url: http://cloudbase.mooo.com/gitweb/ddt180.git/blobdiff_plain/668cf0f72e038d58d32479d9abd0c7a3c38646d3..ec12f2535a9763717fd7aa251a065878251960e0:/Makefile diff --git a/Makefile b/Makefile index 0b58086..bdfc336 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,24 @@ -# Build ddtz.com from ddtz.z80 +# Build ddt180.com from ddt180.z80 -PROG := ddtz +PROG := ddt180 SRC := $(PROG).z80 +EXTRA_DIST := autorevision.cache version.inc + OBJ := $(SRC:.z80=.rel) -AS_OPT := MF +DIST_NAME = $(PROG)_$(VERS).zip +PREFIX = $(PROG)_$(VERS) + +ASM := zxcc slrz80.com +LINK := zxcc link80.com +CP := cp +RM := rm -f +GIT := git +ZIP := zip -ASM := zxcc slrz80.com -LINK := zxcc link80.com +AS_OPT := MFS .phony: all all: $(PROG).com @@ -23,7 +32,38 @@ $(PROG).com: $(PROG).prl $(PROG).prl: $(OBJ) $(LINK) -'$(PROG)[op,$$SZ]' +$(PROG).rel: version.inc + +$(foreach X,$(subst =,:=,$(subst ",,$(filter VCS_%,\ + $(shell autorevision -t sh -o $(CURDIR)/autorevision.cache)))),$(eval $X)) + +VERS := $(shell echo "$(VCS_TAG)" | sed -e 's/^v//g') + +ifneq ($(VCS_TICK),0) + VERS := $(VERS)-$(VCS_TICK) +endif +ifneq ($(VCS_BRANCH),master) + VERS := $(VERS)-$(VCS_BRANCH) +endif +ifeq ($(VCS_WC_MODIFIED),1) + VERS := $(VERS)-dirty +endif + + + +version.inc: autorevision.cache + @echo update $@ + @printf "defvers macro\r\n\ + db '$(VERS)'\r\n\ + endm\r\n\032" > $@ +.phony: dist +dist: $(PROG).com version.inc + $(GIT) archive --format=zip --prefix=$(PREFIX)/ -9 -o $(DIST_NAME) HEAD^{tree} + @mkdir -p $(PREFIX) + @$(CP) -p $(EXTRA_DIST) $(PREFIX) + $(ZIP) -r -9 $(DIST_NAME) $(PREFIX) $(PROG).com + @$(RM) -r $(PREFIX) .phony: clean clean: