-SRC := bioskrnl.180 boot.180 chario.180 drvtbl.180
-SRC += move.180 time.180 mm.180 misc.180 utils.180
-SRC += msgbuf.180 conbuf.180 ascip.180 sdio.180
+SRC := bioskrnl.180 boot.180 chario.180
+SRC += msgbuf.180 conbuf.180 ascii.180
+SRC += drvtbl.180 sdio.180 cfio.180 stampf.180
+SRC += move.180 time.180 fifo.180 utils.180 misc.180 mm.180
SRC += scb.180
+ALLSRC := $(SRC) ldrbios.180
-INC := config.inc z180reg.inc z180.lib
+INC := config.inc z180reg.inc z180.lib ioctl.inc
+EXTRA_DIST := autorevision.cache version.inc
OBJ := $(SRC:.180=.rel)
+ALLOBJ := $(ALLSRC:.180=.rel)
+ALLLST := $(ALLSRC:.180=.lst)
-$(foreach X,$(subst =,:=,$(filter VCS_%,\
- $(shell autorevision -t sh -o $(CURDIR)/autorevision.cache))),$(eval $X))
+$(foreach X,$(subst =,:=,$(subst ",,$(filter VCS_%,\
+ $(shell autorevision -t sh -o $(CURDIR)/autorevision.cache)))),$(eval $X))
VERS := $(shell echo "$(VCS_TAG)" | sed -e 's/hexrel-/0./g' -e 's/^v//g')
-ifneq ($(VCS_TICK),"0")
- VERS := $(VERS).$(subst ",,$(VCS_TICK))
+ifneq ($(VCS_TICK),0)
+ VERS := $(VERS)-$(VCS_TICK)
endif
-ifneq ($(VCS_BRANCH),"master")
- VERS := $(VERS)-$(subst ",,$(VCS_BRANCH))
+ifneq ($(VCS_BRANCH),master)
+ VERS := $(VERS)-$(VCS_BRANCH)
endif
-ifeq ($(VCS_WC_MODIFIED),"1")
+ifeq ($(VCS_WC_MODIFIED),1)
VERS := $(VERS)-dirty
endif
SYSFILE = cpm3_$(VERS).sys
MAPFILE = bnkbios3_$(VERS).map
-ZIPFILE = cpm3_$(VERS).zip
+ASYMFILE = bnkbios3_$(VERS).sym
+DIST_NAME = z180-stamp-cpm3_$(VERS).zip
+DIST_NAME_BIN = z180-stamp-cpm3-bin_$(VERS).zip
+PREFIX = z180-stamp-cpm3_$(VERS)
+
+SHELL = /bin/sh
+CP = cp
+RM = rm -f
+GIT = git
+ZIP = zip
#CP/M emulator
CPMEMU = zxcc
.phony: all
all: sys
-.phony: sys bios map
+.phony: sys bios map asym ldr
sys: $(SYSFILE)
bios: bnkbios3.spr
map: $(MAPFILE)
+asym: $(ASYMFILE)
+ldr: cpmldr.com
-.phony: bin-dist
-bin-dist: $(ZIPFILE)
+cpmldr.com: cpmldr.rel ldrbios.rel
+ ld80 -P 100 -o $@ $^
-$(OBJ): $(INC)
+$(ALLOBJ): $(INC)
boot.rel: version.inc
version.inc: autorevision.cache
@echo update $@
- @echo "defvers macro\r\n\
+ @printf "defvers macro\r\n\
db '$(VERS)'\r\n\
- endm\r" > $@
+ endm\r\n\032" > $@
comma:= ,
$(MAPFILE): $(SYSFILE)
ld80 -o /dev/null -ms $@ -P $(PSEG) -D $(DSEG) $(OBJ)
+$(ASYMFILE): $(SYSFILE)
+ cvtsym -o $@ -b $< bnkbios3.sym
+
$(SYSFILE): bnkbios3.spr gencpm.dat
zxcc gencpm -AUTO
@$(cpm-asm)
-$(ZIPFILE): $(SYSFILE) $(MAPFILE)
- @rm -f $@
- zip -9 $@ $(SYSFILE) $(MAPFILE)
+.phony: bin-dist
+bin-dist: $(SYSFILE) $(MAPFILE) cpmldr.com
+ $(ZIP) -9 $(DIST_NAME_BIN) $(SYSFILE) $(MAPFILE) $(ASYMFILE) cpmldr.com
+
+.phony: dist
+dist: $(SYSFILE) $(MAPFILE) $(ASYMFILE) cpmldr.com
+ $(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) $(SYSFILE) $(MAPFILE) $(ASYMFILE) cpmldr.com
+ @$(RM) -r $(PREFIX)
.phony: clean realclean
clean:
- rm -f *.rel *.lst *.sym version.inc
+ $(RM) $(ALLOBJ) $(ALLLST) *.sym
realclean: clean
- rm -f *.map *.prn *~
+ $(RM) *.map *.prn *~
#==================================================================