# Copyleft 2008 Antonio Maschio <tbin at libero dot it>
#
# This is deer, the Dartmouth Environment Emulation Renderer, a (very naive) 
# attempt to implement the original dartmouth college time-sharing 
# system and the BASIC language as conceived by Kemeny & Kurz in 1964,
# in its 1966 version (why 1966? I was born in 1966).
#
# 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, 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. If not, see <http://www.gnu.org/licenses/>.
#

# Customize here
INSTALLDIR=/usr/local/bin
#INSTALLDIR=/opt/local/bin
#INSTALLDIR=~/bin
MANINSTALLDIR=/usr/local/share/man/man1/
# End of customizable items

#--------------------------------------------------
# Default objects
CC=gcc
CFLAGS=-Wall 
LIBS=-lm
TARGET=dib
SOURCES=dib.c
MANPAGE=dib.1

#--------------------------------------------------
# Compile targets (must be run into dib sources dir)
default: dib

all:	 dib

dib: 	$(SOURCES)
	$(CC) $(CFLAGS) -o $(TARGET) $(LIBS) $(SOURCES)

clean:
	rm -f $(TARGET) *.o

# Uninstall/Install targets (must be run into dib sources dir; 
# must be run by root or sudoer if destination is not under user privileges)
uninstall:
	rm -f $(TARGET) *.o
	rm -f $(INSTALLDIR)/$(TARGET)
	rm -f $(INSTALLDIR)/deer
	rm -f $(MANINSTALLDIR)/$(MANPAGE)

install:
	cp -f $(TARGET) $(INSTALLDIR)
	cp -f deer $(INSTALLDIR)
	cp $(MANPAGE) $(MANINSTALLDIR)
