1#!/usr/bin/env omake
2#----------------------------------------------------------------------------
3# Project:  NintendoWare
4# File:     OMakefile
5#
6# Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc.  All rights reserved.
7#
8# These coded instructions, statements, and computer programs contain proprietary
9# information of Nintendo and/or its licensed developers and are protected by
10# national and international copyright laws. They may not be disclosed to third
11# parties or copied or duplicated in any form, in whole or in part, without the
12# prior written consent of Nintendo.
13#
14# The content herein is highly confidential and should be handled accordingly.
15#
16# $Revision: $
17#----------------------------------------------------------------------------
18
19RESOURCE_DIR = Common/resources
20SHADER_DIR = Common/shaders
21
22BINARY_CONVERTER     = $(NW4C_ROOT)/tools/CreativeStudio/NW4C_CreativeStudioConsole.exe
23.PHONY: resource
24
25GEOMETRY_SHADER_INCLUDES[] =
26GEOMETRY_SHADER_PATH = $(CTRSDK_ROOT)/resources/shaders
27
28public.GfxVertexShaderObject(files) =
29    OFILES =
30    OBJDIR = objects
31    foreach(file, $(files))
32        OFILE = $(OBJDIR)/$(rootname $(basename $(file))).o
33        $(OFILE): $(file)
34            mkdir -p $(dirname $@)
35            $(VERTEX_SHADER_ASSEMBLER) $(addprefix -I, $(VERTEX_SHADER_INCLUDES)) -O$@ $< -nowarning
36        OFILES += $(OFILE)
37        export OFILES
38    return $(OFILES)
39
40public.GfxVertexShader(outdir, name, files) =
41    GEOMERY_FULL_NAME = $(addprefix $(GEOMETRY_SHADER_PATH)/, $(GEOMETRY_SHADER_INCLUDES))
42    OBJS              = $(GfxVertexShaderObject $(files))
43    OFILE             = $(outdir)/$(name).shbin
44
45    $(OFILE): $(OBJS) $(GEOMERY_FULL_NAME)
46        mkdir -p $(dirname $@)
47        $(VERTEX_SHADER_LINKER) -O$@ $+
48
49    return $(OFILE)
50
51public.GfxBinaryObject(ofile, files, option) =
52    $(ofile): $(files) $(BINARY_CONVERTER)
53         mkdir -p $(dirname $@)
54         $(BINARY_CONVERTER) $(filter-out %.exe, $^) --verbose -o=$@ $(option)
55    return $(ofile)
56
57public.GfxBinaryObjects(outdir, files, option) =
58    OFILES =
59    foreach(file, $(files))
60        OFILE =
61        suffix_name = $(suffix $(file))
62        binary_suffix_name = $(addprefix ., $(join b, $(removeprefix ., $(suffix $(file)))))
63        OFILE = $(outdir)/$(replacesuffixes $(suffix_name), $(binary_suffix_name), $(basename $(file)))
64        OFILES += $(GfxBinaryObject $(OFILE), $(file), $(option))
65        export OFILES
66
67    return $(OFILES)
68
69DEMOS[] =
70    SceneTreeDemo
71    SimpleDemo
72    AnimationDemo
73    AnimationBlendDemo
74    AnimationChangeDemo
75    PartialAnimationDemo
76    ParticleDemo
77    ResourceDemo
78    LowLayerDemo
79    LowLayerAnimationDemo
80    ParticleUpdaterDemo
81    ParticleRecycleDemo
82    ParticleChokeDemo
83    ParticleCtrlEmissionDemo
84    ParticleApplicationDemo
85    MultiInstanceDemo
86    MultiAnimationDemo
87    ParticleChangeVtxDemo
88    ProjectionShadowDemo
89    ShadowMapDemo
90    ParticleLowLayerDemo
91    ConstraintDemo
92    DynamicMaterialDemo
93    ParticleScaleDemo
94    ParticleCombinationNodeDemo
95    ParticleMissileDemo
96    ParticleDropFrameDemo
97    FastCreateDemo
98    UserRenderNodeDemo
99
100.SUBDIRS: $(DEMOS)
101
102DefineDefaultRules()
103