# TrueReality - n64/Makefile
# Copyright (C) 1998 Niki W. Waibel
#
# This program is free software; you can redistribute it and/
# or modify it under the terms of the GNU General Public Li-
# cence as published by the Free Software Foundation; either
# version 2 of the Licence, or any later version.
#
# This program is distributed in the hope that it will be use-
# ful, but WITHOUT ANY WARRANTY; without even the implied war-
# ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public Licence for more details.
#
# You should have received a copy of the GNU General Public
# Licence along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
# USA.
#
# Information about me (the author):
#   Niki W. Waibel, Reichenau 20, 6890 Lustenau, Austria - EUROPE
#   niki.waibel@gmx.net





################################################################################
# You shouldn't change anything in this file unless you are a developer.       #
# Changes can be done in 'Makefile.tmpl'.                                      #





include ../Makefile.tmpl




OBJS      = cpu.o cop0.o cop1.o cop2.o dma.o interrupts.o memory.o controller.o
COMMON_H  = type_sizes.h ../config.h ../Makefile.tmpl




all: n64.a



n64.a: $(OBJS)
	$(RM) $@
	$(AR) $@ $(OBJS)
	$(RANLIB) $@



cpu.o: cpu.c cpu.h cop0.h cop1.h cop2.h ../dispatch.h interrupts.h exceptions.h registers.h mnemonic.h memory.h $(COMMON_H)
	$(CC) $(CFLAGS) $(COPT) $(CINCL) $(DEFINES) -o cpu.o -c cpu.c



cop0.o: cop0.c cop0.h cpu.h registers.h mnemonic.h $(COMMON_H)
	$(CC) $(CFLAGS) $(COPT) $(CINCL) $(DEFINES) -o cop0.o -c cop0.c



cop1.o: cop1.c cop1.h cpu.h registers.h mnemonic.h $(COMMON_H)
	$(CC) $(CFLAGS) $(COPT) $(CINCL) $(DEFINES) -o cop1.o -c cop1.c



cop2.o: cop2.c cop2.h cpu.h registers.h mnemonic.h $(COMMON_H)
	$(CC) $(CFLAGS) $(COPT) $(CINCL) $(DEFINES) -o cop2.o -c cop2.c



dma.o: dma.c dma.h memory.h $(COMMON_H)
	$(CC) $(CFLAGS) $(COPT) $(CINCL) $(DEFINES) -o dma.o -c dma.c



controller.o: controller.c controller.h memory.h $(COMMON_H)
	$(CC) $(CFLAGS) $(COPT) $(CINCL) $(DEFINES) -o controller.o -c controller.c



interrupts.o: interrupts.c interrupts.h exceptions.h registers.h memory.h cpu.h $(COMMON_H)
	$(CC) $(CFLAGS) $(COPT) $(CINCL) $(DEFINES) -o interrupts.o -c interrupts.c



memory.o: memory.c memory.h registers.h interrupts.h exceptions.h cpu.h $(COMMON_H)
	$(CC) $(CFLAGS) $(COPT) $(CINCL) $(DEFINES) -o memory.o -c memory.c



clean:
	$(RM) -f out
	$(RM) -f tmp
	$(RM) -f txt
	$(RM) -f *.o
	$(RM) -f *.a
	$(RM) -f *.diff

