#
# $Header: /cvsroot/lesstif/lesstif/lib/Xm-2.0/Makefile.am,v 1.63 2005/03/26 06:52:26 dannybackx Exp $
#
MAINTAINERCLEANFILES=Makefile.in

libXm_la_LDFLAGS=	-version-info 2:0 -no-undefined
libdir = $(exec_prefix)/lib

#
# Sources in this directory
#
SRCS_2_0 = \
	ComboBox.c Container.c CSText.c \
	Direction.c Draw.c GrabShell.c Messages.c \
	Notebook.c PanedW.c PixConv.c PopupUtil.c \
	RenderTable.c SpinBox.c Trait.c TranslNew.c \
	Xme.c IconG.c XmStrDefs.c Transfer.c \
	Xpm.c XmTabList.c

EXTRA_DIST=	${SRCS_2_0}
nodist_libXm_la_SOURCES=	${SRCS_1_2} ${XDND_SRC:%=../Xm/%}

#
# Sources in another directory
#
SRCS_1_2 = \
	ArrowB.c ArrowBG.c AtomMgr.c BaseClass.c BulletinBoard.c \
	Cache.c CascadeB.c CascadeBG.c Command.c CutPaste.c \
	DebugUtil.c Desktop.c Dest.c DialogS.c Display.c \
	DragBS.c DragC.c DragIcon.c DragOverS.c \
	DragUnder.c DrawingArea.c DrawnB.c DropSMgr.c DropSMgrI.c \
	DropTrans.c ExtObject.c FileSB.c FontList.c Form.c Frame.c \
	Gadget.c GadgetUtil.c GeoUtils.c Hash.c ImageCache.c \
	LTglob.c Label.c LabelG.c List.c \
	MapEvent.c MainW.c Manager.c MenuShell.c MenuUtil.c \
	MessageB.c Mwm.c Obsolete.c Primitive.c \
	Protocols.c PushB.c PushBG.c RCUtils.c ReadImage.c \
	Region.c RepType.c ResInd.c RowColumn.c Sash.c \
	Scale.c Screen.c ScrollBar.c ScrolledW.c Selection.c \
	SelectionBox.c Separator.c SeparatoG.c Shadow.c ShellExt.c \
	Simple.c TearOff.c TearOffB.c Text.c TextF.c TextIn.c TextOut.c \
	TextStrSo.c ToggleB.c ToggleBG.c TrackLoc.c Transltns.c \
	Traversal.c TravAct.c UniqueEvent.c VaSimple.c VirtKeys.c \
	Visual.c World.c XmString.c XmIm.c Xmos.c \
	misc.c LTCvt.c LT@Editres@Editres.c Vendor.c ResConvert.c

if UseXDND
XDND_SRC=xdnd.c
else
XDND_SRC=
endif

if Version_2_0

#libXm_la_LIBADD = $(X_LIBS) -lXt $(X_PRE_LIBS) -lX11 \
#                  $(X_EXTRA_LIBS)


#
# This is for cleanup purposes.
# Could be in the 2.0 case only, but let's clean up at all times.
#
BUILT_SOURCES=		$(SRCS_1_2:%=../Xm/%) xdnd.c

AM_CPPFLAGS=	-I$(top_srcdir)/include/Motif-2.0 \
		-I$(top_builddir)/include/Motif-2.0 \
		-I$(top_srcdir)/include/Motif-1.2 \
		-I$(top_builddir)/include/Motif-1.2 \
		-I$(top_srcdir)/include \
		-I$(top_builddir)/include \
		${X_CFLAGS}

#
# Install headers
#
# Lets put the headers in a sub directory to avoid
# poluting /usr/local with more directories for default installs.
#

lib_LTLIBRARIES=	libXm.la

libXm_la_SOURCES= ${SRCS_2_0}
#libXm_la_SOURCES= ${SRCS_1_2:%=../Xm/%} ${SRCS_2_0} ${XDND_SRC:%=../Xm/%}

$(SRCS_1_2) xdnd.c:
	rm -f $@
	$(LN_S) $(srcdir)/../Xm/$@ $@
endif

clean-local:
if Version_2_0
	@for i in $(SRCS_1_2) xdnd.c ; do \
	   if test -r $$i; then \
	      rm $$i; \
	   fi ; \
	  done
endif
