# rcsid $Id: Makefile,v 1.3 1996/03/03 03:55:02 smp Exp smp $

# makefile for common daemon code

CXXFLAGS = -g

include ../rc.mk
PACKAGE = daemon
DIR = daemon

EXECS =

H_SRC = \
	connection.hh \
	action.hh \
	message.hh \
	system.hh \
	voicedaemon.hh \
	rcserver.hh \
	rcdaemon.hh \
	rcclient.hh

C_SRC = \
	connection.cc \
	message.cc \
	system.cc \
	voicedaemon.cc \
	rcdaemon.cc \
	rcclient.cc

C_OBJ = \
	connection.o \
	message.o \
	system.o \
	voicedaemon.o \
	rcdaemon.o \
	rcclient.o


VPATH = $(UTIL_DIR)/misc:$(SRVR_DIR)


it : $(C_OBJ)


connection.o : connection.cc connection.hh misc.hh udgsocket.hh tokens.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<

message.o : message.cc message.hh misc.hh tokens.hh connection.hh action.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<

system.o : system.cc system.hh misc.hh tokens.hh connection.hh action.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<

voicedaemon.o : voicedaemon.cc voicedaemon.hh misc.hh namedstr.hh keymap.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<

rcdaemon.o : rcdaemon.cc rcdaemon.hh misc.hh namedstr.hh keymap.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<

rcclient.o : rcclient.cc rcclient.hh misc.hh namedstr.hh keymap.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<


.PHONY : install
install: 
ifneq	"$(EXECS)" ""
	cp $(EXECS) $(BIN_DIR)
else
	@echo nothing to install
endif

.PHONY : clean
clean :
	rm -f $(C_OBJ)
ifneq	"$(EXECS)" ""
	rm -f $(EXECS)
endif

.PHONY : ci
ci : Makefile $(H_SRC) $(C_SRC)
	ci -l Makefile $(H_SRC) $(C_SRC)

.PHONY : list
list :
	@echo $(PPATH)$(PACKAGE)/Makefile
ifneq	"$(H_SRC)" ""
	@$(foreach f,$(notdir $(H_SRC)),echo $(PPATH)$(PACKAGE)/$(f);)
endif
ifneq	"$(C_SRC)" ""
	@$(foreach f,$(notdir $(C_SRC)),echo $(PPATH)$(PACKAGE)/$(f);)
endif
