# Makefile for Services


include ../Makefile.inc


########################## Configuration section ##########################


# Compilation options:
#	-DSKELETON	Compile a "skeleton" version of Services, with only
#			    OperServ enabled
#
#       -DBAHAMUT       Compile services with the Bahamut ts3 support
#
#
# If you change this value, REMEMBER to "make clean", or you may
# (read: will) come out with a confused executable!

CDEFS = 


######################## End configuration section ########################


CFLAGS = $(CDEFS) $(EXTRA_CFLAGS) -Wall -g


OBJS =	actions.o auspice.o channels.o chanserv.o compat.o conf.o datafiles.o \
	helpserv.o list.o log.o main.o memory.o memoserv.o messages.o \
	misc.o nickserv.o operserv.o process.o rootserv.o send.o sockutil.o \
	timeout.o users.o botserv.o adminserv.o auth.o webserv.o  hostserv.o \
	jarady.o massserv.o email.o

SRCS =	actions.c auspice.c channels.c chanserv.c compat.c conf.c datafiles.c \
	helpserv.c list.c log.c main.c memory.c memoserv.c messages.c \
	misc.c nickserv.c operserv.c process.c rootserv.c send.c sockutil.c \
	timeout.c users.c botserv.c adminserv.c auth.c webserv.c hostserv.c \
	jarady.c massserv.c email.c

all: services

clean:
	/bin/rm -f *.o services ../bin/services ../bin/listnicks ../bin/listmemos ../bin/listchans ../Makefile.inc

spotless: clean
	/bin/rm -f config.cache configure.log ../Makefile.inc ../inc/sysconf.h
install: all
	$(INSTALL) services $(BINDEST)/services
	rm  -f $(BINDEST)/listnicks $(BINDEST)/listchans $(BINDEST)/listmemos
	ln $(BINDEST)/services $(BINDEST)/listnicks
	ln $(BINDEST)/services $(BINDEST)/listchans
	ln $(BINDEST)/services $(BINDEST)/listmemos
	chmod 775 $(BINDEST)/listmemos

########

services: version.h $(OBJS)
	$(CC) $(LFLAGS) $(LIBS) $(OBJS) -o $@


.c.o:
	$(CC) $(CFLAGS) -c $<

actions.o:	actions.c	../inc/services.h
auspice.o:      auspice.c       ../inc/services.h  ../inc/timeout.h
channels.o:	channels.c	../inc/services.h
chanserv.o:	chanserv.c	../inc/services.h ../inc/timeout.h
compat.o:	compat.c	../inc/services.h
conf.o:         conf.c          ../inc/services.h
datafiles.o:	datafiles.c	../inc/services.h
helpserv.o:	helpserv.c	../inc/services.h
list.o:		list.c		../inc/services.h
log.o:          log.c           ../inc/services.h
main.o:		main.c		../inc/services.h ../inc/timeout.h
memory.o:	memory.c	../inc/services.h
memoserv.o:	memoserv.c	../inc/services.h
messages.o:	messages.c	../inc/messages.h
misc.o:		misc.c		../inc/services.h
nickserv.o:	nickserv.c	../inc/services.h ../inc/timeout.h
operserv.o:	operserv.c	../inc/services.h
process.o:	process.c	../inc/services.h ../inc/messages.h version.h
rootserv.o:     rootserv.c      ../inc/services.h
send.o:		send.c		../inc/services.h
sockutil.o:	sockutil.c	../inc/services.h
timeout.o:	timeout.c	../inc/services.h ../inc/timeout.h
users.o:	users.c		../inc/services.h
botserv.o:	botserv.c	../inc/services.h ../inc/auspice.h
adminserv.o:	adminserv.c	../inc/services.h ../inc/auspice.h
auth.o:		auth.c		../inc/services.h ../inc/auspice.h
webserv.o:	webserv.c	../inc/services.h
hostserv.o:	hostserv.c	../inc/services.h
jarady.o:	jarady.c	../inc/services.h
massserv.o:	massserv.c	../inc/services.h
email.o:	email.c		../inc/services.h

services.h: ../inc/config.h ../inc/extern.h
	touch $@

config.h: ../inc/sysconf.h
	touch $@

version.h: ../inc/services.h $(SRCS)
	sh version.sh
