-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add static library creation for cc65
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,3 +56,6 @@ dkms.conf | |
|
||
# VIM backup files | ||
*~ | ||
|
||
# subdir work paths | ||
*/work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
SUBDIRS= \ | ||
cc65 | ||
|
||
.PHONY: all clean cleanall | ||
|
||
all: | ||
@for path in $(SUBDIRS); do \ | ||
make -C $$path all; \ | ||
done | ||
|
||
clean: | ||
@for path in $(SUBDIRS); do \ | ||
make -C $$path clean; \ | ||
done | ||
|
||
cleanall: | ||
@for path in $(SUBDIRS); do \ | ||
make -C $$path cleanall; \ | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
SHELL:=/bin/bash | ||
|
||
ifdef USE_LOCAL_CC65 | ||
# use locally installed binary (requires 'cc65,ld65,etc' to be in the $PATH) | ||
CC65_PREFIX= | ||
else | ||
# use the binary built from the submodule | ||
CC65_PREFIX=$(PWD)/cc65/bin/ | ||
endif | ||
|
||
CC65=$(CC65_PREFIX)cc65 | ||
CA65=$(CC65_PREFIX)ca65 --cpu 4510 | ||
AR65=$(CC65_PREFIX)ar65 | ||
|
||
CFLAGS=-t c64 -I include/ | ||
|
||
LIB_OBJECTS = \ | ||
src/dirent.o \ | ||
src/fileio.o \ | ||
src/conio.o \ | ||
src/debug.o \ | ||
src/fat32.o \ | ||
src/fcio.o \ | ||
src/hal.o \ | ||
src/memory.o \ | ||
src/mouse.o \ | ||
src/random.o \ | ||
src/sdcard.o \ | ||
src/targets.o \ | ||
src/tests.o \ | ||
src/time.o | ||
|
||
.PHONY: all clean cleanall | ||
|
||
all: libmega65.a | ||
|
||
clean: | ||
rm -f src/*.o | ||
rm -rf build | ||
|
||
cleanall: clean | ||
rm -f libmega65.a | ||
|
||
libmega65.a: $(LIB_OBJECTS) | ||
$(AR65) a $@ $^ | ||
|
||
src/%.o: src/%.s | ||
$(CA65) -o $@ $< | ||
|
||
src/%.o: src/%.c | ||
@if [[ ! -d work ]]; then \ | ||
mkdir work; \ | ||
fi | ||
$(CC65) $(CFLAGS) -o work/$*.s $< | ||
$(CA65) -o $@ work/$*.s |