#################################################################################
#       Shaft BBS
#       This BBS is an experiment..
#   This file is copyright 1996 by Matt Gischer (matt@fidalgo.net)..
#   It is freely distributable for personal uses, but if you are employing
#   it for other things, you must first ask me.  I guess other than that,
#   you should follow the GNU Public License.  Thanks.  If you make any
#   changes/fixes, please mail them to me.
################################################################################
CC=gcc -s -O3 -m486
RM=rm -f
CP=cp
LN=ln -sf
BASEDIR=/home/shaft
BINDIR=$(BASEDIR)/bin
CHMOD=chmod
VERSION=0.4.0

BINARIES=shaft setup uedit
OBJECTS=shaft.o userfile.o parse.o util.o info.o file.o menu.o msg.o page.o spawn.o
DISTSTUFF=$(BASEDIR)/src $(BASEDIR)/menu

all: $(BINARIES)

shaft: $(OBJECTS)
	$(CC) $(OBJECTS) -o shaft
	$(CHMOD) a+s shaft

setup: setup.o

uedit: uedit.o parse.o util.o info.o msg.o spawn.o

clean: 
	$(RM) *.c~ *.h~ *.o $(BINARIES)

install: 
	cd $(BASEDIR)
	mkdir $(BASEDIR)/data
	touch $(BASEDIR)/users.bbs
	touch $(BASEDIR)/config.bbs
	cp $(BASEDIR)/src/$(BINARIES) $(BASEDIR)
	$(BASEDIR)/src/setup

dist:
	$(RM) *.c~ *.h~ shaft*.tgz shaft.zip
	tar cfz /tmp/shaft-$(VERSION).tgz $(DISTSTUFF)
	$(CP) /tmp/shaft-$(VERSION).tgz /home/ftp/pub
	$(LN) /home/ftp/pub/shaft-$(VERSION).tgz /home/ftp/pub/shaft.tgz
	$(CP) README /home/ftp/pub

amtext.c: shaft.h
info.c: shaft.h
file.c: shaft.h
menu.c: shaft.h
msg.c: shaft.h msg.h
page.c:
parse.c: shaft.h
setup.c: shaft.h
shaft.c: shaft.h
spawn.c: shaft.h spawn.h
uedit.c: shaft.h
userfile.c: shaft.h
util.c: shaft.h

amtext.o: amtext.c
file.o: file.c
info.o: info.c
menu.o: menu.c
msg.o: msg.c
page.o: page.c
parse.o: parse.c
setup.o: setup.c
shaft.o: shaft.c
spawn.o: spawn.c
uedit.o: uedit.c
userfile.o: userfile.c
util.o: util.c
