Skip to content

Commit

Permalink
Rename files, revise release build process
Browse files Browse the repository at this point in the history
  • Loading branch information
ki3v committed Sep 8, 2023
1 parent 16b8658 commit 0ed1893
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 99 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
roms/
cfg/
old/
*.lst
*.o
# *.bin
Expand All @@ -10,4 +11,5 @@ config.inc
*.bin
!a2vmemnoram.bin
*.zip
*.html
*.html
*.dsk
71 changes: 53 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
RAMSIZE = 16K
MAME = mame

VERSION := $(shell git describe --tags --always --dirty=-LOCAL --broken=-XX 2>/dev/null || echo LOCAL_BUILD)
VERSION_UC := $(shell echo $(VERSION) | tr a-z A-Z)
TAG := $(shell git describe --tags --exact-match 2>/dev/null || echo LOCAL_BUILD)

all: apple2.bin a2vmemnoram.bin
apple2.bin: config.inc inc/marchu_zpsp.asm inc/marchu.asm inc/a2console.asm inc/a2macros.inc inc/a2constants.inc
$(info Version: $(VERSION))
$(info Tag: $(TAG))

OUTPUT = apple2.bin
RELEASE_ZIP := appleII_deadtest-BIN-$(VERSION).zip
RELEASE_FILES := apple2dead.bin apple2dead.dsk LICENSE.html README.html

all: $(RELEASE_FILES)

apple2dead.bin: config.inc inc/marchu_zpsp.asm inc/marchu.asm inc/a2console.asm inc/a2macros.inc inc/a2constants.inc

# OUTPUT = apple2.bin
ASSEMBLE = cl65 -t apple2 -C a2_f8rom.cfg -I ./inc -l $(@:%.bin=%.lst) -Ln $(@:%.bin=%.sym) $(QUICKTEST)
CHECKSUM = sha1sum --tag

Expand All @@ -15,11 +25,10 @@ CHECKSUM = sha1sum --tag
-@$(CHECKSUM) $@


config.inc: config_inc.sh *.asm inc/*
sh $< > $@

.SECONDARY: config.inc
config.inc:
@echo ".define VERSION_STR \"$(VERSION_UC)\"" > $@

.INTERMEDIATE: config.inc

export QUICKTEST

Expand All @@ -29,21 +38,47 @@ debug: DEBUGGER := osx
debug: QUICKTEST := -D QUICKTEST=1
debug: run

# debug: $(OUTPUT)
# ln -sf $< 341-0020-00.f8
# $(MAME) apple2p -ramsize $(RAMSIZE) -keepaspect -volume -10 -window -resolution 800x600 -skip_gameinfo -debug -debugger osx
apple2dead.dsk: apple2dead.bin apple2dead.srcdsk
cp apple2dead.srcdsk $@
cat $< | ac -p $@ DEADTEST BIN 0xF800

run: $(OUTPUT)
run: apple2dead.bin all
ln -sf $< 341-0020-00.f8
$(MAME) apple2p -ramsize $(RAMSIZE) -keepaspect -volume -10 -window -resolution 800x600 -skip_gameinfo -debug -debugger $(DEBUGGER)

clean:
rm -f *.lst *.o *.map *.sym

cleanall: clean
rm -f apple2.bin config.inc appleII_deadtest*.zip

showver:
@git describe --tags --long --always --dirty=-L --broken=-X

.PHONY: all test clean cleanall showver run debug
%.html: %.md
pandoc $< -f markdown -t html -s -o $@ -V mainfont=sans-serif -V maxwidth=50em --metadata title="$*"

$(RELEASE_ZIP): $(RELEASE_FILES)
@rm -f $@
zip $@ $^

zip: $(RELEASE_ZIP)


release: clean $(RELEASE_ZIP)
$(info )
$(info VERSION: $(VERSION))
$(info RELEASE: $(TAG))
ifneq (,$(findstring LOCAL,$(TAG) $(VERSION)))
@echo
@echo "Abort: release only from a clean, tagged commit"
@echo
@git status --short --branch
@echo
@false
else
git push origin $(TAG)
gh release create $(TAG) --draft --generate-notes
gh release upload $(TAG) $(RELEASE_FILES) $(RELEASE_ZIP)
@echo
@echo Release $(TAG) is a draft. Approve or discard on GitHub.
endif

clean:
rm -f *.lst *.o *.map *.sym $(RELEASE_FILES) appleII_deadtest*.zip

.PHONY: all test clean cleanall showver run debug release zip
4 changes: 2 additions & 2 deletions apple2.asm → apple2dead.asm
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ pe_end:
;-----------------------------------------------------------------------------
; end of the code
endofrom = *
.out .sprintf(" size of code: %d bytes",endofrom-romstart)
.out .sprintf(" size: %d, available %d",endofrom-romstart,$FFFA-endofrom)
.res ($FFFA-endofrom), $FF ; fills the unused space with $FF

; vectors
; .org $FFFA
.segment "VECTORS"
.word romstart,romstart,romstart
vectors: .word romstart,romstart,romstart
Binary file renamed DEADTEST-DISK.dsk → apple2dead.srcdsk
Binary file not shown.
9 changes: 0 additions & 9 deletions config_inc.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
69 changes: 0 additions & 69 deletions release.sh

This file was deleted.

0 comments on commit 0ed1893

Please sign in to comment.