Makefile 2.42 KB
PRDEPTH = ../..
include $(PRDEPTH)/PRdefs

LASINCS = -I../include -I$(ROOT)/usr/include/sys -I$(ROOT)/usr/include/PR

TM_DMEM_LDFLAGS = -coff -allow_jump_at_eop -n -N -T 84000000 -G 0
TM_IMEM_LDFLAGS = -coff -allow_jump_at_eop -n -N -T 84001000 -G 0
RAMROM_BOOT_LDFLAGS = -coff -allow_jump_at_eop -n -N -T b0000400 -G 0
RDRAM_LDFLAGS = -coff -allow_jump_at_eop -n -N -T 80000000 -G 0
PIF2DIAGBOOT_LDFLAGS = -allow_jump_at_eop -coff -N -T b0001000 -G 0

LCFLAGS = -D_HW_VERSION_1
LLDFLAGS = -coff -allow_jump_at_eop -nN -T bfc00000 -G 0
LASOPTS = -non_shared -G 0
LDV= ${LD} ${LLDFLAGS} ${VLDFLAGS}

ASFILES  = pifdebug1.s pifdebug2.s pifmon.s tinymon_pif.s tm_rdram_boot.s \
	tm_rdram.s tm_imem_boot.s tm_dmem_boot.s pif2DiagBoot.s

TARGETS  = pifdebug1 pifdebug2 pifmon pif2DiagBoot $(UCODE_TARGETS)

UCODE_TARGETS = tinymon_pif.rom tm_rdram_boot tm_rdram.rom \
	tm_imem.rom tm_imem_boot tm_dmem.rom tm_dmem_boot

LDIRT_TARGETS = fakerom tm_rdram tm_imem tm_dmem
LDIRT = $(OBJECTS) $(LDIRT_TARGETS)

OBJECTS = $(ASFILES:.s=.o)

include $(PRDEPTH)/PRrules

default all:    $(TARGETS)

install: default
	$(INSTALL) -m 444 -F /usr/diags/ucode $(UCODE_TARGETS)

pifdebug1:	pifdebug1.o
	$(LDV) pifdebug1.o -o pifdebug1

pifdebug2:	pifdebug2.o
	$(LDV) pifdebug2.o -o pifdebug2

pifmon:	pifmon.o
	$(LDV) pifmon.o -o pifmon

tinymon_pif:	tinymon_pif.o
	${LD} ${RAMROM_BOOT_LDFLAGS} ${VLDFLAGS} tinymon_pif.o -o tinymon_pif

tinymon_pif.rom: tinymon_pif fakerom
	fakerom tinymon_pif tinymon_pif

tm_rdram:	tm_rdram.o
	${LD} ${RDRAM_LDFLAGS} ${VLDFLAGS} tm_rdram.o \
	-o tm_rdram

tm_rdram.rom:	tm_rdram tm_rdram_boot fakerom
	fakerom tm_rdram_boot tm_rdram

tm_rdram_boot:	tm_rdram_boot.o
	${LD} ${RAMROM_BOOT_LDFLAGS} ${VLDFLAGS} tm_rdram_boot.o \
	-o tm_rdram_boot

fakerom: fakerom.c
	$(CCF) -g $(LASINCS) -nostdlib -L $(ROOT)/usr/lib -o fakerom fakerom.c -lmld

tm_imem:	tm_rspmem.o
	${LD} ${TM_IMEM_LDFLAGS} ${VLDFLAGS} tm_rspmem.o -o tm_imem

tm_imem.rom:	tm_imem_boot tm_imem fakerom
	fakerom tm_imem_boot tm_imem

tm_imem_boot:	tm_imem_boot.o
	${LD} ${RAMROM_BOOT_LDFLAGS} ${VLDFLAGS} tm_imem_boot.o \
	-o tm_imem_boot

tm_dmem:	tm_rspmem.o
	${LD} ${TM_DMEM_LDFLAGS} ${VLDFLAGS} tm_rspmem.o -o tm_dmem

tm_dmem.rom:	tm_dmem_boot tm_dmem fakerom
	fakerom tm_dmem_boot tm_dmem

tm_dmem_boot:	tm_dmem_boot.o
	${LD} ${RAMROM_BOOT_LDFLAGS} ${VLDFLAGS} tm_dmem_boot.o \
	-o tm_dmem_boot

pif2DiagBoot: $(OBJECTS) Makefile
	$(LD) $(PIF2DIAGBOOT_LDFLAGS) pif2DiagBoot.o -o pif2DiagBoot