#!/usr/bin/env omake
#----------------------------------------------------------------------------
# Project:  NintendoWare
# File:     OMakefile
#
# Copyright (C)2009-2011 Nintendo Co., Ltd./HAL Laboratory, Inc.  All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# proprietary information of Nintendo of America Inc. and/or Nintendo
# Company Ltd., and are protected by Federal copyright law.  They may
# not be disclosed to third parties or copied or duplicated in any form,
# in whole or in part, without the prior written consent of Nintendo.
#
# $Revision: 38331 $
#----------------------------------------------------------------------------

SAMPLED_DEMOS_COMMON_INCLUDE_DIR   =   $(dir ../../common/include)
INCLUDES           +=   $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR)

SUPPORTED_TARGETS   =   CTR-*.Process.MPCore.*

SOURCES[]           =   
                        main.cpp

TARGET_PROGRAM      =   PackedFont

FONT_OPTIONS        =   -i win -in Tahoma -is 16 -ic A6 -ia -o bcfnt -op resources/layoutDemo.xggp -f resources/layoutDemo.xllt
FONT_CONVERTER      =   $(CTRSDK_ROOT)/tools/FontConverter/ctr_FontConverterConsole.exe 

SHADER_BIN          =   nnfont_TextWriterShader.shbin

LIBS               +=   lib_demo lib_applet

# Specifies the file root that is included in the ROM .
# Files under this path will be loaded from the file system that the ROM includes.
ROMFS_ROOT          =   romfiles

SHADER_PATH         =   $(ROMFS_ROOT)/$(SHADER_BIN)

FONT_FILE           =   $(ROMFS_ROOT)/tahoma.bcfna

ROMFS_DEPENDENCIES  =   $(FONT_FILE) $(SHADER_PATH)

include $(ROOT_OMAKE)/modulerules

build: $(DEFAULT_TARGETS)

$(FONT_FILE):
    mkdir -p $(dirname $@)
    $(FONT_CONVERTER) -of $@ $(FONT_OPTIONS)

$(SHADER_PATH): $(CTRSDK_ROOT)/resources/shaders/font/$(SHADER_BIN)
    mkdir -p $(dirname $@)
    cp $< $@
