Makefile 1.7 KB
include locdefs

default all:
	echo Nothing to do for '$@'

DEVKIT=$(ROOT)/opt/devkit
DEVKIT_U=$(DEVKIT)/per_user
BBTREE=../../bbplayer
DEVROOT=../../devroot/linux

install install_devkit:
	test "" != "$(ROOT)"
	make -C $(BBTREE) headers
	make -C $(BBTREE) exports
	make -C $(BBTREE) default
	make -C ../n64kit install
	make -C ../N64SoundTools install
	-rm -rf $(DEVKIT)
	mkdir -p $(DEVKIT)
	test "" != "$(DEVROOT)"
	make -C $(DEVROOT) install_devkit DEVKIT=$(DEVKIT)
	# extract files from $ROOT
	mkdir -p $(DEVKIT_U)/PR
	cp $(ROOT)/PR/PRdefs $(DEVKIT_U)/PR
	cp $(ROOT)/PR/BBdefs $(DEVKIT_U)/PR
	mkdir -p $(DEVKIT_U)/usr/include
	mkdir -p $(DEVKIT_U)/usr/lib
	mkdir -p $(DEVKIT_U)/usr/sbin
	(cd $(ROOT)/usr/include; tar cf - --exclude CVS . ) | (cd $(DEVKIT_U)/usr/include; tar xf -)
	(cd export_headers; tar cf - --exclude CVS . ) | (cd $(DEVKIT_U)/usr/include; tar xf -)
	(cd $(ROOT)/usr/sbin; tar cf - . ) | (cd $(DEVKIT_U)/usr/sbin; tar xf -)
	(cd $(ROOT)/usr/lib; tar cf - . ) | (cd $(DEVKIT_U)/usr/lib; tar xf -)
	# remove headers, binaries and libs not intended for export
	cat rmlist | (cd $(DEVKIT_U); xargs rm -f)
	# add links to export versions of headers
	(cd $(DEVKIT_U)/usr/include/PR; \
		ln -sf bbfs_export.h bbfs.h; \
		ln -sf bbskapi_export.h bbskapi.h; \
		ln -sf os_bbexec_export.h os_bbexec.h; \
		ln -sf os_bbfs_export.h os_bbfs.h; \
		ln -sf os_bb_export.h os_bb.h)
	cp install.sh $(DEVKIT)
	cp index.html $(DEVKIT)
	mkdir -p $(DEVKIT)/doc
	cp doc/gdb.html $(DEVKIT)/doc
	cp doc/auxdata.html $(DEVKIT)/doc
	cat Nintendo/allman52.tgz | (cd $(DEVKIT)/doc; tar xzf -)
	(cd doc; tar cf - --exclude CVS . ) | (cd $(DEVKIT)/doc; tar xf -)

clean clobber:
	test "" != "$(ROOT)"
	-rm -rf $(DEVKIT)
	make -C $(BBTREE) clobber