EXENAME = slforum
DEBUGLIBS =
LIBS = $(DEBUGLIBS)
CC=gcc
CCC=g++

CFLAGS =  -funsigned-char  
CPPFLAGS = -O2 -g -Wall -Wpointer-arith -Wwrite-strings -funsigned-char  

# uncomment the following line for shadow password support.
# CFLAGS += -DUSE_SHADOW

O_FILES = slforummain.o passwd.o slforumuser.o slforumroom.o slforumcmd.o slforumutil.o linkedlist.o authlocal.o

H_FILES = slfprefs.h slforum.h slforumuser.h slforumroom.h slforumcmd.h

all : slforum virtdb

install:	all
	install -m 555 -o root slforum /usr/local/sbin/slforumd
	install -m 555 -o root virtdb /usr/local/sbin/slforum_virtdb

testrun: all
	./slforum --nofork

strip :
	@ls -l $(EXENAME)
	strip $(EXENAME)
	@ls -l $(EXENAME)

passwd.o: slfprefs.h passwd-pam-inc.c passwd-unix-inc.c passwd-db-inc.c

slforumutil.o: slforumutil.h

slforumuser.o: $(H_FILES) slforumuser-adminsubstate.inc.cc

slforumroom.o: $(H_FILES)

slforummain.o: $(H_FILES)

slforumcmd.o: $(H_FILES) response-8ball.h


clean :
	rm -f *.o

realclean : clean
	rm -f $(EXENAME) virtdb *~ Makefile

slforum : $(O_FILES)
	g++ -o $(EXENAME) $(O_FILES) $(LIBS)
	chmod a-w $(EXENAME)

virtdb : virtdb.o
	gcc -o virtdb virtdb.o $(LIBS)
	chmod a-w virtdb

tart: ../slf-devel.tar.gz

../slf-devel.tar.gz:	*.c *.cc *.h Makefile-*
	tar cfp - *.c *.cc *.h Makefile-* | gzip > ../slf-devel.tar.gz


findprintf:
	grep -n '[^A-Z^a-z]printf' *.cc *.[ch]

