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

if Version_1_2
EXTRA_LTLIBRARIES=	libMrm.la
endif

#
# Sources in another directory
#
#SRCS_1_2 = \
#	Mrm.c lookup.c misc.c
SRCS_1_2 =

#HDRS_1_2 = \
#	lookup.h misc.h uil.h
HDRS_1_2 =

EXTRA_1_2 =

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

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

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

EXTRA_DIST=	${SRCS_2_1}

#
# Stuff below only valid when building a Motif 2.1 clone
#
if Version_2_1

#lib_LTLIBRARIES=	libMrm.la

libMrm_la_SOURCES= ${SRCS_1_2:%=../Mrm/%} ${SRCS_2_1}


##
## 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/Mrm/%}
##SRCS_1_2_THERE=	${SRCS_1_2:%=$(top_srcdir)/lib/Mrm/%}

SRCS_1_2_THERE=	${SRCS_1_2:%=../Mrm/%}
HDRS_1_2_THERE=	${HDRS_1_2:%=../Mrm/%}
EXTRA_1_2_THERE=	${EXTRA_1_2:%=../Mrm/%}

##
## 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)/../Mrm/$$i $(srcdir) ;\
##	  fi ;\
##        done

${SRCS_1_2}:	links

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

else

links:
	:
endif
