#ifndef XCOMM
#define XCOMM #
#endif

# needed to get the right so-version with XFree4
SOXAWREV = 6.1

XCOMM Build options. Have you read the README.XAW3D file yet?
XCOMM
XCOMM For color pixmaps, define MULTIPLANE_PIXMAPS:
#undef MULTIPLANE_PIXMAPS
XCOMM For grayed stipple shadows, define GRAY_BLKWHT_STIPPLES:
#define GRAY_BLKWHT_STIPPLES
XCOMM For scrollbars with arrows, define ARROW_SCROLLBARS:
#define ARROW_SCROLLBARS

#define DoNormalLib NormalLibXaw
#define DoSharedLib SharedLibXaw
#define DoDebugLib DebugLibXaw 
#define DoProfileLib ProfileLibXaw 
#define HasSharedData YES
#define LibName Xaw3dxft
#define SoRev SOXAWREV
#define IncSubdir X11
#define IncSubSubdir Xaw3dxft

XCOMM When building outside an X11 source tree:
EXTRA_INCLUDES = -I. -I/usr/include/X11/Xft -I/usr/include/freetype2

#ifdef SharedXawReqs
REQUIREDLIBS = SharedXawReqs -lXft
#endif


LINTLIBS = $(LINTXLIB) $(LINTXTOOL)

BASE_HDRS = AllWidgets.h AsciiSink.h AsciiSinkP.h AsciiSrc.h AsciiSrcP.h \
	AsciiText.h AsciiTextP.h Box.h BoxP.h Cardinals.h Command.h \
	CommandP.h Dialog.h DialogP.h Form.h FormP.h Grip.h GripP.h \
	Label.h LabelP.h Layout.h LayoutP.h List.h ListP.h MenuButton.h \
	MenuButtoP.h Paned.h PanedP.h Panner.h PannerP.h Porthole.h \
	PortholeP.h Repeater.h RepeaterP.h Reports.h Scrollbar.h \
	ScrollbarP.h Simple.h SimpleP.h SimpleMenu.h SimpleMenP.h Sme.h \
	SmeP.h SmeBSB.h SmeBSBP.h SmeLine.h SmeLineP.h SmeThreeD.h \
	SmeThreeDP.h StripChart.h StripCharP.h Template.c Template.h \
	TemplateP.h Text.h TextP.h TextSink.h TextSinkP.h TextSrc.h \
	TextSrcP.h ThreeD.h ThreeDP.h Tip.h TipP.h Toggle.h ToggleP.h \
	Tree.h TreeP.h Viewport.h ViewportP.h Xaw3dP.h XawInit.h

BASE_SRCS = AllWidgets.c AsciiSink.c AsciiSrc.c AsciiText.c Box.c \
	Command.c Dialog.c Form.c Grip.c Label.c Layout.c List.c \
	MenuButton.c Paned.c Panner.c Porthole.c Repeater.c Scrollbar.c \
	Simple.c SimpleMenu.c Sme.c SmeBSB.c SmeLine.c SmeThreeD.c \
	StripChart.c Text.c TextSink.c TextSrc.c TextAction.c TextPop.c \
	TextTr.c ThreeD.c Tip.c Toggle.c Tree.c Vendor.c Viewport.c \
	Xaw3dP.c XawInit.c sharedlib.c laygram.c laylex.c

#if SharedDataSeparation
UNSHAREDOBJS = AllWidgets.o sharedlib.o
#endif

BASE_OBJS = AllWidgets.o AsciiSink.o AsciiSrc.o AsciiText.o Box.o \
	Command.o Dialog.o Form.o Grip.o Label.o Layout.o List.o \
	MenuButton.o Paned.o Panner.o Porthole.o Repeater.o Scrollbar.o \
	Simple.o SimpleMenu.o Sme.o SmeBSB.o SmeLine.o SmeThreeD.o \
	StripChart.o Text.o TextSink.o TextSrc.o TextAction.o TextPop.o \
	TextTr.o ThreeD.o Tip.o Toggle.o Tree.o Vendor.o Viewport.o \
	Xaw3dP.o XawInit.o laygram.o laylex.o

HEADERS = $(BASE_HDRS)
SRCS = $(BASE_SRCS)
OBJS = $(BASE_OBJS)

#include <Library.tmpl>

#if DoSharedLib && SharedDataSeparation
SpecialCObjectRule(sharedlib.o,NullParameter,$(SHLIBDEF))
#endif

XCOMM At least one X11R5 distribution needs this:
XCOMM #include "Imakefrag.X11R5"

#ifdef LexCmd
LEX = LexCmd
#endif
#ifdef YaccCmd
YACC = YaccCmd
#endif

#ifdef MULTIPLANE_PIXMAPS
XAW_MULTIPLANE_PIXMAPS = \
	-e 's/\/\* XPM support \*\//\#define XAW_MULTIPLANE_PIXMAPS/'
#else
XAW_MULTIPLANE_PIXMAPS = \
	-e 's/\/\* XPM support \*\//\#undef XAW_MULTIPLANE_PIXMAPS/'
#endif
#ifdef GRAY_BLKWHT_STIPPLES
XAW_GRAY_BLKWHT_STIPPLES = \
	-e 's/\/\* gray stipples \*\//\#define XAW_GRAY_BLKWHT_STIPPLES/'
#else
XAW_GRAY_BLKWHT_STIPPLES = \
	-e 's/\/\* gray stipples \*\//\#undef XAW_GRAY_BLKWHT_STIPPLES/'
#endif
#ifdef ARROW_SCROLLBARS
XAW_ARROW_SCROLLBARS = \
	-e 's/\/\* arrow scrollbars \*\//\#define XAW_ARROW_SCROLLBARS/'
#else
XAW_ARROW_SCROLLBARS = \
	-e 's/\/\* arrow scrollbars \*\//\#undef XAW_ARROW_SCROLLBARS/'
#endif

depend:: laygram.c laygram.h laylex.c Xaw3dP.h

clean::
	$(RM) laygram.c laygram.h laylex.c Xaw3dP.h

distclean:: clean
	rm -f Makefile

laygram.c: laygram.y
	$(YACC) -d laygram.y
	sed -e 's/yy/LayYY/g' y.tab.c > laygram.c
	sed -e 's/yy/LayYY/g' y.tab.h > laygram.h
	$(RM) y.tab.c y.tab.h

laylex.c: laylex.l
	$(LEX) laylex.l
	sed -e 's/yy/LayYY/g' lex.yy.c > laylex.c
	$(RM) lex.yy.c

Xaw3dP.h: Xaw3dP.h.sed
	sed $(XAW_MULTIPLANE_PIXMAPS) \
	$(XAW_GRAY_BLKWHT_STIPPLES) $(XAW_ARROW_SCROLLBARS) \
	Xaw3dP.h.sed > Xaw3dP.h

$(OBJS): Xaw3dP.h

DependTarget()

