head	1.5;
access;
symbols
	start:1.1.1.1 nintendo:1.1.1;
locks; strict;
comment	@# @;


1.5
date	2006.05.23.06.35.11;	author teruki;	state Exp;
branches;
next	1.4;

1.4
date	2006.05.15.05.42.29;	author teruki;	state Exp;
branches;
next	1.3;

1.3
date	2006.05.15.05.41.30;	author teruki;	state Exp;
branches;
next	1.2;

1.2
date	2006.05.15.04.49.18;	author teruki;	state Exp;
branches;
next	1.1;

1.1
date	2006.05.15.04.44.44;	author teruki;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2006.05.15.04.44.44;	author teruki;	state Exp;
branches;
next	;


desc
@@


1.5
log
@R}hύX
@
text
@###############################################################################
# Relocatable module demo
#
# Copyright 2001, 2002 Nintendo.  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.
#
###############################################################################

##################################
# QUICK START INSTRUCTIONS
# Type "make" at /dolphin/build/demos/reldemo to build DEBUG versions.
# Type "make NDEBUG=TRUE" to build OPTIMIZED versions.
#
# Copy bin/$(PLATFORM)/*.str and bin/$(PLATFORM)/*.rel to the emulation 
# drive root.
##################################

# commondefs must be included near the top so that all common variables
# will be defined before their use.
include $(BUILDTOOLS_ROOT)/commondefs

# build any code modules and module name string table
all:    setup build install

# module name should be set to the name of this subdirectory
# DEMO = TRUE indicates that this module resides under the "demos" subtree.
# The list of selectable paths can be found in modulerules.
PROJ_ROOT   = ..
MODULENAME  = dlltest
#DEMO        = TRUE

DOLPHINLIBS += $(INSTALL_ROOT)/lib/ip$(LIBSUFFIX) \
               $(INSTALL_ROOT)/lib/eth$(LIBSUFFIX) \
               osreport.o 

DOLPHINLIBS := $(INSTALL_ROOT)/lib/dvdeth$(LIBSUFFIX) $(DOLPHINLIBS)

# small data sections are not supported by relocatable modules
CCFLAGS += -sdata 0 -sdata2 0 -DDVDETH

ifdef MAC

else
# EPPC

# CSRCS lists all C files that should be built
# The makefile determines which objects are linked into which binaries
# based on the dependencies you fill in at the bottom of this file
CSRCS = static.c osreport.c

# CPPSRCS lists all C++ files that should be built
# The makefile determines which objects are linked into which binaries
# based on the dependencies you fill in at the bottom of this file
CPPSRCS = a.cpp b.cpp

# BINNAMES specifies the static portion of the program.  Note that no suffix
# is required, as that will depend on whether this is a DEBUG build or not.
# The final name of the binaries will be $(STATIC)$(BINSUFFIX)
BINNAMES    = static

# RELNAMES lists all relocatable modules that will be linked.
# Note that no suffix is required, as that will depend on whether
# this is a DEBUG build or not.
# The final name of the modules will be $(RELNAMES)$(RELSUFFIX)
RELNAMES    = a b

# linker command file for building the static module
LCF_FILE        = static$(LCFSUFFIX)

# linker command file for building relocatable modules (for 1st step)
PREREL_LCF_FILE = $(INC_ROOT)/dolphin/eppc.lcf

# linker command file for building relocatable modules (for 2nd step)
REL_LCF_FILE    = partial$(LCFSUFFIX)

# filename of the force active symbol name list
LST_FILE        = active$(LSTSUFFIX)

endif

# modulerules contains the rules that will use the above variables 
# and dependencies below to construct the binaries specified.
include $(BUILDTOOLS_ROOT)/modulerules

# all build targets that depend on 'setup' target must be listed as
# prerequisites  for 'dobuild'.
dobuild: static$(STRSUFFIX)

# dependencies and rules for any added rules may be placed here to take
# advantage of commondefs.
# $(FULLBIN_ROOT) is the location of the local bin directory
# $(BINSUFFIX) depends on whether this is a debug build or not
# $(DOLPHINLIBS) includes all the Dolphin libraries.

# generate the module name string table. *.rel files are also generated.
static$(STRSUFFIX): $(FULLBIN_ROOT)/static$(BINSUFFIX) $(TARGET_PLFS)
	@@echo 
	@@echo ">> $(notdir $+) --> $@@"
	"$(ROOT)/X86/bin/makerelD.exe" $+

# $(PREPLFSUFFIX) are for the 1st .plf file build without .lcf file
# $(PLFSUFFIX)    are for the 2nd .plf file build with .lcf file

$(FULLBIN_ROOT)/a$(PREPLFSUFFIX): a.o \
	$(BINOBJ_ROOT)/global_destructor_chain.o

$(FULLBIN_ROOT)/b$(PREPLFSUFFIX): b.o \
	$(BINOBJ_ROOT)/global_destructor_chain.o

