#
# @(#)Makefile 1.1 92/07/30 SMI
#
 
SRCS= buttontest.c diag.c
HDRS= button_icon.h off_off_icon.h on_on_icon.h on_off_icon.h \
      off_on_icon.h buttons.h button_mask_icon.h
OBJS= buttontest.o diag.o
OPENWINHOME= /usr/openwin
EXECS= buttontest x_buttontest
LIBS=	-lsuntool -lsunwindow -lpixrect -lm
#CFLAGS=	-O
CFLAGS= -O -I$(OPENWINHOME)/share/include
DEST_SRC=	$(DESTDIR)/usr/demo/BUTTONBOX

#
# added for the openwin stuff
#
XSRCS= x_buttontest.c x_diag.c
XOBJS= x_buttontest.o x_diag.o
XLIBS=   -L$(OPENWINHOME)/lib -lxview -lpixrect -lm -lolgx -lX


.KEEP_STATE:
.INIT: $(HDRS)

all: buttontest x_buttontest

buttontest:	$(OBJS)
		cc $(CFLAGS) -o $@ $(OBJS) $(LIBS)

x_buttontest:	$(XOBJS)
		cc $(XCFLAGS) -o $@ $(XOBJS) $(XLIBS)

install: $(SRCS) $(XSRCS) $(HDRS) Makefile.demo
	install -d -m 755 $(DEST_SRC)
	install -m 555 $(EXECS) $(DEST_SRC)
	install -m 644 $(SRCS) $(XSRCS) $(DEST_SRC)
	install -m 644 Makefile.demo $(DEST_SRC)
	mv $(DEST_SRC)/Makefile.demo $(DEST_SRC)/Makefile
	install -m 444 $(HDRS) $(DEST_SRC)

clean:
	rm -f *.o
	rm -f core
	rm -f a.out
	rm -f buttontest x_buttontest
#
#	dependencies as generated by cc -M and filtered by grep -v include
#
#
#

buttontest.o: buttontest.c
buttontest.o: ./button_icon.h
buttontest.o: ./buttons.h
buttontest.o: ./off_off_icon.h
buttontest.o: ./off_on_icon.h
buttontest.o: ./on_off_icon.h
buttontest.o: ./on_on_icon.h
diag.o: diag.c
x_buttontest.o: x_buttontest.c
x_buttontest.o: ./button_icon.h
x_buttontest.o: ./button_mask_icon.h
x_buttontest.o: ./buttons.h
x_buttontest.o: ./off_off_icon.h
x_buttontest.o: ./off_on_icon.h
x_buttontest.o: ./on_off_icon.h
x_buttontest.o: ./on_on_icon.h
x_diag.o: x_diag.c
