1#! make -f
2#----------------------------------------------------------------------------
3# Project:  TwlSDK
4# File:     Makefile
5#
6# Copyright 2007-2009 Nintendo.  All rights reserved.
7#
8# These coded instructions, statements, and computer programs contain
9# proprietary information of Nintendo of America Inc. and/or Nintendo
10# Company Ltd., and are protected by Federal copyright law. They may
11# not be disclosed to third parties or copied or duplicated in any form,
12# in whole or in part, without the prior written consent of Nintendo.
13#
14# $Date:: 2009-10-19#$
15# $Rev: 11099 $
16# $Author: mizutani_nakaba $
17#----------------------------------------------------------------------------
18
19SUBDIRS			 =
20SUBMAKES_P 		 = Makefile.CALLTRACE Makefile.FUNCTIONCOST
21
22#----------------------------------------------------------------------------
23override TARGET_PLATFORM = TWL
24
25TWL_CODEGEN		?= ALL
26TWL_PROC		 =ARM9
27
28# Create libraries for both HYBRID and LIMITED
29TWL_ARCHGEN		?= ALL
30
31SRCDIR			 = src ../common/src ../ARM9/src
32INCDIR			 = include ../common/include
33
34SRCS			 = os_irqHandler.c			\
35				   os_irqTable.c			\
36				   os_interrupt.c			\
37				   os_pxi.c					\
38				   os_spinLock.c			\
39				   os_printf.c				\
40				   os_thread.c				\
41				   os_context.c				\
42				   os_emulator.c			\
43				   os_message.c				\
44				   os_mutex.c				\
45				   os_cache.c				\
46				   os_init.c				\
47				   os_arena.c				\
48				   os_alloc.c				\
49				   os_tcm.c					\
50				   os_protectionUnit.c		\
51				   os_protectionRegion.c	\
52				   os_exception.c			\
53				   os_timer.c				\
54				   os_tick.c				\
55				   os_alarm.c				\
56				   os_valarm.c				\
57				   os_system.c				\
58				   os_systemWork.c			\
59				   os_profile.c				\
60				   os_reset.c				\
61				   os_ownerInfo.c			\
62				   os_ownerInfoEx.c			\
63				   os_vramExclusive.c		\
64				   os_china.c				\
65				   os_argument.c			\
66				   os_entropy.c				\
67				   os_terminate_proc.c		\
68				   os_event.c				\
69				   os_resource.c			\
70				   os_application_jump.c	\
71                   os_msJump.c				\
72				   os_stub.c				\
73
74ifeq ($(TWL_ARCHGEN),LIMITED)
75SRCS +=	    	   os_attention.c
76endif
77
78TARGET_LIB		 = libos$(TWL_LIBSUFFIX).a
79
80PC_DIR			 = ./pc_obj
81PC_OBJ			 = $(PC_DIR)/os_countryCode.o
82
83DATA_DIR		 = $(ROOT)/data/for_china
84DATA_OBJS		 = $(patsubst $(DATA_DIR)/%.bin,$(OBJDIR)/%.o,$(wildcard $(DATA_DIR)/*.bin))
85
86EXT_OBJS		+= $(DATA_OBJS) $(PC_OBJ)
87
88ifeq ($(TWL_ARCHGEN),LIMITED)
89LTD_DATA_DIR	 = $(ROOT)/data/attention_limited
90LTD_DATA_OBJS	 = $(patsubst $(LTD_DATA_DIR)/%.bin,$(OBJDIR)/%.o,$(wildcard $(LTD_DATA_DIR)/*.bin))
91EXT_OBJS		+= $(LTD_DATA_OBJS)
92endif
93
94#----------------------------------------------------------------------------
95include	$(TWLSDK_ROOT)/build/buildtools/commondefs
96
97
98INSTALL_TARGETS	 = $(TARGETS)
99
100INSTALL_DIR		 = $(TWL_INSTALL_LIBDIR)
101
102SUBMAKES_P		 += $(PRIVATE_LIBRARIES_OS_ARM9_TWL)
103
104#----------------------------------------------------------------------------
105do-build:	$(TARGETS)
106
107include	$(TWLSDK_ROOT)/build/buildtools/modulerules
108
109# Convert screen data directly to object
110$(OBJDIR)/%.o: $(DATA_DIR)/%.bin
111			$(BIN2OBJ) --compatible $(call empath,$<) $@ >/dev/null
112
113ifeq ($(TWL_ARCHGEN),LIMITED)
114$(OBJDIR)/%.o: $(LTD_DATA_DIR)/%.bin
115			$(BIN2OBJ) --compatible $(call empath,$<) $@ >/dev/null
116endif
117
118#===== End of Makefile =====
119