#define DoNormalLib NormalLibXaw
#define DoSharedLib SharedLibXaw
#define DoDebugLib DebugLibXaw
#define DoProfileLib ProfileLibXaw
#include <Library.tmpl>

#define DoSpotLib YES

#ifdef RsArchitecture
REQUIREDLIBS = $(XMUSRC)/libXmu.a $(EXTENSIONSRC)/lib/libXext.a $(TOOLKITSRC)/libXt.a $(XLIBSRC)/libX11.a
#endif

   INSTALLFLAGS = $(INSTINCFLAGS)
       LINTLIBS = $(LINTXLIB) $(LINTXTOOL)

       INCLUDES = -I$(XLIBSRC)
        DEFINES = -DXI18N -DIM
       XWNMOSRC = $(CONTRIBSRC)/im/Xsi/Xwnmo/xwnmo
 XIMSET_DEFINES = -DSPOT

#ifdef NO_FORM_BUG
FORMSRC = form.c
#endif

LINKS = \
	AllWidgets.h \
	AsciiSink.h \
	AsciiSrc.h \
	AsciiSrcP.h \
	AsciiText.h \
	AsciiTextP.h \
	Box.h \
	BoxP.h \
	Cardinals.h \
	Clock.h \
	ClockP.h \
	Command.h \
	CommandP.h \
	Dialog.h \
	DialogP.h \
	Form.h \
	FormP.h \
	Grip.h \
	GripP.h \
	Label.h \
	LabelP.h \
	List.h \
	ListP.h \
	Logo.h \
	LogoP.h \
	Mailbox.h \
	MailboxP.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 \
	StripChart.h \
	StripCharP.h \
	Template.c \
	Template.h \
	TemplateP.h \
	TextSink.h \
	Toggle.h \
	ToggleP.h \
	Tree.h \
	TreeP.h \
	Viewport.h \
	ViewportP.h \
	XawInit.h \
	Box.c \
	Clock.c \
	Command.c \
	Dialog.c \
	$(FORMSRC) \
	Grip.c \
	Label.c \
	List.c \
	Logo.c \
	Mailbox.c \
	MenuButton.c \
	Panner.c \
	Porthole.c \
	Repeater.c \
	Scrollbar.c \
	Simple.c \
	SimpleMenu.c \
	Sme.c \
	SmeBSB.c \
	SmeLine.c \
	StripChart.c \
	Toggle.c \
	Tree.c \
	Viewport.c \
	XawInit.c

SpotLibLINKS = $(SpotLibSRCS) \
	$(SpotLibHDRS)

HEADERS = \
	AllWidgets.h \
	AsciiSink.h \
	AsciiSinkP.h \
	AsciiSrc.h \
	AsciiSrcP.h \
	AsciiText.h \
	AsciiTextP.h \
	Box.h \
	BoxP.h \
	Cardinals.h \
	Clock.h \
	ClockP.h \
	Command.h \
	CommandP.h \
	Dialog.h \
	DialogP.h \
	Form.h \
	FormP.h \
	Grip.h \
	GripP.h \
	Label.h \
	LabelP.h \
	List.h \
	ListP.h \
	Logo.h \
	LogoP.h \
	Mailbox.h \
	MailboxP.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 \
	StripChart.h \
	StripCharP.h \
	Template.c \
	Template.h \
	TemplateP.h \
	Text.h \
	TextP.h \
	TextSink.h \
	TextSinkP.h \
	TextSrc.h \
	TextSrcP.h \
	Toggle.h \
	ToggleP.h \
	Tree.h \
	TreeP.h \
	Viewport.h \
	ViewportP.h \
	XawInit.h \
	$(XawI18nHDRS)

SpotLibHDRS = SpotProto.h

XawI18nHDRS = \
	CommandLc.h \
	CommandLcP.h \
	DialogLc.h \
	DialogLcP.h \
	LabelLc.h \
	LabelLcP.h \
	ListLc.h \
	ListLcP.h \
	MenuBtnLc.h \
	MenuBtnLcP.h \
	MultiSink.h \
	MultiSinkP.h \
	MultiSrc.h \
	MultiSrcP.h \
	MultiText.h \
	MultiTextP.h \
	SmeBSBLc.h \
	SmeBSBLcP.h \
	TextSrcI.h \
	ToggleLc.h \
	ToggleLcP.h \
	VendorEP.h \
	XawIm.h \
	XawImP.h \
	Xawi18n.h


