Skip to content

Instantly share code, notes, and snippets.

@plainspooky
Last active June 16, 2019 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save plainspooky/d60a255c9621a6226820 to your computer and use it in GitHub Desktop.
Save plainspooky/d60a255c9621a6226820 to your computer and use it in GitHub Desktop.
Makefile de exemplo para utilizar com o SDCC para produzir binários de MSX-DOS (não se esqueça de editar INFILE e OUTFILE)
CAT=cat
CC=sdcc
ECHO=echo
EMULATOR=openmsx
HEXBIN=../bin/hexbin.py
MKDISK=
RM=rm
INFILE=hello.c
OUTFILE=hello
INCLUDE=-I../msx
PARAMS=-mz80 --no-std-crt0 --data-loc 0
NORMAL=--code-loc 0x107 ../msx/crt0msx_msxdos.rel
ADVANCED=--code-loc 0x178 ../msx/crt0msx_msxdos_advanced.rel
RELOCATE=../msx/putchar.rel ../msx/getchar.rel ../msx/dos.rel ../msx/conio.rel
.PHONY: normal advanced clean superclean
default:
make advanced
normal:
${CC} ${INCLUDE} ${PARAMS} ${NORMAL} ${RELOCATE} ${INFILE}
${HEXBIN} ${OUTFILE}.ihx >${OUTFILE}.com
advanced:
${CC} ${INCLUDE} ${PARAMS} ${ADVANCED} ${RELOCATE} ${INFILE}
${HEXBIN} ${OUTFILE}.ihx >${OUTFILE}.com
clean:
${RM} ${OUTFILE}.com ${OUTFILE}.ihx
superclean:
${RM} -f ${OUTFILE}.asm ${OUTFILE.com ${OUTFILE}.ihx ${OUTFILE}.lk ${OUTFILE}.lst ${OUTFILE}.map ${OUTFILE}.noi ${OUTFILE}.rel ${OUTFILE}.sym
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment