#=======================================================================#
#		NIFFprev						#
#		Makefile.win						#
#									#
#		Copyright (C) 1997, NINTENDO Co,Ltd.			#
#		Copyright (C) 1998, MONEGI CORPORATION.			#
#									#
#-----------------------------------------------------------------------# 
#

# Directory in which an include file and a library of NuSYSTEM exist.
#
N64KITDIR    = c:\nintendo\n64kit
NUSYSINCDIR  = ..\include
NUSYSLIBDIR  = ..\lib
GLIBINCDIR  = ..\include
GLIBDIR  = ..\lib

N64GCC_PATH =	$(ROOT)\gcc\mipse
N64GCC_BIN =	$(N64GCC_PATH)\bin
N64GCC_INC =	$(ROOT)\usr\include
CC =		$(N64GCC_BIN)\gcc
AS =		$(N64GCC_BIN)\as
LD =		$(N64GCC_BIN)\ld
MAKEROM =	mild

# GBI setting. When F3DEX2 is used, it will be F3DEX_GBI_2
GBI =		F3DEX_GBI_2

APP =		nvfview.out

.c.o:
		$(CC) -g -G 0 -c $(CC_INC) $(CC_DEF) $<

OPTIMIZER =	-g

TARGET =	nvfview.N64

CODEFILES   =	main.c defscene.c object.c \
		menu.c mode.c \
		rootmenu.c cameramenu.c objectmenu.c iconmenu.c \
		bgcolormenu.c fogmenu.c animmenu.c videomenu.c \
		viewerinfo.c

DATAOBJECTS =	$(CODEFILES:.c=.o)
CODEOBJECTS =	$(DATAOBJECTS) $(NUSYSLIBDIR)\nusys.o

CODESEGMENT =	codesegment.o

OBJECTS =	$(CODESEGMENT) $(CODEOBJECTS)

CP =		copy

CC_INC =	-I. -I$(N64GCC_INC)\pr -I$(N64GCC_INC) -I$(NUSYSINCDIR) -I$(GLIBINCDIR)
CC_DEF =	-D$(GBI) -D_WIN32 -D_LANGUAGE_C -D_MIPS_SZLONG=32 -D_MIPS_SZINT=32 -D__ISV__ -Wstrict-prototypes

LDFLAGS =	$(MKDEPOPT) -L$(ROOT)/usr/lib -L$(GLIBDIR) -lmgi -lmsn -lmhc -lmrn -lmif -lmis -lmvm -lmso -L$(NUSYSLIBDIR) -lnusys -lgultra_rom -L$(N64GCC_PATH)/lib -lkmc

default:	$(TARGET)

$(CODESEGMENT):	$(CODEOBJECTS)
	$(LD) -o $(CODESEGMENT) -r $(CODEOBJECTS) $(LDFLAGS)

$(TARGET): spec $(OBJECTS)
	$(MAKEROM) -D$(GBI) -s 9 spec -r $(TARGET) -I$(NUSYSINCDIR) -e $(APP)
	$(CP) $(TARGET) ..\$(TARGET)
