Makefile 2.16 KB
#---------------------------------------------------------------------
#	Copyright (C) 1997, Nintendo.
#	
#	File		Makefile
#	Coded    by	Yoshitaka Yasumoto.	Mar 18, 1997.
#	Modified by	
#	Comments	
#	
#	$Id: Makefile,v 1.1.1.1 2002/05/02 03:29:12 blythe Exp $
#---------------------------------------------------------------------

include	$(ROOT)/usr/include/make/PRdefs

DEFINES =	-DDEBUG

UCODE =		gspS2DEX.fifo
UCODES =	$(UCODE).o $(UCODE)_d.o
TARGET =	$(UCODES)

MAIN =		gs2main.s
SRCS =		$(MAIN) gs2loaduc.s gs2dma.s gs2imm.s gs2rdp.s gs2sprite.s \
		gs2rect.s gs2tmem.s gs2bg.s gs2bg1cyc.s gs2bg1cycL.s
HEADERS = 	gs2dmem.h gs2macros.h gs2regs.h
PR_HEADERS =	$(ROOT)/PR/include/gs2dex.h
LDIRT =		$(UCODE) $(UCODE)_d *.u *.dat *.lst *.sym *.dbg *.elf *.tvd \
		*~ doc.jp/*~ Tools/*~ Package/*~
PERL =		perl
CODEHACK =	Tools/codeHack.perl
DMEMHACK =	Tools/dmemHack.perl
MV =		mv

default:	$(TARGET)
	@echo \
	------------------------------------------------------
	@strings -30 $(TARGET)
	@echo \
	------------------------------------------------------

include $(COMMONRULES)

install exports: default
	$(INSTALL) -m 555 -F /usr/lib/PR $(UCODES)
	$(INSTALL) -m 444 -F /usr/src/PR/rspcode/graphics.S2DEX \
		$(SRCS) $(HEADERS) Makefile $(CODEHACK) $(DMEMHACK)
	(cd doc; $(INSTALL) -m 444 -F /usr/src/PR/doc/gfxucode.S2DEX README.jp)

$(UCODE).o:	$(SRCS) $(HEADERS) $(CODEHACK)
	$(RSPASM) $(DEFINES) -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR \
		-o $(UCODE) $(MAIN)
	$(PERL) $(CODEHACK) CODE_MAIN  $(UCODE) >  $(UCODE).u
	$(PERL) $(CODEHACK) CODE_PART1 $(UCODE) >> $(UCODE).u
	$(MV) $(UCODE).u $(UCODE)
	$(PERL) $(DMEMHACK) END_OF_DMEM_INIT $(UCODE) > $(UCODE).dat.u
	$(MV) $(UCODE).dat.u $(UCODE).dat
	$(RSP2ELF) -p -r $(UCODE)

$(UCODE)_d.o:	$(SRCS) $(HEADERS) $(CODEHACK)
	$(RSPASM) $(DEFINES) -DASSERT -DLOGGING -I$(ROOT)/usr/include \
		-I$(ROOT)/usr/include/PR -o $(UCODE)_d $(MAIN)
	$(PERL) $(CODEHACK) CODE_MAIN  $(UCODE)_d >  $(UCODE)_d.u
	$(PERL) $(CODEHACK) CODE_PART1 $(UCODE)_d >> $(UCODE)_d.u
	$(MV) $(UCODE)_d.u $(UCODE)_d
	$(PERL) $(DMEMHACK) END_OF_DMEM_INIT $(UCODE)_d > $(UCODE)_d.dat.u
	$(MV) $(UCODE)_d.dat.u $(UCODE)_d.dat
	$(RSP2ELF) -p -r $(UCODE)_d

#---- End of Makefile ----