GNUmakefile 2.27 KB
include $(ROOT)/usr/include/make/PRdefs

IS_BB = 1 
BUNDLE_SA2=../viewer/rom
SYSAPP_AES=sysapp.aes 
SYSAPP_TIK=sysapp.tik
USE_TEXTURE = 1
#DEBUG = 1
LCDEFS += -D_BBID_GUARD
APP =		sysapp


ifdef DEBUG
OPTIMIZER =	-g
else
OPTIMIZER = -Os
endif

TARGETS =	rom

CODE_HFILES =	sysapp.h

CODE_CFILES =	sysapp.c sa2load.c mon.c vidreset.c

ifdef USE_TEXTURE
LCDEFS += -DUSE_TEXTURE=1
CODE_HFILES += gfx.h
CODE_CFILES += gfx.c gfxdynamic.c gfxstack.c gfxstatic.c gfxyield.c texture/home_msg1_gz.c texture/home_msg2_gz.c
endif

CODE_OBJECTS=	$(CODE_CFILES:.c=.o)

CODESEGMENT =	code.o

DATAFILES   = reserved.c
DATAOBJECTS = $(DATAFILES:.c=.o)
OBJECTS     = $(CODESEGMENT) $(DATAOBJECTS)

VERSION = $(shell date "+%D %T")

LCINCS =	-I. -I$(ROOT)/usr/include/PR
LCOPTS =	-mips2 -Wall -non_shared -G 0 -DVERSION="\"$(VERSION)\"" -DUSB_RDB -DEMS_MON

ifdef RMA_MON
LCDEFS += -DRMA_MON
else
LCDEFS += -DBBCARD_WRITE_ENABLE
endif

ifdef IS_BB
LCOPTS +=       -DIS_BB
MKOPTS =        -DIS_BB
endif

ifdef DEBUG
LCOPTS +=       -DDEBUG -DUSB_PRINTF -DFBDEBUG
else
LCOPTS +=       -DNDEBUG
endif

LASINCS =	$(LCINCS)
LASOPTS =	-non_shared -G 0

LDIRT  =	$(APP)

ifdef DEBUG
LDFLAGS =	$(MKDEPOPT) -lfb -L$(ROOT)/usr/lib -lultra_d -lcrypto -lz -lgcc --no-warn-mismatch
else
LDFLAGS =	$(MKDEPOPT) -lfb -L$(ROOT)/usr/lib -lultra -lcrypto -lz -lgcc --no-warn-mismatch
endif

default:	$(TARGETS)
ifdef BUNDLE_SA2
	../bundleBootapp2 $(TARGETS) $(BUNDLE_SA2)
else
	../bundleBootapp $(TARGETS) $(SYSAPP_AES) $(SYSAPP_TIK)
endif
#	../bundleBootapp -r 0xffffffff -R 0xffffffff $(TARGETS) $(SYSAPP_AES) $(SYSAPP_TIK)
#	../bundleBootapp -r 0x000001B3 -R 0x00000E01 $(TARGETS) $(SYSAPP_AES) $(SYSAPP_TIK)

include $(COMMONRULES)

install:	default

.PHONY: lib

clobber clean: 
	rm -rf *.o $(LDIRT) texture/*.tex texture/*.c  texture/*.o texture/*.h texture/*.gz rom.map

$(CODESEGMENT):		$(CODE_OBJECTS)
		$(LD) -o $@ -r $(CODE_OBJECTS) $(LDFLAGS)

$(TARGETS) $(APP):	spec $(OBJECTS) $(MAKEROM)
		$(MAKEROM) $(MKOPTS) -r $(TARGETS) spec -m > rom.map

texture/home_msg1_gz.c: texture/home_msg1.rgb
	(../viewer/tool/gzimg.pl RGBA 16 texture/home_msg1.rgb texture/home_msg1_gz.c gzTexMsg1 gzTexMsg1Size;)

texture/home_msg2_gz.c: texture/home_msg2.rgb
	(../viewer/tool/gzimg.pl RGBA 16 texture/home_msg2.rgb texture/home_msg2_gz.c gzTexMsg2 gzTexMsg2Size;)