build into subdirs

This commit is contained in:
Joshua Bell 2018-02-21 08:04:32 -08:00
parent d8ec92c4c5
commit e7785fa845
6 changed files with 41 additions and 38 deletions

10
desk.acc/.gitignore vendored
View File

@ -1,12 +1,6 @@
# Object files (assembler output, pre-linking) # Build directory
*.o out
# Listing files (to review offsets)
*.list
# Output files (ProDOS file type F1)
*.F1
# Directory mounted in Virtual ][ as a ProDOS volume # Directory mounted in Virtual ][ as a ProDOS volume
mount mount

View File

@ -3,20 +3,29 @@ CC65 = ~/dev/cc65/bin
CAFLAGS = --target apple2enh --list-bytes 0 CAFLAGS = --target apple2enh --list-bytes 0
CCFLAGS = --config apple2-asm.cfg CCFLAGS = --config apple2-asm.cfg
# ProDOS file type is $F1 ($ is pesky) OUTDIR = out
TARGETS = calculator.F1 show_text_file.F1 date.F1 puzzle.F1 show_image_file.F1
.PHONY: clean all
all: $(TARGETS)
HEADERS = $(wildcard ../*.inc) $(wildcard ../inc/*.inc) $(wildcard *.inc) HEADERS = $(wildcard ../*.inc) $(wildcard ../inc/*.inc) $(wildcard *.inc)
DAS = calculator show_text_file date puzzle show_image_file
# ProDOS file type for DAs is $F1 ($ is pesky)
EXTENSION = F1
TARGETS = $(patsubst %,$(OUTDIR)/%.$(EXTENSION),$(DAS))
.PHONY: clean all
all: $(OUTDIR) $(TARGETS)
$(OUTDIR):
mkdir -p $(OUTDIR)
clean: clean:
rm -f *.o rm -f $(OUTDIR)/*.o
rm -f $(TARGETS) rm -f $(TARGETS)
%.o: %.s $(HEADERS) $(OUTDIR)/%.o: %.s $(HEADERS)
$(CC65)/ca65 $(CAFLAGS) --listing $(basename $@).list -o $@ $< $(CC65)/ca65 $(CAFLAGS) --listing $(basename $@).list -o $@ $<
%.F1: %.o $(OUTDIR)/%.$(EXTENSION): $(OUTDIR)/%.o
$(CC65)/ld65 $(CCFLAGS) -o $@ $< $(CC65)/ld65 $(CCFLAGS) -o $@ $<

View File

@ -19,7 +19,7 @@ function do_make {
} }
function verify { function verify {
diff "orig/$1.bin" "$1.F1" \ diff "orig/$1.bin" "out/$1.F1" \
&& (cecho green "diff $1 good" ) \ && (cecho green "diff $1 good" ) \
|| (tput blink ; cecho red "DIFF $1 BAD" ; return 1) || (tput blink ; cecho red "DIFF $1 BAD" ; return 1)
} }
@ -44,7 +44,7 @@ stats "show_text_file.s"
stats "date.s" stats "date.s"
stats "puzzle.s" stats "puzzle.s"
cat show_image_file.F1 > mount/SHOW.IMAGE.FILE.\$F1 \ cat out/show_image_file.F1 > mount/SHOW.IMAGE.FILE.\$F1 \
&& echo "Updated mountable file (SIF)" && echo "Updated mountable file (SIF)"
#cat calc_fixed.F1 > mount/TEST.\$F1 \ #cat calc_fixed.F1 > mount/TEST.\$F1 \

13
desktop/.gitignore vendored
View File

@ -1,15 +1,6 @@
# Object files (assembler output, pre-linking) # Build directory
*.o out
# Rebuilt segments (temporary)
*.built
# Listing files (to review offsets)
*.list
# Output files (ProDOS file type F1)
*.F1
# Directory mounted in Virtual ][ as a ProDOS volume # Directory mounted in Virtual ][ as a ProDOS volume
mount mount

View File

@ -3,20 +3,29 @@ CC65 = ~/dev/cc65/bin
CAFLAGS = --target apple2enh --list-bytes 0 CAFLAGS = --target apple2enh --list-bytes 0
CCFLAGS = --config asm.cfg CCFLAGS = --config asm.cfg
TARGETS = loader.built mgtk.built desktop.built invoker.built \ OUTDIR = out
ovl1.built ovl1a.built ovl5.built ovl6.built
.PHONY: clean all
all: $(TARGETS)
HEADERS = $(wildcard ../*.inc) $(wildcard ../inc/*.inc) $(wildcard *.inc) HEADERS = $(wildcard ../*.inc) $(wildcard ../inc/*.inc) $(wildcard *.inc)
SEGMENTS = loader mgtk desktop invoker \
ovl1 ovl1a ovl5 ovl6
EXTENSION = built
TARGETS = $(patsubst %,$(OUTDIR)/%.$(EXTENSION),$(SEGMENTS))
.PHONY: clean all
all: $(OUTDIR) $(TARGETS)
$(OUTDIR):
mkdir -p $(OUTDIR)
clean: clean:
rm -f *.o rm -f $(OUTDIR)/*.o
rm -f $(TARGETS) rm -f $(TARGETS)
%.o: %.s $(HEADERS) $(OUTDIR)/%.o: %.s $(HEADERS)
$(CC65)/ca65 $(CAFLAGS) --listing $(basename $@).list -o $@ $< $(CC65)/ca65 $(CAFLAGS) --listing $(basename $@).list -o $@ $<
%.built: %.o asm.cfg $(OUTDIR)/%.$(EXTENSION): $(OUTDIR)/%.o asm.cfg
$(CC65)/ld65 $(CCFLAGS) -o $@ $< $(CC65)/ld65 $(CCFLAGS) -o $@ $<

View File

@ -19,7 +19,7 @@ function do_make {
} }
function verify { function verify {
diff "orig/DESKTOP2_$1" "$1.built" \ diff "orig/DESKTOP2_$1" "out/$1.built" \
&& (cecho green "diff $1 good" ) \ && (cecho green "diff $1 good" ) \
|| (tput blink ; cecho red "DIFF $1 BAD" ; return 1) || (tput blink ; cecho red "DIFF $1 BAD" ; return 1)
} }