# rcsid $Id: Makefile,v 1.1 1995/08/31 00:56:25 smp Exp smp $

# makefile for irnamer

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

EXECS = irnamer irsample irdump irsend


H_SRC = \
	ir.hh

C_SRC = \
	irnamer.cc irsample.cc irdump.cc irsend.cc

C_OBJ = \
	irnamer.o irsample.o irdump.o irsend.o


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

it : irnamer irsample irdump irsend


# rc client to name the infrared controller buttons
irnamer : irnamer.o udgsocket.o keymap.o namedstr.o tokens.o
	$(CXX) $(LDFLAGS) -o irnamer $^

irnamer.o : irnamer.cc ir.hh rcserver.hh \
	    misc.hh udgsocket.hh keymap.hh namedstr.hh tokens.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<


# rc client to sample the infrared controller buttons
irsample : irsample.o udgsocket.o keymap.o namedstr.o tokens.o
	$(CXX) $(LDFLAGS) -o irsample $^ -lm

irsample.o : irsample.cc ir.hh rcserver.hh \
	    misc.hh udgsocket.hh keymap.hh namedstr.hh tokens.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<


# rc client to send the infrared controller buttons
irsend : irsend.o udgsocket.o keymap.o namedstr.o tokens.o
	$(CXX) $(LDFLAGS) -o irsend $^ -lm

irsend.o : irsend.cc ir.hh rcserver.hh \
	    misc.hh udgsocket.hh keymap.hh namedstr.hh tokens.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<


# rc client to dump the infrared controller buttons
irdump : irdump.o udgsocket.o keymap.o namedstr.o tokens.o
	$(CXX) $(LDFLAGS) -o irdump $^

irdump.o : irdump.cc ir.hh rcserver.hh \
	    misc.hh udgsocket.hh keymap.hh namedstr.hh tokens.hh
	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $(DEFINES) $<


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
