#! make -f #--------------------------------------------------------------------------- # Project: RevolutionSDK Extensions - tools - bmerge # File: Makefile # # Copyright 2006,2007 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. # # $Log: Makefile,v $ # Revision 1.3 2007/06/14 01:28:23 adachi_hiroaki # Added support for "require"; reintegrated with chanscc.exe # # Revision 1.2 2007/06/14 00:56:26 adachi_hiroaki # Added support for the code as of 6/12 # # Revision 1.1 2007/06/08 09:28:10 adachi_hiroaki # Added a build system for compiling NWC24 scripts. # (VisualStudio is required, so builds are not performed automatically. The source also refers to the main tree.) # # $NoKeywords: $ #--------------------------------------------------------------------------- .PHONY: all build install clobber clean all: build #install CC = cl LD = cl IPL_ROOT = $(subst \,/,$(RVL_IPL_ROOT)) TARGET = chanscc HEADERS = MAKEFILE = $(firstword $(MAKEFILELIST)) LDIRT_CLEAN = $(OBJECTS) $(TARGETS) LINCLUDES = -I$(IPL_ROOT)/ChannelScript/common -I$(IPL_ROOT)/ChannelScript/compiler LCFLAGS = -D__STDC__ -RTCs -DCHANS_SUPPORT_FLOAT CHANS_ROOT = $(IPL_ROOT)/ChannelScript vpath %.c $(CHANS_ROOT)/common vpath % $(CHANS_ROOT)/compiler REVOLUTION_EXT_INSTALL_ROOT ?= $(REVOLUTION_EXT_ROOT) INSTALL_DIR := $(shell cygpath -u $(REVOLUTION_EXT_INSTALL_ROOT))/X86/bin/NWC24 #---------------------------------------------------------------------------- # build #---------------------------------------------------------------------------- build: $(TARGET) $(TARGET): vm.obj chanscc.obj $(LD) -Fe$(@) $(?) vm.obj: $(CHANS_ROOT)/common/vm.c $(CC) -c $(LINCLUDES) $(LCFLAGS) $(<) -Fo$(@) chanscc.obj: chanscc.c yacc.y: $(CHANS_ROOT)/compiler/yacc.y install $(<) $(@) chanscc.c: yacc.y bison $(<) -o $(@) %.obj: %.c $(CC) -c $(LINCLUDES) $(LCFLAGS) $(<) -Fo$(@) clean: rm -f *.obj *.exe *.c *.y clobber: clean rm -f $(INSTALL_DIR)/X86/bin/$(TARGET) install: build install -Dp $(TARGET) $(INSTALL_DIR) install -Dp $(CHANS_ROOT)/compiler/chanscc.kwh $(INSTALL_DIR) install -Dp $(CHANS_ROOT)/compiler/chansccNF.kwh $(INSTALL_DIR)