include $(ROOT)/usr/include/make/commondefs

default install clean clobber runtests:

#
# List of headers to fetch: rsync.hdrs
# Fetch headers from [download path]/usr/include
#
# List of libraries to fetch: rsync.libs
# Fetch libraries from [download path]/usr/lib/rvl
#
# List of binaries to fetch: rsync.bins
# Fetch binaries from [download path]/usr/bin/rvl
#
# List of other stuff to fetch: rsync.misc
# Fetch from [download path]/usr
#
# Note: No spaces after file names in the rsync list file!
#

#
# Specify the source for the imported files.  The default
# is to use the results of the hourly NC build on filestore.
#
# To import from your local NC workarea, for example, set
#
#   SCBUILD = /home/user/NC_ROOT
#
ifeq ($(RVL_MEM), 128)
SCBUILD=scbuild@filestore.routefree.com::build/NC/latest
NCLBUILD=scbuild@filestore.routefree.com::build/Nintendo/latest/rvl-128
else
ifeq ($(RVL_MEM), 64)
SCBUILD=scbuild@filestore.routefree.com::build/NC/latest/rvl_64
NCLBUILD=scbuild@filestore.routefree.com::build/Nintendo/latest/rvl-64
endif
endif

ifdef SCBUILD_OVERRIDE
SCBUILD=$(SCBUILD_OVERRIDE)
endif

default:

headers:
	chmod 440 rsync.pw
	rsync -avz --password-file=rsync.pw --files-from=rsync.hdrs $(SCBUILD)/usr/include/ $(ROOT)/usr/include

exports:
	chmod 440 rsync.pw
	rsync -avz --password-file=rsync.pw --files-from=rsync.libs $(SCBUILD)/usr/lib/rvl $(ROOT)/usr/lib/rvl
	rsync -avz --password-file=rsync.pw --files-from=rsync.bins $(SCBUILD)/usr/bin/rvl $(ROOT)/usr/bin/rvl
	rsync -avz --password-file=rsync.pw --files-from=rsync.misc $(SCBUILD)/usr $(ROOT)/usr
	rsync -avz --password-file=rsync.pw --files-from=rsync.ncl $(NCLBUILD)/ $(ROOT)/usr/bin/rvl
ifneq ($(CYGWIN_BUILD), )
ifeq ($(RVL_MEM), 128)
	rsync -avz --password-file=rsync.pw --files-from=rsync.cygwin $(SCBUILD)/../../NC_cygwin/latest/usr $(ROOT)/usr
else
ifeq ($(RVL_MEM), 64)
	rsync -avz --password-file=rsync.pw --files-from=rsync.cygwin $(SCBUILD)/../../../NC_cygwin/latest/usr $(ROOT)/usr
endif
endif
else # linux
	rsync -avz --password-file=rsync.pw --files-from=rsync.linux $(SCBUILD)/usr $(ROOT)/usr
endif
	cd $(ROOT)/usr/bin/rvl; mv fs_apitest.elf fs_coproc.elf fs_perf.elf fs_regr.elf fs_stress.elf fs_overwrite.elf es_apitest.elf es_ck2test.elf es_swupdate.elf ownerstest.elf versiontest.elf cryptotest.elf memcheckestest.elf tests
