#
# $Header: /cvsroot/lesstif/lesstif/clients/Motif-2.0/mwm/Makefile.am,v 1.19 2005/03/26 06:52:24 dannybackx Exp $
#

#
# 2.1 has precendence
#
if ! Version_2_1
if Version_2_0
bin_PROGRAMS=	mwm
endif
endif

MAINTAINERCLEANFILES=Makefile.in mwmlex.c mwmparse.c mwmparse.h

noinst_HEADERS = mwmparse.h

SRCS_1_2 = \
  	colormaps.c cursors.c decorate.c defaults.c desktop.c \
	events.c functions.c icons.c menus.c misc.c move.c \
	mwm.c pager.c pan.c props.c resize.c resources.c screens.c \
	windows.c gethostname.c \
        mwmparse.y mwmlex.l \
	mwm.h mwmstrings.h
SRCS_2_0 = 

#EXTRA_DIST=	Mwm.ad system.mwmrc alt.map README gethostname.c

# non-local stuff
# BUILT_SOURCES =  mwmlex.c mwmparse.c mwmparse.h $(mwmd_DATA) Mwm.ad

mwm_SOURCES =   ${SRCS_1_2:%=../../Motif-1.2/mwm/%} $(SRCS_2_0)

$(SRCS_1_2):
	rm -f $@
	$(LN_S) $(srcdir)/../../Motif-1.2/mwm/$@ $@


# Special dependencies
#mwmlex.c:   mwmparse.h
#mwmparse.h: mwmparse.c


AM_CPPFLAGS=       -I$(top_srcdir)/clients/Motif-1.2/mwm \
                -I$(top_srcdir)/include/Motif-2.0 \
		-I../../../include/Motif-2.0 \
		-I$(top_srcdir)/include/Motif-1.2 \
		-I../../../include/Motif-1.2 \
		$(X_CFLAGS) \
		-DMWM_DDIR=\"$(mwmddir)\" \
		-DXINCL_PATH=\"@x_includes@\"

LDADD=		../../../lib/Xm-2.0/libXm.la \
		$(X_LIBS) -lXt $(X_PRE_LIBS) -lXext -lX11 $(X_EXTRA_LIBS)

appdir=		$(libdir)/X11/app-defaults

mwmddir=	$(libdir)/X11/mwm
mwmd_DATA=	system.mwmrc alt.map README


$(mwmd_DATA) Mwm.ad:
	rm -f $@
	$(LN_S) $(srcdir)/../../Motif-1.2/mwm/$@ $@


AM_YFLAGS=		-d

clean-local:
	@for i in $(BUILT_SOURCES) $(SRCS_1_2) ; do \
	   if test -r $$i; then \
	      rm $$i; \
	   fi ; \
	   done

install-data-local:
	$(mkinstalldirs) $(DESTDIR)$(appdir)
	$(INSTALL_DATA) $(srcdir)/../../Motif-1.2/mwm/Mwm.ad $(DESTDIR)$(appdir)/Mwm
