# Makefile for NSIM package
# Copyright 1995 Eric L. Smith
#
# NSIM is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License version 2 as published by the Free
# Software Foundation.  Note that I am not granting permission to redistribute
# or modify NSIM under the terms of any later version of the General Public
# License.
# 
# This program is distributed in the hope that it will be useful (or at
# least amusing), but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program (in the file "COPYING"); if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Header: /usr/home/kolwynia/eric/hpcalc/nsim/RCS/Makefile,v 1.6 1995/08/21 22:29:52 eric Exp eric $


# -----------------------------------------------------------------------------
# You may need to change the following definitions.  In particular you will
# need to remove the -DUSE_TIMER if you don't have the setitimer() system
# call, and you may need to chage X11LIBS and X11INCS if X isn't in /usr/X11.
# -----------------------------------------------------------------------------

CC = gcc
CFLAGS = -g -Dstricmp=strcasecmp -DUSE_TIMER -DAUTO_POWER_OFF -DWARNING_G

X11LIBS = -L/usr/X11/lib -lX11
X11INCS = -I/usr/X11/include


# -----------------------------------------------------------------------------
# You shouldn't have to change anything below this point, but if you do please
# let me know why so I can improve this Makefile.
# -----------------------------------------------------------------------------

VERSION = 0.5

PROGRAMS = nsim

HEADERS = nsim.h rom.h lcd.h phineas.h xio.h
SOURCES = nsim.c rom.c lcd.c phineas.c xio.c
MISC = COPYING README NEWS # CHANGELOG

NSIM_OBJECTS = nsim.o rom.o lcd.o phineas.o xio.o

OBJECTS = $(NSIM_OBJECTS)

SIM_LIBS = $(X11LIBS)

INTERMEDIATE = 

DISTFILES = $(MISC) Makefile $(HEADERS) $(SOURCES)
PACKAGE = nsim
DSTNAME = $(PACKAGE)-$(VERSION)

all: $(PROGRAMS) $(MISC_TARGETS)

nsim:	$(NSIM_OBJECTS)
	$(CC) -o $@ $(NSIM_OBJECTS) $(SIM_LIBS) 

nsim.o:	nsim.c nsim.h rom.h xio.h
	$(CC) -c $(CFLAGS) -o $@ $<

rom.o: rom.c nsim.h rom.h
	$(CC) -c $(CFLAGS) -o $@ $<

lcd.o: lcd.c nsim.h lcd.h
	$(CC) -c $(CFLAGS) -o $@ $<

phineas.o: phineas.c nsim.h phineas.h
	$(CC) -c $(CFLAGS) -o $@ $<

xio.o:	xio.c xio.h
	$(CC) -c $(CFLAGS) $(X11INCS) -o $@ $<

dist: $(DISTFILES)
	-rm -rf $(DSTNAME)
	mkdir $(DSTNAME)
	for f in $(DISTFILES); do ln $$f $(DSTNAME)/$$f; done
	tar --gzip -chf $(DSTNAME).tar.gz $(DSTNAME)
	-rm -rf $(DSTNAME)

clean:
	rm -f $(PROGRAMS) $(MISC_TARGETS) $(OBJECTS) $(INTERMEDIATE)
