GNUmakefile 1.88 KB
#!smake
PRDEPTH = ../..
include $(PRDEPTH)/PRdefs

COMMONPREF = BringupBoot

LASINCS = -I$(PRDEPTH)/iosim/src -I../include -I$(PRDEPTH)/include
LCINCS = -I$(ROOT)/PR/iosim/src -I../../include -I$(PRDEPTH)/include
ENDIAN = -EB
#if defined(HW_FLAGS) && $(HW_FLAGS) == "-D_HW_VERSION_1" 
BOOT_LDFLAGS = -allow_jump_at_eop -coff -N -T 04000400 -G 0
#else
#BOOT_LDFLAGS = -allow_jump_at_eop -coff -N -T 04000040 -G 0
BOOT_LDFLAGS = -N -Ttext 04000040 -G 0
#endif
#PIF2BOOT_LDFLAGS = -allow_jump_at_eop -coff -N -T b0001000 -G 0
PIF2BOOT_LDFLAGS = -N -Ttext 0xb0001000 -G 0
#LASOPTS = -Wab,-mips3 -Wab,-diag -non_shared -coff -G 0
LASOPTS = -Wab,-mips3 -Wab,-diag -non_shared -G 0
#LCOPTS = -Wab,-mips3 -Wab,-diag -non_shared -coff -g -G 0
LCOPTS = -Wa,-mips3 -Wab,-diag -non_shared -g -G 0

LDV= ${LD} ${LLDFLAGS} ${VLDFLAGS} ${ENDIAN} 

ASFILES  = Boot.s pif2Boot.s

TARGETS  = Boot pif2Boot
#if defined(HW_FLAGS) && $(HW_FLAGS) == "-D_HW_VERSION_1" 
ROMHEADER= romheader.v1
#else
ROMHEADER= romheader
#endif
LDIRT = $(TARGETS) $(TARGETS:=.elf)

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

include $(PRDEPTH)/PRrules

SUBDIRS = IPL4

default all:    $(TARGETS)
	$(SUBDIRS_MAKERULE)

#$(COMMONTARGS): $(_FORCE) $(COMMONPREF)$@
$(COMMONTARGS): % : $(COMMONPREF)% $(_FORCE) 
	$(SUBDIRS_MAKERULE)

headers:

#
# install to the same directory as rsp ucode (/usr/lib/PR)
#
install exports: $(TARGETS)
	$(SUBDIRS_MAKERULE)
	$(INSTALL) -m 444 -F /usr/lib/PR $(TARGETS) font
	$(INSTALL) -m 444 -F /usr/lib/PR -src $(ROMHEADER) -O romheader

Boot:	$(OBJECTS) Makefile
	$(LD) $(BOOT_LDFLAGS) Boot.o -o Boot.elf
	mips-linux-objcopy -O ecoff-bigmips -R .mdebug -R .reginfo Boot.elf Boot
#	$(SIZE) -x Boot | grep "Size of Boot"

pif2Boot: $(OBJECTS) Makefile
	$(LD) $(PIF2BOOT_LDFLAGS) pif2Boot.o -o pif2Boot.elf
	mips-linux-objcopy -O ecoff-bigmips -R .mdebug -R .reginfo pif2Boot.elf pif2Boot
#	$(SIZE) -x pif2Boot | grep "Size of pif2Boot"