/**/#	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	"@(#)p9k:p9k/Imakefile	1.6"

/***
 ***	NAME
 ***	
 ***		Imakefile : Makefile generation template for the P9000
 ***					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	defaults.h	prefix for library's messages.
 ***		CHIPSET_NAME	defaults.h	name of the chipset
 ***		LIBRARY_VERSION defaults.h 	library version
 ***		USE_KD_GRAPHICS_MODE		Use KD driver ioctl's to switch
 ***						p9k.c		console modes.
 ***		USE_SYSI86		p9k.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 P9000 display library.
 ***
 ***	SEE ALSO
 ***
 ***		imake(1).
 ***	
 ***	CAVEATS
 ***
 ***	BUGS
 ***
 ***	AUTHORS
 ***	
 ***	HISTORY
 ***
 ***/

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

#include <sv4Lib.rules>

/** #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/viper/?*.o
DEF_VENDORDIR = ./devices/viper
#endif

/*
 * Subdirectory control.
 */

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

SUBDIRS = devices

CDEBUGFLAGS=-O -v

P9K_REVISION = 1

EXTRA_DEFINES=-DPUBLIC=  -DLIBRARY_NAME=\"LIBP9K\"\
			  -DLIBRARY_VERSION='"1.00"'\
              -DCHIPSET_NAME=\"P9K\" -DUSE_KD_GRAPHICS_MODE\
              -DUSE_SYSI86 -DSTATIC=static

#define VendorDisplayModuleRule()			@@\
.c.o:							@@\
	$(CC) -c $(CDEBUGFLAGS) $(EXTRA_DEFINES) -Xa -Dix86 $(ALLINCLUDES) $<; @@\
							@@\
all:: $(VENDORLIB) 					@@\
$(VENDORLIB):: $(OBJS)					@@\
	$(CC) $(YFLAGS) -G $(OBJS) -o $(VENDORLIB) -h $(VENDORLIB) -lm @@\
	@echo $(VENDORLIB) generated. 			@@\
							@@\
install:: all						@@\
	$(INSTALL) $(INSTLIBFLAGS) $(VENDORLIB) $(DISPLIBDIR)

/*
 * We need EXTRA_LIBS to link certain libraries with libmach.so. The
 * current rule for SharedLibraryTarget1/NormalLibraryTarget does not 
 * allow this.
 */
EXTRA_LIBS=-lc

/*
 * 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\
		p9k.c p9k__gs__.c p9k__init__.c\
		p9k__vtin__.c p9k__vtout__.c\
		p9k__hwi__.c\
		p9k_asm.c p9k_asmblr.s \
		p9k_cmap.c p9k_cursor.c p9k_stpl.c p9k_tile.c\
		p9k_font.c \
		p9k_gs.c p9k_line.c p9k_opt.c p9k_points.c\
		p9k_regs.c p9k_sline.c  p9k_state.c\
		p9k_tile.c p9k_blt.c\
		p9k_solid.c p9k_arc.c p9k_gbls.c\
		p9k_clocks.c p9k_dacs.c p9k_misc.c\
		stdenv.c

OBJS = 	generic.o g__init__.o g_colormap.o\
	   	g_gs.o g_omm.o g_regs.o\
		g_state.o\
		p9k.o p9k__gs__.o p9k__init__.o\
		p9k__vtin__.o p9k__vtout__.o\
		p9k__hwi__.o\
		p9k_asm.o p9k_asmblr.o \
		p9k_cmap.o p9k_cursor.o p9k_stpl.o p9k_tile.o\
		p9k_font.o \
		p9k_gs.o p9k_line.o p9k_opt.o p9k_points.o\
		p9k_regs.o p9k_sline.o  p9k_state.o\
		p9k_tile.o p9k_blt.o\
		p9k_solid.o p9k_arc.o p9k_gbls.o\
		p9k_clocks.o p9k_dacs.o p9k_misc.o\
		stdenv.o

   INCLUDES = -I.  -I../../ddx/si -I../../../X11 -I../../include
     LFLAGS = -buxz
  VENDORLIB = libp9k.so.$(P9K_REVISION)


#if XWINSharedDisplayLibrary
VendorDisplayModuleRule()
#else /* XWINSharedDisplayLibrary */
CDEBUGFLAGS = ServerCDebugFlags
NormalLibraryObjectRule()
NormalLibraryTarget(p9k,$(OBJS) $(VENDOROBJS))
#endif /* XWINSharedDisplayLibrary */

MakeSubdirs($(SUBDIRS))
ForceSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))

clean::
	$(RM) *.so *.so.*

DependTarget()

InstallMultipleDestFlags(install,README.p9k P9K_OPTIONS dos_util/PCIDUMP.EXE,$(DISPLIBDIR),$(INSTDATFLAGS))


install::
	$(RM) $(DISPLIBDIR)/libp9k.so

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


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

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