2021-12-21 07:26:30 +00:00
|
|
|
AS=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-as
|
2022-02-05 14:32:44 +00:00
|
|
|
CC=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-gcc
|
2022-10-06 21:28:07 +00:00
|
|
|
LD=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-ld
|
|
|
|
STRIP=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-strip
|
2021-12-21 07:26:30 +00:00
|
|
|
OBJCOPY=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-objcopy
|
2022-04-19 21:31:31 +00:00
|
|
|
HOSTCC=gcc
|
2022-10-06 20:08:48 +00:00
|
|
|
HOSTCFLAGS=-O2
|
|
|
|
|
|
|
|
ARCHFLAGS=-march=68020 -mcpu=68020
|
|
|
|
CFLAGS=-O2 -mpcrel
|
2021-12-21 07:26:30 +00:00
|
|
|
|
2022-12-11 16:00:28 +00:00
|
|
|
NS816DECLROMDIR=./ns816-declrom
|
2021-12-21 07:26:30 +00:00
|
|
|
NUBUS_CHECKSUM=${NS816DECLROMDIR}/nubus_checksum
|
|
|
|
PROCESS_ROM=${NS816DECLROMDIR}/process_rom
|
|
|
|
|
|
|
|
APPLEINCS=${NS816DECLROMDIR}/atrap.inc ${NS816DECLROMDIR}/declrom.inc ${NS816DECLROMDIR}/globals.inc
|
|
|
|
|
2022-04-17 09:25:48 +00:00
|
|
|
HRES=1920
|
|
|
|
VRES=1080
|
2022-02-05 14:32:44 +00:00
|
|
|
|
2023-01-27 21:25:12 +00:00
|
|
|
CSRC_VIDEO=NuBusFPGADrvr_OpenClose.c NuBusFPGADrvr_Ctrl.c NuBusFPGADrvr_Status.c NuBusFPGAPrimaryInit_Primary.c NuBusFPGAPrimaryInit_RamInit.c NuBusFPGASecondaryInit_Secondary.c
|
2022-06-12 11:45:41 +00:00
|
|
|
CSRC_RAMDSK=NuBusFPGARAMDskDrvr_OpenClose.c NuBusFPGARAMDskDrvr_Ctrl.c NuBusFPGARAMDskDrvr_Prime.c NuBusFPGARAMDskDrvr_Status.c myrle.c
|
2022-06-07 21:05:08 +00:00
|
|
|
CSRC=${CSRC_VIDEO} ${CSRC_RAMDSK}
|
2022-02-05 14:32:44 +00:00
|
|
|
CSRC_ASM=${CSRC:.c=.s}
|
|
|
|
|
2022-09-17 15:06:15 +00:00
|
|
|
GEN_ASM=VidRomDef.s VidRomDir.s VidRomName.s VidRomRes.s VidRomRsrcDir.s
|
|
|
|
|
2022-12-11 16:00:28 +00:00
|
|
|
all: vid_decl_rom.bin
|
|
|
|
|
2022-09-17 15:06:15 +00:00
|
|
|
gen_mode: gen_mode.c
|
2022-10-06 20:08:48 +00:00
|
|
|
$(HOSTCC) -Wall ${HOSTCFLAGS} $^ -o $@
|
2022-09-17 15:06:15 +00:00
|
|
|
|
|
|
|
${GEN_ASM}: gen_mode
|
|
|
|
./gen_mode ${HRES} ${VRES}
|
|
|
|
|
2022-12-11 16:00:28 +00:00
|
|
|
$(NUBUS_CHECKSUM): ${NS816DECLROMDIR}/nubus_checksum.cc ${NS816DECLROMDIR}/nubus_crc.cc
|
|
|
|
g++ -std=c++11 $^ -lglog -lgflags -labsl_strings -o $@
|
2021-12-21 07:26:30 +00:00
|
|
|
|
2022-10-06 21:54:24 +00:00
|
|
|
vid_decl_rom.o: vid_decl_rom.s NuBusFPGADrvr.s NuBusFPGARAMDskDrvr.s ${APPLEINCS} DepVideo.inc ${GEN_ASM}
|
2022-02-05 14:32:44 +00:00
|
|
|
rm -f res.inc
|
|
|
|
echo -e "HRES=${HRES}\nVRES=${VRES}\n" | tee res.inc
|
2022-10-06 20:08:48 +00:00
|
|
|
${AS} ${ARCHFLAGS} -I${NS816DECLROMDIR} $< -o $@ -a > vid_decl_rom.l
|
2021-12-21 07:26:30 +00:00
|
|
|
|
2022-10-06 21:28:07 +00:00
|
|
|
myrle.o: myrle.c
|
|
|
|
${CC} ${ARCHFLAGS} ${CFLAGS} $< -c -o $@ -DSKIP_MAIN
|
2022-06-12 11:45:41 +00:00
|
|
|
|
|
|
|
dump_cpr.s: dump_cpr.c
|
2022-10-06 20:08:48 +00:00
|
|
|
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DSKIP_MAIN
|
2022-06-12 11:45:41 +00:00
|
|
|
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
|
|
|
sed -i -e 's/\.\(L[0-9][0-9]*\)/.dump_cpr_\1/g' $@
|
2022-06-07 21:05:08 +00:00
|
|
|
|
2022-10-06 21:28:07 +00:00
|
|
|
%.o: %.c NuBusFPGADrvr.h
|
|
|
|
${CC} ${CFLAGS} $< -c -o $@ -DHRES=${HRES} -DVRES=${VRES}
|
2022-06-07 21:05:08 +00:00
|
|
|
|
2022-10-06 21:28:07 +00:00
|
|
|
vid_decl_rom.elf: linker.ld vid_decl_rom.o ${CSRC:.c=.o} # linker script must be first
|
|
|
|
${LD} -o $@ -T $^
|
2022-04-17 09:25:48 +00:00
|
|
|
|
2022-10-06 21:28:07 +00:00
|
|
|
vid_decl_rom.raw: vid_decl_rom.elf
|
2022-02-05 14:32:44 +00:00
|
|
|
${OBJCOPY} $^ $@ --input-target=elf32-m68k --output-target=binary
|
2021-12-21 07:26:30 +00:00
|
|
|
|
2022-12-11 16:00:28 +00:00
|
|
|
vid_decl_rom.bin: vid_decl_rom.raw $(NUBUS_CHECKSUM)
|
2022-02-05 14:32:44 +00:00
|
|
|
${NUBUS_CHECKSUM} --input_file $< --output_file $@ --output_size 32768
|
2022-06-24 21:37:18 +00:00
|
|
|
dd if=dump.cpr of=vid_decl_rom.bin bs=1 conv=notrunc
|
2022-02-05 14:32:44 +00:00
|
|
|
|
|
|
|
clean:
|
2022-09-17 15:06:15 +00:00
|
|
|
rm -f res.inc ${CSRC_ASM} *.o vid_decl_rom.srec vid_decl_rom.raw vid_decl_rom.dir vid_decl_rom.l VidRom*.s
|
2022-04-19 21:31:31 +00:00
|
|
|
|
|
|
|
append_romdir: append_romdir.c
|
|
|
|
${HOSTCC} $< -o $@
|