# Makefile for disasm (a MIPS disassembler)
#
# Copyright (C) 1995-1996 Kai Harrekilde-Petersen, khp@dolphinics.no
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#

CC = gcc
CFLAGS = -g -Wall -Wstrict-prototypes

SRCS = disasm.c insns.c
OBJS = $(SRCS:.c=.o)

.PHONY:	default all clean

default: disasm

all: disasm

disasm: .depend $(OBJS)
	$(CC) $(CFLAGS) -o $@ $(OBJS)

.depend: $(SRCS)
	$(CC) -M $(SRCS) > .tmpdepend || rm -f .tmpdepend
	mv .tmpdepend .depend

clean:
	-rm -f *.o *~ core disasm .depend

#
# include dependency file if it exist
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
