1#! make -f
2#---------------------------------------------------------------------------
3#  Project:  TwlSDK - tools - loadrun
4#  File:     Makefile
5#
6#  Copyright 2005-2008 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:: 2008-09-18#$
15#  $Rev: 8573 $
16#  $Author: okubata_ryoma $
17#---------------------------------------------------------------------------
18TARGET_PLATFORM		=	NITRO
19
20include	$(TWLSDK_ROOT)/build/buildtools/commondefs
21include	$(TWLSDK_ROOT)/build/buildtools/nitro/commondefs.emtype.IS
22
23ISD_ROOT	 = $(ISDBG_ROOT)
24
25SRCPATH		 = $(ISD_ROOT)/Samples/download/X86
26
27LINCLUDES	+= $(ISD_ROOT)/X86/include ./ $(ROOT)/include
28
29TARGETS		 = loadrun.exe
30
31SOURCES_CC	 = loadrun.c isd_api.c version.c
32HEADERS_CC	 = isd_api.h
33
34OBJECTS		 = loadrun.o isd_api.o version.o
35
36NITRORUN	 = nitrorun
37
38
39
40INSTALL_DIR     = $(TWL_INSTALL_TOOLSDIR)/bin
41INSTALL_TARGETS	= $(TARGETS) $(NITRORUN)
42
43LDIRT_CLEAN		= $(OBJECTS) $(TARGETS) version.c
44
45include	$(TWLSDK_ROOT)/build/buildtools/modulerules.x86
46
47LINCS		 = $(subst \ -I,\ ,$(addprefix -I,$(LINCLUDES)))
48WARNING		 = -Wall -Wno-unknown-pragmas -Wno-unused-variable
49MACROS		+= -DSDK_NITRO
50
51%.o:		%.c
52		$(CC_X86) $(MACROS) -DSDK_WIN32 $(WARNING) -c -I. $(LINCS) $< -o $@
53
54#----------------------------------------------------------------------------
55#  build
56#----------------------------------------------------------------------------
57do-build:	$(TARGETS)
58
59$(TARGETS):	$(OBJECTS)
60		$(CC_X86) $+ -o $@
61
62loadrun.o:	isd_api.h loadrun.c version.c
63isd_api.o:	isd_api.h isd_api.c
64
65version.c:	$(filter-out version.c,$(SOURCES_CC)) $(HEADERS_CC) $(MAKEFILE)
66		@for i in $^ ; do \
67			date -r $$i +'const unsigned long SDK_DATE_OF_LATEST_FILE=%Y%m%dUL;'; \
68		done | sort | tail -1 > $@
69