Revamp package script, build to out/ dir

This commit is contained in:
Joshua Bell 2020-03-12 20:38:51 -07:00
parent c84001002b
commit aed0c0a6d4
3 changed files with 29 additions and 14 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# Output directory
out

View File

@ -2,20 +2,27 @@
CAFLAGS = --target apple2enh --list-bytes 0 CAFLAGS = --target apple2enh --list-bytes 0
LDFLAGS = --config apple2-asm.cfg LDFLAGS = --config apple2-asm.cfg
TARGETS = basis.system.SYS OUTDIR = out
.PHONY: clean all
all: $(TARGETS)
HEADERS = $(wildcard *.inc) HEADERS = $(wildcard *.inc)
TARGETS = \
$(OUTDIR)/basis.system.SYS
.PHONY: clean all
all: $(OUTDIR) $(TARGETS)
$(OUTDIR):
mkdir -p $(OUTDIR)
clean: clean:
rm -f *.o rm -f $(OUTDIR)/*.o
rm -f $(OUTDIR)/*.list
rm -f $(TARGETS) rm -f $(TARGETS)
%.o: %.s $(HEADERS) $(OUTDIR)/%.o: %.s $(HEADERS)
ca65 $(CAFLAGS) --listing $(basename $@).list -o $@ $< ca65 $(CAFLAGS) --listing $(basename $@).list -o $@ $<
%.SYS: %.o $(OUTDIR)/%.SYS: $(OUTDIR)/%.o
ld65 $(LDFLAGS) -o $@ $< ld65 $(LDFLAGS) -o $@ $<
xattr -wx prodos.AuxType '00 20' $@ xattr -wx prodos.AuxType '00 20' $@

View File

@ -5,14 +5,20 @@
set -e set -e
IMGFILE="basys33.po" PACKDIR=$(mktemp -d)
IMGFILE="out/basys33.po"
VOLNAME="basys33" VOLNAME="basys33"
# Create a new disk image.
rm -f "$IMGFILE" rm -f "$IMGFILE"
cadius CREATEVOLUME "$IMGFILE" "$VOLNAME" 140KB --quiet --no-case-bits cadius CREATEVOLUME "$IMGFILE" "$VOLNAME" 140KB --no-case-bits --quiet
cp "basis.system.SYS" "basis.system#FF0000" add_file () {
cadius ADDFILE "$IMGFILE" "/$VOLNAME" "basis.system#FF0000" --quiet --no-case-bits cp "$1" "$PACKDIR/$2"
rm -f "basis.system#FF0000" cadius ADDFILE "$IMGFILE" "/$VOLNAME" "$PACKDIR/$2" --no-case-bits --quiet
}
add_file "out/basis.system.SYS" "basis.system#FF0000"
rm -r "$PACKDIR"
cadius CATALOG "$IMGFILE"