XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile,v 1.55 2005/10/14 15:16:41 tsi Exp $
XCOMM
XCOMM This is an Imakefile for the MGA driver.
XCOMM
/*
 * Copyright (c) 1994-2004 by The XFree86 Project, Inc.
 * All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject
 * to the following conditions:
 *
 *   1.  Redistributions of source code must retain the above copyright
 *       notice, this list of conditions, and the following disclaimer.
 *
 *   2.  Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer
 *       in the documentation and/or other materials provided with the
 *       distribution, and in the same place and form as other copyright,
 *       license and disclaimer information.
 *
 *   3.  The end-user documentation included with the redistribution,
 *       if any, must include the following acknowledgment: "This product
 *       includes software developed by The XFree86 Project, Inc
 *       (http://www.xfree86.org/) and its contributors", in the same
 *       place and form as other third-party acknowledgments.  Alternately,
 *       this acknowledgment may appear in the software itself, in the
 *       same form and location as other such third-party acknowledgments.
 *
 *   4.  Except as contained in this notice, the name of The XFree86
 *       Project, Inc shall not be used in advertising or otherwise to
 *       promote the sale, use or other dealings in this Software without
 *       prior written authorization from The XFree86 Project, Inc.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#define IHaveModules
#define IHaveSubdirs
#include <Server.tmpl>

#if BuildMatroxHal
HALSUBDIRS = hallib
#endif

SUBDIRS = $(HALSUBDIRS) util

#if BuildXF86DRI
DRISRCS = mga_dri.c
DRIOBJS = mga_dri.o
DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri -I$(DRMINCLUDESDIR)
DRIDEFINES = $(GLX_DEFINES)
#endif

#if DoLoadableServer && (HaveMatroxHal || BuildMatroxHal)
#define BuildHalModule YES
#else
#define BuildHalModule NO
#endif

#if !DoLoadableServer && UseMatroxHal && (HaveMatroxHal || BuildMatroxHal)
#define BuildHalStatic YES
#else
#define BuildHalStatic NO
#endif

#if BuildHalModule
MGAHALMODSRC = mga_halmod.c
MGAHALMODOBJ = mga_halmod.o
#endif

#if UseMatroxHal
MGAHALDEFINES = -DUSEMGAHAL
#if BuildMatroxHal
MGAHALINCLUDES = -Ihallib
#else
MGAHALINCLUDES = -IHALlib
#endif
#endif

#if BuildHalModule || BuildHalStatic
MGAHALSRCS = $(MGAHALMODSRC) clientlx.c
#if !BuildMatroxHal
MGAHALOBJS = $(MGAHALMODOBJ) clientlx.o HALlib/mgaHALlib.a
#else
MGAHALOBJS = $(MGAHALMODOBJ) clientlx.o hallib/libmga_hal.a
hallib/libmga_hal.a: $(SUBDIRS)
#endif
#endif

MGASRCS = mga_driver.c mga_hwcurs.c /* mga_cmap.c */ mga_dac3026.c mga_dacG.c \
       mga_storm8.c mga_storm16.c mga_storm24.c mga_storm32.c mga_arc.c \
       mga_dga.c mga_shadow.c mga_video.c mga_g450pll.c mga_dh.c mga_esc.c \
       mga_merge.c $(DRISRCS)
MGAOBJS = mga_driver.o mga_hwcurs.o /* mga_cmap.o */ mga_dac3026.o mga_dacG.o \
       mga_storm8.o mga_storm16.o mga_storm24.o mga_storm32.o mga_arc.o \
       mga_dga.o mga_shadow.o mga_video.o mga_g450pll.o mga_dh.o mga_esc.o \
       mga_merge.o $(DRIOBJS)

SRCS = $(MGASRCS) $(MGAHALSRCS)
OBJS = $(MGAOBJS) $(MGAHALOBJS)

#if defined(XF86DriverSDK)
INCLUDES = -I../../include $(MGAHALINCLUDES)
#else
INCLUDES = $(MGAHALINCLUDES) -I$(XF86COMSRC) -I$(XF86OSSRC) \
           -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(XF86SRC)/int10 \
           -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \
           -I$(XF86SRC)/vgahw -I$(XF86SRC)/fbdevhw \
           -I$(XF86SRC)/ramdac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \
           -I$(SERVERSRC)/Xext -I$(XF86SRC)/xf8_32bpp \
           -I$(SERVERSRC)/include -I$(XF86SRC)/shadowfb -I$(SERVERSRC)/render \
           -I$(XF86SRC)/vbe $(DRIINCLUDES)
#endif

DEFINES = $(MGAHALDEFINES) $(DRIDEFINES)

#if MakeHasPosixVariableSubstitutions
SubdirLibraryRule($(OBJS))
#endif

ModuleObjectRule()

#if BuildHalStatic
ObjectModuleTarget(mga,$(OBJS),drivers)
#else
ObjectModuleTarget(mga,$(MGAOBJS),drivers)
#endif
#if BuildHalModule
ObjectModuleTarget(mga_hal,$(MGAHALOBJS),drivers)
#endif

ObjectFromSpecialSource(mga_storm8, mga_storm, -DPSZ=8)
ObjectFromSpecialSource(mga_storm16, mga_storm, -DPSZ=16)
ObjectFromSpecialSource(mga_storm24, mga_storm, -DPSZ=24)
ObjectFromSpecialSource(mga_storm32, mga_storm, -DPSZ=32)

InstallObjectModule(mga,$(MODULEDIR),drivers)
#if BuildHalModule
InstallObjectModule(mga_hal,$(MODULEDIR),drivers)
#endif

#if !defined(XF86DriverSDK)
InstallModuleManPage(mga)
#endif

DependTarget()

InstallDriverSDKNonExecFile(Imakefile,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_arc.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_bios.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_dac3026.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_dacG.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_dga.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_driver.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_hwcurs.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_macros.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_map.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_reg.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_shadow.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_storm.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_video.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_halmod.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_common.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_dripriv.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_dri.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_merge.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_merge.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_g450pll.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_dh.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_esc.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_dri.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mgareg_flags.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_sarea.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(mga_ucode.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(client.h,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(clientlx.c,$(DRIVERSDKDIR)/drivers/mga)
InstallDriverSDKNonExecFile(HALlib/binding.h,$(DRIVERSDKDIR)/drivers/mga/HALlib)

InstallDriverSDKObjectModule(mga,$(DRIVERSDKMODULEDIR),drivers)
#if BuildMatroxHal
InstallDriverSDKObjectModule(mga_hal,$(DRIVERSDKMODULEDIR),drivers)
#endif

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