############################################################################### # # call sub makefiles automatically # # Copyright 2010 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. # ############################################################################### MODULE_DEPTH := .. BUILD_MAKE_PATH := $(MODULE_DEPTH)/build/make include $(BUILD_MAKE_PATH)/commondefs.mk # Recognized targets called by meta-build .PHONY: default headers install clean clobber # Parallel build by default (make fast -> make default) include $(BUILD_MAKE_PATH)/target_fast.mk # Default target default: headers install ############################################################################### # # help # ############################################################################### .PHONY: help help: $(_@)echo "------------------------------------------------------------------" ; \ echo "Usage:" ; \ echo "" ; \ echo " To build" ; \ echo " make - build debug version"; \ echo " make NDEBUG=TRUE - build non-debug version"; \ echo " make default - build in serial (without parallel jobs) with compiler+linker output" ; \ echo " make clean - remove object and dependency files"; \ echo " make clobber - return to checkout state"; \ echo " export CAFE_MAKE_JOBS= - set maximum number of parallel jobs"; \ echo "" ; \ echo " To make subset" ; \ echo " make -j headers - pass 1 (export headers)" ; \ echo " make -j install - pass 2 (build everything internally)" ; \ echo " make -j install_ - install binaries for immediate subdirectory" ; \ ############################################################################### # # directories # ############################################################################### MAKE_DIRS := libsys \ def_malloc \ demo/shaders \ demo \ gfd \ gx2ut \ lcstream \ mtx \ pmcpu \ zipfile \ szfile ############################################################################### # # headers # ############################################################################### MAKE_HEADERS_DIRS_TARGET := $(addprefix headers_,$(MAKE_DIRS)) .PHONY: $(MAKE_HEADERS_DIRS_TARGET) $(MAKE_HEADERS_DIRS_TARGET): $(MAKE) -C $(subst headers_,,$@) headers headers: $(MAKE_HEADERS_DIRS_TARGET) ############################################################################### # # install # ############################################################################### MAKE_INSTALL_DIRS_TARGET := $(addprefix install_,$(MAKE_DIRS)) .PHONY: $(MAKE_INSTALL_DIRS_TARGET) $(MAKE_INSTALL_DIRS_TARGET): $(MAKE) -C $(subst install_,,$@) install install_audio: $(filter-out install_audio, $(MAKE_INSTALL_DIRS_TARGET)) install: $(MAKE_INSTALL_DIRS_TARGET) ############################################################################### # # clean # ############################################################################### MAKE_CLEAN_DIRS_TARGET := $(addprefix clean_,$(MAKE_DIRS)) .PHONY: $(MAKE_CLEAN_DIRS_TARGET) $(MAKE_CLEAN_DIRS_TARGET): $(_@)$(MAKE) -C $(subst clean_,,$@) clean clean: $(MAKE_CLEAN_DIRS_TARGET) ############################################################################### # # clobber # ############################################################################### MAKE_CLOBBER_DIRS_TARGET := $(addprefix clobber_,$(MAKE_DIRS)) .PHONY: $(MAKE_CLOBBER_DIRS_TARGET) $(MAKE_CLOBBER_DIRS_TARGET): $(_@)$(MAKE) -C $(subst clobber_,,$@) clobber clobber: $(MAKE_CLOBBER_DIRS_TARGET)