$(FULLBIN_ROOT)/static$(BINSUFFIX): static.o $(DOLPHINLIBS) $(LCF_FILE)

$(FULLBIN_ROOT)/a$(PLFSUFFIX): a.o \
	$(FULLBIN_ROOT)/static$(BINSUFFIX) \
	$(BINOBJ_ROOT)/global_destructor_chain.o $(REL_LCF_FILE)

$(FULLBIN_ROOT)/b$(PLFSUFFIX): b.o \
	$(FULLBIN_ROOT)/static$(BINSUFFIX) \
	$(BINOBJ_ROOT)/global_destructor_chain.o $(REL_LCF_FILE)

# generate force active symbol list.
$(LST_FILE): $(TARGET_PREPLFS)
	@@echo 
	@@echo ">> $(notdir $+) --> $@@"
	"$(ROOT)/X86/bin/makerelD.exe" $(TARGET_PREPLFS)
	cat import.lst > $(LST_FILE)

# generate linker command file for the static module.
$(LCF_FILE): $(LST_FILE)
	@@echo 
	@@echo ">> $+ --> $@@"
	cat $(INC_ROOT)/dolphin/eppc.$(ARCH_TARGET).lcf > $@@
	echo "FORCEACTIVE { " >> $@@
	cat $(LST_FILE) >> $@@
	echo "    OSLink" >> $@@
	echo "    OSUnlink" >> $@@
	echo "}" >> $@@

# generate linker command file for relocatable modules.
$(REL_LCF_FILE): $(LST_FILE)
	@@echo 
	@@echo ">> $+ --> $@@"
	cat $(PREREL_LCF_FILE) > $@@
	echo "FORCEACTIVE { " >> $@@
	echo "    _prolog" >> $@@
	echo "    _epilog" >> $@@
	echo "    _unresolved" >> $@@
	echo "    __global_destructor_chain" >> $@@
	cat $(LST_FILE) >> $@@
	echo "}" >> $@@
	echo "EXCLUDEFILES { " >> $@@
	echo -n "    " >> $@@
	echo static$(BINSUFFIX) >> $@@
	echo " }" >> $@@

clean:
	rm -f *.lst
	rm -f *.lcf

$(BINOBJ_ROOT)/global_destructor_chain.o:
	$(CC) $(CCFLAGS) $(INCLUDES) \
        $(COMPILE) $(MWDIR)/PowerPC_EABI_Support/Runtime/Src/global_destructor_chain.c \
        -o $@@


dvdcopy:
	@@if [ ! -d dvdroot ] ; then \
		mkdir dvdroot ; \
	fi
	cp bin/HW2/*.str dvdroot/
	cp bin/HW2/*.rel dvdroot/


srconly:
	$(MAKE) clean
	@@if [ -d bin ] ; then \
		rm -rf bin ; \
	fi
	@@if [ -d depend ] ; then \
		rm -rf depend ; \
	fi
	@@if [ -d lib ] ; then \
		rm -rf lib ; \
	fi
	@@if [ -d obj ] ; then \
		rm -rf obj ; \
	fi
	@@if [ -d dvdroot ] ; then \
		rm -rf dvdroot ; \
	fi

@


1.4
log
@RgC
@
text
@d170 1
a170 1
dvdroot:
@


1.3
log
@R}hǉ
@
text
@a11 37
# $Log: makefile,v $
# Revision 1.2  2006/05/15 04:49:18  teruki
# R}hC
#
# Revision 1.1.1.1  2006/05/15 04:44:44  teruki
# initial import
#
#   
#   15    9/27/02 13:24 Shiki
#   Modified not to sort 'import.lst' manually as makerel now does that.
#   
#   14    8/23/02 17:44 Shiki
#   Modified to generate EXCLUDEFILES directive in REL_LCF_FILE.
#   
#   13    5/13/02 9:21 Shiki
#   Added __global_destructor_chain to the relocatable module's active list
#   just to make sure.
#   
#   12    11/27/01 9:25 Shiki
#   Modified to link global_destructor_chain.c from MSL.
#   
#   11    5/21/01 9:45a Shiki
#   Modified to evaluate static$(STRSUFFIX) target after setup.
#   
#   10    5/14/01 3:13p Shiki
#   Defined PREREL_LCF_FILE.
#   
#   9     01/05/09 15:48 Shiki
#   Revised.
#   
#   8     01/04/02 15:00 Shiki
#   Added an echo message for ignorable warnings.
#   
#   7     01/04/02 14:44 Shiki
#   Initial check-in.
# $NoKeywords: $
#
@


1.2
log
@R}hC
@
text
@d13 3
d215 17
@


1.1
log
@Initial revision
@
text
@d12 4
a15 1
# $Log: /Dolphin/build/demos/reldemo/makefile $
d204 1
a204 1
setup:
@


1.1.1.1
log
@initial import
@
text
@@
