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

include ../../Include.Xm

# Ensure to distribute 1.2 headers even if not built
EXTRA_DIST = Xm.h.in $(xm_12base_h) $(xm_12private_h)

#
# Install headers
xmdir=	$(includedir)/Xm

if Version_1_2
nodist_xm_HEADERS = $(xm_12base_h) $(xm_12private_h)
xm_DATA = Xm.h
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-1.2/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-1.2/Xm/Xm.h.in >Xm.h.tmp
