#
# Cluster Information Service - makefile
#

DAEMONS = cisd procmon sockmon netmon
TOOLS = cis_rec cis_print cis_cut cis_merge

CC =  gcc

#CFLAGS = -O -g -DDEBUG -D_GNU_SOURCE -Wall
#CFLAGS = -O0 -g -DDEBUG -D_GNU_SOURCE -Wall
CFLAGS = -O -D_GNU_SOURCE

VERSION=0.9.2

all:
	
	@ $(MAKE) -C src 'CFLAGS=$(CFLAGS)'
	@ echo Copying $(DAEMONS) to bin directory.
	@ cd src ; cp $(DAEMONS) ../bin
	@ echo Copying libCis.a to lib directory.
	@ cd src ; cp libCis.a ../lib
	@ $(MAKE) -C tools 'CFLAGS=$(CFLAGS)'
	cd tools ; cp $(TOOLS) ../bin

clean: 
	$(MAKE) -C tools clean
	$(MAKE) -C src clean
	cd bin ; rm -f $(DAEMONS) $(TOOLS)
	cd lib ; rm -f libCis.a
        
install:
	cd bin ; cp -vf $(DAEMONS) /usr/sbin
	$(MAKE) -C tools install

# dependencies

cis*.o *mon.o: cis.h cis_srv.h cis_xdr.h
cis_clnt.o: cis_clnt.h
