# if you don't have XILHOME set, we look in default place
XIL_INSTALL_PT=/opt/SUNWits/Graphics-sw/xil

CFLAGS = -I$(XILHOME)/include -I$(XIL_INSTALL_PT)/include -I$(OPENWINHOME)/include -D_REENTRANT

LIBS = -L$(XILHOME)/lib -L$(XIL_INSTALL_PT)/lib -L$(OPENWINHOME)/lib -R $(XIL_INSTALL_PT)/lib:/usr/openwin/lib

install := LIBS += -lxil -lX11 -lsocket -ldl -lnsl -ldga -lm -lthread
# -lthread doesn't work with SPARCworks C 2.0.1 debugger
debug_install := LIBS += -lxil -lX11 -lsocket -ldl -lnsl -ldga -lm
debug_install := CFLAGS += -g

install: xilh_video_receiver xilh_video_broadcast
debug_install: xilh_video_receiver xilh_video_broadcast

debug: debug_install

VC_FILES= xilvc.o window.o cmap.o receive.o rparams.o cellb_util.o dither.o xilh261packet.o

xilh_video_receiver: $(VC_FILES)
	$(CC) -o $@ $(VC_FILES) $(LIBS) 

BC_FILES= transmit.o xilbroadcast.o tparams.o window.o cmap.o cellb_util.o dither.o

xilh_video_broadcast: $(BC_FILES)
	$(CC) -o $@ $(BC_FILES) $(LIBS) 

clean:
	rm -f a.out core xilh_video_broadcast xilh_video_receiver *.o
        
transmit.o:     transmit.h
xilbroadcast.o: transmit.h

window.o:	dither.h

receive.o:      packet.h
transmit.o:     packet.h
xilbroadcast.o: packet.h
xilvc.o:        packet.h

receive.o:      params.h
rparams.o:      params.h
tparams.o:      params.h
transmit.o:     params.h
xilbroadcast.o: params.h
xilvc.o:        params.h

window.o:       window_state.h
xilbroadcast.o: window_state.h
xilvc.o:        window_state.h

xilbroadcast.o: cellb_util.h
xilvc.o:        cellb_util.h
cellb_util.o:   cellb_util.h

receive.o:      receive.h
xilvc.o:        receive.h
