1###############################################################################
2# Makefile for GD demos
3#
4# Copyright 2006 Nintendo.  All rights reserved.
5#
6# These coded instructions, statements, and computer programs contain
7# proprietary information of Nintendo of America Inc. and/or Nintendo
8# Company Ltd., and are protected by Federal copyright law.  They may
9# not be disclosed to third parties or copied or duplicated in any form,
10# in whole or in part, without the prior written consent of Nintendo.
11#
12#  $Log: makefile,v $
13#  Revision 1.3  03/02/2006 00:19:08  mitu
14#  added chmod before execution of script.
15#
16#  Revision 1.2  02/09/2006 01:19:49  hirose
17#  Added link path to TPL library.
18#
19#  Revision 1.1  02/08/2006 11:20:08  mitu
20#  1st version.
21#
22#  $NoKeywords: $
23#
24###############################################################################
25
26# All modules have "setup" and "build" as targets.  System libraries
27# and demo programs also have an "install" target that copies the compiled
28# binaries to the binary tree (/dolphin/$(ARCH_TARGET)).
29# tests are NOT installed into the binary release directory.
30
31ifdef X86
32#build host library
33all:    buildhost
34clean:  cleanhost
35else
36# build and install library for GC hardware
37all:    setup build install
38endif
39
40ifdef X86
41buildhost:
42	@chmod u+x buildhostscript
43	@echo =========== Build host demos ==============
44	@./buildhostscript
45	@echo ===========================================
46
47cleanhost:
48	@chmod u+x buildhostscript
49	@echo =========== Clean up host demos ===========
50	@./buildhostscript /CLEAN
51	@echo ===========================================
52endif
53
54# module name should be set to the name of this subdirectory
55# DEMO = TRUE indicates that this module resides under the "demos" subtree.
56# The list of selectable paths can be found in modulerules.
57MODULENAME  = gddemo
58DEMO        = TRUE
59
60# commondefs must be included near the top so that all common variables
61# will be defined before their use.
62include $(REVOLUTION_SDK_ROOT)/build/buildtools/commondefs
63
64# additional libraries not defined as REVOLUTION_LIBS
65TPL_LIB     = $(INSTALL_ROOT)/lib/tpl$(LIBSUFFIX)
66
67# common sources built for both EPPC and MAC
68# CSRCS lists all C files that should be built
69# The makefile determines which objects are linked into which binaries
70# based on the dependencies you fill in at the bottom of this file
71CSRCS = \
72    gd-texture-gc.c \
73    gd-texture-gc-load.c \
74    gd-texture-create.c \
75    \
76    gd-matrix-gc.c \
77    gd-matrix-gc-load.c \
78    gd-matrix-create.c \
79    \
80    gd-light-gc.c \
81    gd-light-gc-load.c \
82    gd-light-create.c \
83    \
84    gd-tev-gc.c \
85    gd-tev-gc-load.c \
86    gd-tev-create.c \
87    \
88    gd-indtex-gc.c \
89    gd-indtex-gc-load.c \
90    gd-indtex-create.c \
91    \
92    gd-init-gc.c \
93    gd-init-gc-load.c \
94    gd-init-create.c
95
96# common binaries linked for both EPPC and MAC
97# BINNAMES lists all binaries that will be linked.  Note that no suffix is
98# required, as that will depend on whether this is a DEBUG build or not.
99# The final name of the binaries will be $(BINNAME)$(BINSUFFIX)
100BINNAMES = \
101    gd-texture-gc-load \
102    gd-texture-gc-create \
103    gd-matrix-gc-load \
104    gd-matrix-gc-create \
105    gd-light-gc-load \
106    gd-light-gc-create \
107    gd-tev-gc-load \
108    gd-tev-gc-create \
109    gd-indtex-gc-load \
110    gd-indtex-gc-create \
111    gd-init-gc-load \
112    gd-init-gc-create
113
114ifdef EPPC
115LCF_FILE    = $(INC_ROOT)/revolution/eppc.$(ARCH_TARGET).lcf
116endif
117
118ifdef WALL
119CCFLAGS +=  -w all
120endif
121
122# modulerules contains the rules that will use the above variables
123# and dependencies below to construct the binaries specified.
124include $(REVOLUTION_SDK_ROOT)/build/buildtools/modulerules
125
126# Dependencies for the binaries listed in BINNAMES should come here
127# They are your typical makefile rule, with extra variables to ensure
128# that the names and paths match up.
129# $(FULLBIN_ROOT) is the location of the local bin directory
130# $(BINSUFFIX) depends on whether this is a debug build or not
131# $(REVOLUTION_LIBS) includes all the Dolphin libraries.
132$(FULLBIN_ROOT)/gd-texture-gc-load$(BINSUFFIX): \
133    gd-texture-gc-load.o \
134    $(REVOLUTION_LIBS) $(TPL_LIB) $(INSTALL_ROOT)/lib/gd$(LIBSUFFIX)
135
136$(FULLBIN_ROOT)/gd-texture-gc-create$(BINSUFFIX): \
137    gd-texture-gc.o gd-texture-create.o \
138    $(REVOLUTION_LIBS) $(TPL_LIB) $(INSTALL_ROOT)/lib/gd$(LIBSUFFIX)
139
140$(FULLBIN_ROOT)/gd-matrix-gc-load$(BINSUFFIX): \
141    gd-matrix-gc-load.o \
142    $(REVOLUTION_LIBS) $(INSTALL_ROOT)/lib/gd$(LIBSUFFIX)
143
144$(FULLBIN_ROOT)/gd-matrix-gc-create$(BINSUFFIX): \
145    gd-matrix-gc.o gd-matrix-create.o \
146    $(REVOLUTION_LIBS) $(INSTALL_ROOT)/lib/gd$(LIBSUFFIX)
147
148$(FULLBIN_ROOT)/gd-light-gc-load$(BINSUFFIX): \
149    gd-light-gc-load.o \
150    $(REVOLUTION_LIBS) $(INSTALL_ROOT)/lib/gd$(LIBSUFFIX)
151
152$(FULLBIN_ROOT)/gd-light-gc-create$(BINSUFFIX): \
153    gd-light-gc.o gd-light-create.o \
154    $(REVOLUTION_LIBS) $(INSTALL_ROOT)/lib/gd$(LIBSUFFIX)
155
156$(FULLBIN_ROOT)/gd-tev-gc-load$(BINSUFFIX): \
157    gd-tev-gc-load.o \
158    $(REVOLUTION_LIBS) $(TPL_LIB) $(INSTALL_ROOT)/lib/gd$(LIBSUFFIX)
159
160$(FULLBIN_ROOT)/gd-tev-gc-create$(BINSUFFIX): \
161    gd-tev-gc.o gd-tev-create.o \
162    $(REVOLUTION_LIBS) $(TPL_LIB) $(INSTALL_ROOT)/lib/gd$(LIBSUFFIX)
163
164$(FULLBIN_ROOT)/gd-indtex-gc-load$(BINSUFFIX): \
165    gd-indtex-gc-load.o \
166    $(REVOLUTION_LIBS) $(INSTALL_ROOT)/lib/gd$(LIBSUFFIX)
167
168$(FULLBIN_ROOT)/gd-indtex-gc-create$(BINSUFFIX): \
169    gd-indtex-gc.o gd-indtex-create.o \
170    $(REVOLUTION_LIBS) $(INSTALL_ROOT)/lib/gd$(LIBSUFFIX)
171
172$(FULLBIN_ROOT)/gd-init-gc-load$(BINSUFFIX): \
173    gd-init-gc-load.o \
174    $(REVOLUTION_LIBS) $(INSTALL_ROOT)/lib/gd$(LIBSUFFIX)
175
176$(FULLBIN_ROOT)/gd-init-gc-create$(BINSUFFIX): \
177    gd-init-gc.o gd-init-create.o \
178    $(REVOLUTION_LIBS) $(INSTALL_ROOT)/lib/gd$(LIBSUFFIX)
179
180#======== End of makefile ========#
181