#
# $Header: /cvsroot/hungry/lesstif/lib/Mrm-2.0/Makefile.am,v 1.9 1998/03/04 20:46:02 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

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

EXTRA_1_2 =

#
# 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} ${HDRS_1_2} links
BUILT_SOURCES=		${HDRS_1_2} ${SRCS_1_2}

#
# Sources in this directory
#
SRCS_2_0 =

INCLUDES=	-I$(top_srcdir)/include/Motif-2.0 \
		-I../../include/Motif-2.0 \
		-I$(top_srcdir)/include/Motif-1.2 \
		-I../../include/Motif-1.2 \
		-I$(top_srcdir)/include \
		-I../../include \
		${X_CFLAGS} \
		-DX_LIB_PATH=\"@x_libraries@\" \
		-DLESSTIFHOME=\"@prefix@\"


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

#
# Apparently we cannot link with a relative path with libtool.
# This is a problem : it means we have to install libXm before
# being able to build libMrm.
#
#libMrm_la_LIBADD=       ../Xm-2.0/libXm.la -lXm
#libMrm_la_LIBADD=       -L../Xm -lXm
#libMrm_la_LIBADD=       -lXm

EXTRA_DIST=	${SRCS_2_0}

#
# Stuff below only valid when building a Motif 2.0 clone
#
if Version_2_0

lib_LTLIBRARIES=	libMrm.la

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


##
## 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/%}

endif

lookup.h: $(srcdir)/../Mrm/lookup.h
	rm -f $@
	ln -s $(srcdir)/../Mrm/$@ $@

misc.h: $(srcdir)/../Mrm/misc.h
	rm -f $@
	ln -s $(srcdir)/../Mrm/$@ $@

uil.h: $(srcdir)/../Mrm/uil.h
	rm -f $@
	ln -s $(srcdir)/../Mrm/$@ $@

Mrm.c: $(srcdir)/../Mrm/Mrm.c uil.h
	rm -f $@
	ln -s $(srcdir)/../Mrm/$@ $@

lookup.c: $(srcdir)/../Mrm/lookup.c lookup.h
	rm -f $@
	ln -s $(srcdir)/../Mrm/$@ $@

misc.c: $(srcdir)/../Mrm/misc.c misc.h
	rm -f $@
	ln -s $(srcdir)/../Mrm/$@ $@


Mrm.lo:	lookup.h misc.h
