# BuildSystemHeader added automatically
# $Header: [Makefile,v 1.1.1.1 91/08/07 14:40:27 afuller Exp ]$
DESTDIR=
EXAMPLEDIR=/usr/examples/xuidemo
UIL = ${DESTDIR}/usr/bin/dxuil

.SUFFIXES : .uil .uid

INCLUDES = -I. -I${DESTDIR}/usr/include/X11 -I${DESTDIR}/usr/include
XLIB = ${DESTDIR}/usr/lib/libX11.a
DWTLIB = ${DESTDIR}/usr/lib/libdwt.a

#CFLAGS = -g ${INCLUDES}
CFLAGS =  -O ${INCLUDES}

OBJS =	widgets.o \
	language.o \
	menus.o \
	label.o \
        push_btn.o \
        separatr.o \
        toggle.o \
        com_win.o \
        main_win.o \
        scrl_win.o \
        window.o \
        list_box.o \
        scale.o \
        scrl_bar.o \
        sim_text.o \
        caution.o \
        file_sel.o \
        help_box.o \
        message.o \
        selectn.o \
        wrk_in_p.o \
        opt_menu.o \
        wrk_area.o \
        radio_bx.o \
  	pop_menu.o \
	menu_bar.o \
	pd_entry.o \
	pd_menu.o \
	db.o \
	adb.o \
	pop_db.o \
	pop_adb.o

UIDS =	widgets.uid \
	english.uid \
	german.uid \
	adb.uid \
	caution.uid \
	com_win.uid \
	db.uid \
	file_sel.uid \
	help_box.uid \
	label.uid \
	list_box.uid \
	main_win.uid \
	menu_bar.uid \
	message.uid \
	opt_menu.uid \
	pd_entry.uid \
	pd_menu.uid \
	pop_adb.uid \
	pop_db.uid \
	pop_menu.uid \
	push_btn.uid \
	radio_bx.uid \
	scale.uid \
	scrl_bar.uid \
	scrl_win.uid \
	selectn.uid \
	separatr.uid \
	sim_text.uid \
	toggle.uid \
	window.uid \
	wrk_area.uid \
	wrk_in_p.uid

.uil.uid :
	$(UIL) -o $@ $< -I${DESTDIR}/usr/include/X11

.c.o :
	${CC} -c ${CFLAGS} $*.c

all : xuidemo ${UIDS}

xuidemo : ${OBJS}
	${CC} ${CFLAGS} -o xuidemo ${OBJS} ${DWTLIB} ${XLIB} -lm

install: all
	-mkdir ${DESTDIR}${EXAMPLEDIR}
	for file in `ls Makefile *.[ch] *.uil`; do \
		install -c -m 644 $$file ${DESTDIR}${EXAMPLEDIR}; \
	done
	-mkdir ${DESTDIR}${EXAMPLEDIR}/help
	-mkdir ${DESTDIR}${EXAMPLEDIR}/help/english
	-mkdir ${DESTDIR}${EXAMPLEDIR}/help/german
	install -c -m 644 Overview.eng \
		${DESTDIR}${EXAMPLEDIR}/help/english/Overview
	install -c -m 644 Overview.ger \
		${DESTDIR}${EXAMPLEDIR}/help/german/Overview

relink::
	-rm -f xuidemo $(UIDS)

relink:: all

clean:
	rm -f *.bak *.o  *~ \#* xuidemo *.uid core
