/**/#	Copyright (c) 1990, 1991, 1992, 1993, 1994 Novell, Inc. All Rights Reserved.
/**/#	Copyright (c) 1993 Novell, Inc. All Rights Reserved.
/**/#	  All Rights Reserved

/**/#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF Novell Inc.
/**/#	The copyright notice above does not evidence any
/**/#	actual or intended publication of such source code.

#ident	"@(#)mach:mach/Imakefile	1.14"

/***
 ***	NAME
 ***	
 ***		Imakefile : Makefile generation template for the MACH
 ***					display library.
 ***	
 ***	SYNOPSIS
 ***
 ***		make Makefile 	: if in the X build environment.
 ***
 ***		imake -DUseInstalled  : if building outside the X
 ***								environment.
 ***	
 ***	DESCRIPTION
 ***
 ***		The following options are available of customization at
 ***	library build time.  These options are turned on or off using
 ***	compile time flags.  This Imakefile contains only a summary of
 ***	the available options.  Please read the documentation in the
 ***	associated module for further caveats.
 ***	
 ***	RETURNS
 ***
 ***		Not Applicable.
 ***
 ***	MACRO VARIABLES
 ***
 ***		OPTION			MODULE		DESCRIPTION
 ***		~~~~~~			~~~~~~		~~~~~~~~~~~
 ***		__DEBUG__   	*All* 		enable debugging and assertion
 ***									checking.
 ***		LIBRARY_NAME	global.h	prefix for library's messages.
 ***		CHIPSET_NAME	global.h	name of the chipset
 ***		LIBRARY_VERSION global.h 	library version
 ***		ATBUS			mach.c		ATBUS specific code.
 ***		USE_KD_GRAPHICS_MODE		Use KD driver ioctl's to switch
 ***						mach.c		console modes.
 ***		USE_SYSI86		mach.c		Use sysi86() for IOPL's
 ***		PUBLIC			*All*		Marker for interface generation
 ***									tools.
 ***		STATIC			*All*		Define to "" for profiling.
 ***		PROFILING		*All*		Defined on a profiling run.
 ***
 ***	FILES
 ***
 ***		Source for the MACH display library.
 ***
 ***	SEE ALSO
 ***
 ***		imake(1).
 ***	
 ***	CAVEATS
 ***
 ***	BUGS
 ***
 ***	AUTHORS
 ***	
 ***	HISTORY
 ***
 ***		Imakefile 1.0.0 jk: First coding.
 ***	
 ***/

/*
 * Bring in the rules for Imake.
 */

#include <sv4Lib.rules>

/*
 * Debugging the server with dynamically linked library is sometimes painful
 * To statically link libvga256.a or atimach.a into the server:
 *
 * #undef XWINSharedDisplayLibrary
 * and define a VENDOR_DIR; this can be any one of the directories under
 * devices
 *
 * and do:
 *	make clean
 *	make Makefile
 *	make
 *	cd ../../.. (ie: to the server dir)
 *	make Xwin_a (make sure SDD=.....atimach.a in the server/Makefile)
 */

/** #undef XWINSharedDisplayLibrary
**/

/*
 * for archive, we have to include the objects from one of the directories
 * under "devices", so that these objects are archived into libvga256.a
 */ 
#if XWINSharedDisplayLibrary
VENDOROBJS =
#else
VENDOROBJS = ./devices/ultra/?*.o
DEF_VENDORDIR = ./devices/ultra
#endif

/*
 * Subdirectory control.
 */

#define IHaveSubdirs
#define	PassCDebugFlags	'CDEBUGFLAGS=$(CDEBUGFLAGS)'

SUBDIRS = devices

CDEBUGFLAGS=-O -v

EXTRA_DEFINES=-DPUBLIC=  -DLIBRARY_NAME=\"LIBMACH\"\
			  -DLIBRARY_VERSION='"1.04"'\
              -DCHIPSET_NAME=\"MACH\" -DATBUS -DUSE_KD_GRAPHICS_MODE\
              -DUSE_SYSI86 -DSTATIC=static

/*
 * Instructions for profiling:
 *
 * define -DPROFILING in the EXTRA_DEFINES line.
 * set ASM_PROFILING_OPTIONS to "-- -DPROFILING".
 * Build the Archive library, if your CCS does not handle profiled
 * shared objects.
 */ 

XCOMM	Include "m_debug.[co]" if you wish to look at registers from a
XCOMM 	debugger. 

SRCS = 	generic.c g__init__.c g_colormap.c\
	   	g_gs.c g_omm.c g_regs.c\
		g_state.c\
		mach.c m__gs__.c m__init__.c\
		m__vtin__.c m__vtout__.c\
		m_asm.c m_asmblr.s m_bitblt.c\
		m_colormap.c m_cursor.c m_fill.c m_font.c m_globals.c\
		m_gs.c m_line.c m_opt.c m_points.c\
		m_regs.c m_scanline.c m_spans.c m_state.c\
		stdenv.c
	
OBJS = 	generic.o g__init__.o g_colormap.o\
	   	g_gs.o g_omm.o g_regs.o\
		g_state.o\
		mach.o m__gs__.o m__init__.o\
		m__vtin__.o m__vtout__.o\
		m_asm.o m_asmblr.o m_bitblt.o\
		m_colormap.o m_cursor.o m_fill.o m_font.o m_globals.o\
		m_gs.o m_line.o m_opt.o m_points.o\
		m_regs.o m_scanline.o m_spans.o m_state.o\
		stdenv.o
	
   INCLUDES = -I.  -I../../ddx/si -I../../../../X11 -I../../include
     LFLAGS = -buxz

#SIKIT_HEADERS = 

#if XWINSharedDisplayLibrary

SHLIBLDFLAGS = -G
SharedLibraryDepTarget(mach,1,$(OBJS),.,.,)

InstallSharedLibrary(mach,1,$(DISPLIBDIR))

#else /* XWINSharedDisplayLibrary */

CDEBUGFLAGS = ServerCDebugFlags
NormalLibraryObjectRule()
NormalLibraryTarget(mach,$(OBJS) $(VENDOROBJS))

#endif /* XWINSharedDisplayLibrary */

install::
	$(INSTALL) $(INSTALLFLAGS) README.mach $(DESTDIR)$(DISPLIBDIR)
	$(INSTALL) $(INSTALLFLAGS) LIBMACH_OPTIONS $(DESTDIR)$(DISPLIBDIR)
	
MakeSubdirs($(SUBDIRS))
ForceSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
DependTarget()

.s.o:
	$(AS)  -o $(@) -m $(ASM_PROFILING_OPTIONS) $(<)


lint: ${CFILES} ${LIBCFILES}
	$(LINT) $(LFLAGS) -Cmach $(INCLUDES) $(SRCS) >lint.out 2>&1

/*
 * Local Variables:
 * mode: text
 * tab-width: 4
 * End:
 */
