1#! make -f 2#--------------------------------------------------------------------------- 3# Project: TwlSDK - tools - showversion 4# File: Makefile 5# 6# Copyright 2003-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#--------------------------------------------------------------------------- 18 19TARGET_PLATFORM = NITRO 20 21include $(TWLSDK_ROOT)/build/buildtools/commondefs 22 23TARGETS = showversion.exe 24SOURCES = main.c \ 25 version.c 26 27OBJECTS = $(SOURCES:.c=.o) 28HEADERS = $(filter-out version.h,$(wildcard *.h)) 29 30MACROS += 31 32INSTALL_DIR = $(TWL_INSTALL_TOOLSDIR)/bin 33INSTALL_TARGETS = $(TARGETS) 34 35LDIRT_CLEAN = $(OBJECTS) $(TARGETS) version.c 36 37include $(TWLSDK_ROOT)/build/buildtools/modulerules.x86 38 39#---------------------------------------------------------------------------- 40# build 41#---------------------------------------------------------------------------- 42do-build: $(TARGETS) 43 44$(TARGETS): $(OBJECTS) 45 $(CC_X86) $+ -o $@ 46 47main.o: main.c version.c 48 49version.c: $(filter-out version.c,$(SOURCES)) $(HEADERS) $(MAKEFILE) 50 @for i in $^ ; \ 51 do \ 52 date -r $$i +'const unsigned long SDK_DATE_OF_LATEST_FILE=%Y%m%dUL;'; \ 53 done | sort | tail -1 > $@ 54# 55