#
#  Makefile.in for xcin
#

include ../config.status 
include ../install.status


EXTRA_DEFINES = @EXTRA_DEFINES@
EXTRA_LIBS    = @EXTRA_LIBS@


SRC1  =	xi.c inp.c intcode.c ser_dispatch.c
SRC2  = cli_xcin.c
SRC3  = cin2tab.c

OBJS1 = xi.o inp.o intcode.o ser_dispatch.o
OBJS2 = cli_xcin.o
OBJS3 = cin2tab.o

INCS  = pho.h protocol.h state.h xi.h

PROGS = xcin cin2tab

Auto_First = 1

all: @MAKEALL@

.c.o:
	$(CC) -c -o $*.o $(CFLAGS) $(INC_PATH) $(DEFS) $(EXTRA_DEFINES) $<


xcin: $(OBJS1) $(OBJS2)
	$(CC) -o $@ $(OBJS1) $(OBJS2) $(LIB_PATH) $(LIBS) $(EXTRA_LIBS)

#
#  Cin2Tab & Other .o make rules.
#
cin2tab: $(OBJS3)
	$(CC) -o $@ $(OBJS3) 

#
#  Cli_Xcin.o
#
cli_xcin.o: cli_xcin.c state.h protocol.h

inp.o: inp.c xi.h

intcode.o: intcode.c xi.h

ser_dispatch.o: ser_dispatch.c state.h protocol.h

xi.o: xi.c xi.h state.h

cin2tab.o: cin2tab.c xi.h

install: @INSTALLALL@

install_xcin: xcin 
	if [ ! -d $(PATH_XCIN_BIN) ]; then $(INSTALL_DIR) $(PATH_XCIN_BIN); fi
	$(INSTALL) xcin $(PATH_XCIN_BIN)
	echo $(PATH_XCIN_BIN)/xcin >> filelist

install_cli_xcin.o: cli_xcin.o
	if [ ! -d $(PATH_XCIN_DIR) ]; then $(INSTALL_DIR) $(PATH_XCIN_DIR); fi
	$(INSTALL_DATA) cli_xcin.o $(PATH_XCIN_DIR)
	echo $(PATH_XCIN_DIR)/cli_xcin.o >> filelist

install_cin2tab: cin2tab
	if [ ! -d $(PATH_XCIN_DIR) ]; then $(INSTALL_DIR) $(PATH_XCIN_DIR); fi
	$(INSTALL) cin2tab $(PATH_XCIN_DIR)
	echo $(PATH_XCIN_DIR)/cin2tab >> filelist

clean:
	rm -f *.o core filelist $(PROGS) $(TSINTABS) $(KBMS) $(INPUT0)

veryclean: clean
	rm -f Makefile

