#
# %Z%%M% %I% %E% SMI
#
#
# Top-level Imakefile
#
# LIBRARY_DEST is the destination directory for libxvin.a and libxvol.a
# HEADER_DEST is the destination directory for all the XView include files.
#	These must be installed in HEADER_DEST/xview and 
#	HEADER_DEST/xview_private BEFORE the libraries are built.
# If you want to build profiled or debugged libraries, put definitions
# for DebugLibXvin and/or ProfileLibXvin in your imake site.def file.
# Such definitions may be found in XView.tmpl.
#

#include "../../XView.config"

#define IHaveSubdirs YES
#define INCLUDES -I$(HEADER_FILE)

SUBDIRS= attr base cursor defaults filter font fullscreen io_stream\
	misc notify pw rect screen sel server server_image string_utils\
	win window

#define PassCDebugFlags 'HEADER_DEST=$(HEADER_DEST)' 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'AR=$(AR)'

all:: libxview.a

MakeAnythingSubdirs(libxview.a, $(SUBDIRS))
MakeAnythingSubdirs(libxvin.a, $(SUBDIRS))

DependSubdirs($(SUBDIRS))

#
# Additional install steps here
#

InstallLibraryNoBuild(xvin,$(LIBRARY_DEST))

#if DebugLibXvin
InstallLibrary(xvin_d,$(LIBRARY_DEST))
#endif

#if ProfileLibXvin
InstallLibrary(xvin_p,$(LIBRARY_DEST))
#endif

install_headers::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ; \
	do \
		(cd $$i ; echo "installing headers in $$i"; \
		    $(MAKE) $(MFLAGS) \
			HEADER_DEST='$(HEADER_DEST)' install_headers ); \
	done 
