# Global Makefile for xbbs v1.0
#
# v1.0 stands for the Linux version of xbbs, not the original Xenix version
# which is 7.200

# change the line below, if you wish to install the bbs somewhere else.

INSTALL=/usr/xbbs

SUBDIRS	= xbbs xbbs/chatbbs xbbs/listuser xbbs/allign xbbs/msgpack \
	  xbbs/purguser xbbs/sealink xbbs/xbbsgen # xbbs/today

CC	= gcc
CFLAGS	= -c -DSYSV -O

LD	= gcc
LDFLAGS	= -O -o
O	= .o

all:	subdirs

subdirs:	
	for i in $(SUBDIRS); do (cd $$i; $(MAKE)); done
	strip bbsc1 chatbbs listuser listusers allign fallign msgpack \
	      purguser sealink xbbsgen crc checksum ymod # potm today

clean:	
	for i in $(SUBDIRS); do (cd $$i; $(MAKE) clean); done

dep:	
	for i in $(SUBDIRS); do (cd $$i; $(MAKE) dep); done

install:	all
	@echo
	@echo Installing xbbs in $(INSTALL) ...
	@-mkdir $(INSTALL)
	@cd xbbs;cp -r bull* *.bbs question.ans question.qst home fls    \
	 info_files msgs logging usenet $(INSTALL)
	@cp allign bbsc1 chatbbs checksum crc fallign listuser listusers \
	 msgpack purguser sealink xbbsgen ymod $(INSTALL)
	chown --recursive bbs.bbs $(INSTALL)
	chmod 700 $(INSTALL)
	chmod u+s $(INSTALL)/chatbbs
	@echo
	@echo Please check/modify $(INSTALL)/home/.config.bbs for correct
	@echo pathnames and replace Sysop Name with that of your name.
	@echo
	@echo Also check the paths in $(INSTALL)/home/.profile to reflect
	@echo those of your system.
	@echo
	@echo If you have installed xbbs in a directory other than /usr/xbbs,
	@echo you will need to run 'xbbsgen'
	@echo
	@echo Installation completed.
	@echo
