#
# $Header: /cvsroot/hungry/lesstif/lib/Xm-CDE/Makefile.am,v 1.6 1998/03/04 20:46:06 u27113 Exp $
#
MAINTAINERCLEANFILES=Makefile.in

if Version_1_2
EXTRA_LTLIBRARIES=	libXm.la
endif

#
# 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 DragDrop.c DragIcon.c DragOverS.c \
#	DragUnder.c DrawingArea.c DrawnB.c DropSMgr.c DropTrans.c \
#	ExtObject.c FileSB.c FontList.c Form.c Frame.c \
#	Gadget.c GadgetUtil.c GeoUtils.c Hash.c ImageCache.c \
#	LTfnmatch.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 PanedW.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 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 alloca.c LTCvt.c LT@Editres@Editres.c LTXpm.c
#
SRCS_1_2 =

#
# This is for cleanup purposes.
# Could be in the CDE case only, but let's clean up at all times.
#
BUILT_SOURCES=		${SRCS_1_2} links
#
# Sources in this directory
#
SRCS_CDE =

INCLUDES=	-I$(top_srcdir)/include/Motif-CDE \
		-I../../include/Motif-CDE \
		-I$(top_srcdir)/include/Motif-1.2 \
		-I../../include/Motif-1.2 \
		-I$(top_srcdir)/include \
		-I../../include \
		${X_CFLAGS}

#libXm_la_LDFLAGS=	-version-info 1:2 -release @LIBTOOL_VERSION@
libXm_la_LDFLAGS=	-version-info 1:2

EXTRA_DIST=	${SRCS_CDE}

#
# Stuff below only valid when building a Motif/CDE clone
#
if Version_CDE

#lib_LTLIBRARIES=	libXm.la

libXm_la_SOURCES= ${SRCS_1_2:%=../Xm/%} ${SRCS_CDE}


##
## Build links for the sources in other directories
## FIX ME : Couldn't get the line with top_srcdir to work.
## The line in use now is not completely right.
##
##SRCS_1_2_THERE=	${SRCS_1_2:%=$top_srcdir/lib/Xm/%}
##SRCS_1_2_THERE=	${SRCS_1_2:%=$(top_srcdir)/lib/Xm/%}
SRCS_1_2_THERE=	${SRCS_1_2:%=../Xm/%}

##
## This construction has the side effect that the links are verified
## over and over again for every single source file. It's not noticable
## (due to caching I presume) but I don't like it.
##
## Therefore, the two-step process with the "links" target below.
##
##${SRCS_1_2}:	${SRCS_1_2_THERE}
##	@echo "Making links from 1.2 directory..."
##	@for i in ${SRCS_1_2} ${EXTRA_1_2}; do \
##	  if [ ! -r $(srcdir)/$$i ]; then \
##	    ln $(srcdir)/../Xm/$$i $(srcdir) ;\
##	  fi ;\
##        done

${SRCS_1_2}:	links

links:	${SRCS_1_2_THERE}
	@echo "Making links from 1.2 directory..."
	@for i in ${SRCS_1_2} ${EXTRA_1_2}; do \
	  if [ ! -r $(srcdir)/$$i ]; then \
	    ln -s $(srcdir)/../Xm/$$i $(srcdir) ;\
	  fi ;\
        done
	@touch links

else

links:
	:

endif
