#
# $Header: /cvsroot/lesstif/lesstif/include/Motif-2.0/Xm/Makefile.am,v 1.60 2002/12/15 16:58:58 dannybackx Exp $
#
MAINTAINERCLEANFILES = Makefile.in Xm.h Xm.h.tmp
CLEANFILES = Xm.h Xm.h.tmp

#
# Install headers

xmdir=	$(includedir)/Xm

include ../../Include.Xm

EXTRA_DIST = Xm.h.in $(xm_20base_h) $(xm_20private_h)

if Version_2_0
nodist_xm_HEADERS = $(xm_20base_h) $(xm_20private_h)
xm_DATA = Xm.h
$(xm_12base_h):
	$(LN_S) $(top_srcdir)/include/Motif-1.2/Xm/$@ $@
endif

# To avoid useless re-building when dependencies are being used
# only touch Xm.h if it really needs to be updated.
# We create a new, temporary new Xm.h(.tmp) and compare it to the
# old existing one.
# So it will only trigger a rebuild if the version stamps have changed!
Xm.h: Xm.h.tmp
	cmp -s Xm.h.tmp Xm.h || rm -f Xm.h && cp Xm.h.tmp Xm.h

Xm.h.tmp: $(top_srcdir)/include/Motif-2.0/Xm/Xm.h.in Makefile
	sed -e "s/_MAJOR_VERSION_/$(MAJOR_VERSION)/" \
	    -e "s/_MINOR_VERSION_/$(MINOR_VERSION)/" \
	    -e "s/_PICO_VERSION_/$(PICO_VERSION)/"   \
	$(top_srcdir)/include/Motif-2.0/Xm/Xm.h.in >Xm.h.tmp