SRCS = \
	AllWidgets.c \
	AsciiSink.c \
	AsciiSrc.c \
	AsciiText.c \
	Box.c \
	Clock.c \
	Command.c \
	Dialog.c \
	Form.c \
	Grip.c \
	Label.c \
	List.c \
	Logo.c \
	Mailbox.c \
	MenuButton.c \
	Paned.c \
	Panner.c \
	Porthole.c \
	Repeater.c \
	Scrollbar.c \
	Simple.c \
	SimpleMenu.c \
	Sme.c \
	SmeBSB.c \
	SmeLine.c \
	StripChart.c \
	Text.c \
	TextSink.c \
	TextSrc.c \
        TextAction.c \
        TextPop.c \
	TextTr.c \
	Toggle.c \
	Tree.c \
	Vendor.c \
	Viewport.c \
	XawInit.c \
	sharedlib.c \
	$(XawI18nSRCS)

#if DoSpotLib
SpotLibSRCS = spotlib.c
#else
SpotLibSRCS =
#endif

XawI18nSRCS = \
	CommandLc.c \
	DialogLc.c \
	LabelLc.c \
	ListLc.c \
	MenuBtnLc.c \
	MultiSink.c \
	MultiSrc.c \
	MultiText.c \
	SmeBSBLc.c \
	ToggleLc.c \
	$(SpotLibSRCS) \
	XawIm.c

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

OBJS = \
	AllWidgets.o \
	AsciiSink.o \
	AsciiSrc.o \
	AsciiText.o \
	Box.o \
	Clock.o \
	Command.o \
	Dialog.o \
	Form.o \
	Grip.o \
	Label.o \
	List.o \
	Logo.o \
	Mailbox.o \
	MenuButton.o \
	Paned.o \
	Panner.o \
	Porthole.o \
	Repeater.o \
	Scrollbar.o \
	Simple.o \
	SimpleMenu.o \
	Sme.o \
	SmeBSB.o \
	SmeLine.o \
	StripChart.o \
	Text.o \
	TextSink.o \
	TextSrc.o \
        TextAction.o \
	TextPop.o \
	TextTr.o \
	Toggle.o \
	Tree.o \
	Vendor.o \
	Viewport.o \
	XawInit.o \
	$(XawI18nOBJS)

#if DoSpotLib
SpotLibOBJS = spotlib.o
#else
SpotLibOBJS =
#endif

XawI18nOBJS = \
	CommandLc.o \
	DialogLc.o \
	LabelLc.o \
	ListLc.o \
	MenuBtnLc.o \
	MultiSink.o \
	MultiSrc.o \
	MultiText.o \
	SmeBSBLc.o \
	ToggleLc.o \
	$(SpotLibOBJS) \
	XawIm.o

LibraryObjectRule()

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

#if DoSharedLib
#if DoNormalLib
SharedLibraryTarget(Xaw,$(SOXAWREV),$(OBJS),shared,..)
#else
SharedLibraryTarget(Xaw,$(SOXAWREV),$(OBJS),.,.)
#endif
SharedLibraryDataTarget(Xaw,$(SOXAWREV),$(UNSHAREDOBJS))
InstallSharedLibrary(Xaw,$(SOXAWREV),$(USRLIBDIR))
InstallSharedLibraryData(Xaw,$(SOXAWREV),$(USRLIBDIR))
#endif
#if DoNormalLib
NormalLibraryTarget(Xaw,$(OBJS))
InstallLibrary(Xaw,$(USRLIBDIR))
#endif
#if DoProfileLib
ProfiledLibraryTarget(Xaw,$(OBJS))
InstallLibrary(Xaw_p,$(USRLIBDIR))
#endif
#if DoDebugLib
DebuggedLibraryTarget(Xaw,$(OBJS))
InstallLibrary(Xaw_d,$(USRLIBDIR))
#endif

LintLibraryTarget(Xaw,$(SRCS))
InstallLintLibrary(Xaw,$(LINTLIBDIR))

includes::
	$(RM) $(LINKS)
	for i in $(LINKS); do (set -x; $(LN) $(AWIDGETSRC)/$$i .); done
	$(RM) $(SpotLibLINKS)
#if DoSpotLib
	for i in $(SpotLibLINKS); do (set -x; $(LN) $(XWNMOSRC)/$$i .); done
#endif

#if DoSpotLib
SpecialLibObjectRule(spotlib.o,NullParameter,$(XIMSET_DEFINES))
SpecialLibObjectRule(XawIm.o,NullParameter,$(XIMSET_DEFINES))
#endif

BuildIncludes($(HEADERS),Xaw,..)

InstallMultiple($(HEADERS),$(INCDIR)/Xaw)

DependTarget()

NormalLintTarget($(SRCS))

clean::
	$(RM) $(LINKS) $(SpotLibLINKS)
