# rcsid $Id: Makefile,v 1.1 1996/05/06 22:25:16 smp Exp smp $

# makefile for x10 server daemon

CXXFLAGS = -g -DX10D2

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

EXECS = x10d2


H_SRC = \
	x10d.hh \
	x10daemon.hh \
	x10action.hh \
	x10status.hh \
	x10interface.hh \
	serplixinterface.hh \
	lynxinterface.hh


C_SRC = \
	x10d.cc \
	x10daemon.cc \
	x10action.cc \
	x10status.cc \
	x10interface.cc \
	serplixinterface.cc \
	lynxinterface.cc


C_OBJ = \
	x10d.o \
	x10daemon.o \
	x10action.o \
	x10status.o \
	x10interface.o \
	serplixinterface.o

## 	lynxinterface.o


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


it: x10d2


# 
x10d2 : $(C_OBJ) \
	udgsocket.o keymap.o namedstr.o tokens.o voicedaemon.o \
	connection.o message.o system.o
	$(CXX) $(LDFLAGS) -o x10d2 $^

x10d.o : x10d.cc x10d.hh x10daemon.hh \
	 serplixinterface.hh x10interface.hh \
	 misc.hh namedstr.hh rcserver.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<

x10daemon.o : x10daemon.cc x10daemon.hh \
	      x10d.hh x10action.hh \
	      rcserver.hh message.hh voicedaemon.hh \
	      serplixinterface.hh x10interface.hh x10status.hh \
	      misc.hh namedstr.hh keymap.hh udgsocket.hh tokens.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<

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

x10status.o : x10status.cc x10status.hh x10d.hh x10interface.hh \
	      misc.hh udgsocket.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<

x10interface.o : x10interface.cc x10interface.hh \
		 misc.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<

serplixinterface.o : serplixinterface.cc serplixinterface.hh x10interface.hh \
		     misc.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<

#
# things in daemon
#
connection.o :
	cd $(SRVR_DIR);$(MAKE) connection.o

voicedaemon.o :
	cd $(SRVR_DIR);$(MAKE) voicedaemon.o


#
# things in util/misc
#
udgsocket.o :
	cd $(UTIL_DIR)/misc;$(MAKE) udgsocket.o

keymap.o :
	cd $(UTIL_DIR)/misc;$(MAKE) keymap.o

namedstr.o :
	cd $(UTIL_DIR)/misc;$(MAKE) namedstr.o

tokens.o :
	cd $(UTIL_DIR)/misc;$(MAKE) tokens.o


.PHONY : install
install: $(EXECS)
	cp $(EXECS) $(BIN_DIR)

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

.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
