XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile,v 1.46 2003/02/17 17:06:42 dawes Exp $
XCOMM
XCOMM This is an Imakefile for the MGA driver.
XCOMM

#define IHaveModules
#include <Server.tmpl>

#if BuildMatroxHal
#define IHaveSubdirs
SUBDIRS=hallib
#endif

#if BuildXF86DRI
DRISRCS = mga_dri.c
DRIOBJS = mga_dri.o
DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri \
	-I$(TOP)/include
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. -I../../include
#else
INCLUDES = -I. $(MGAHALINCLUDES) -I$(XF86COMSRC) -I$(XF86OSSRC) \
           -I$(SERVERSRC)/fb \
           -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi -I$(XF86SRC)/int10 \
           -I$(SERVERSRC)/cfb -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$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
           -I$(XF86SRC)/xf24_32bpp -I$(XF86SRC)/shadowfb -I$(EXTINCSRC) \
	   -I$(SERVERSRC)/render \
	   -I$(XF86SRC)/vbe $(DRIINCLUDES)
#endif

DEFINES = $(MGAHALDEFINES) $(DRIDEFINES)

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

ModuleObjectRule()

#if BuildHalStatic
ObjectModuleTarget(mga,$(OBJS))
#else
ObjectModuleTarget(mga,$(MGAOBJS))
#endif
#if BuildHalModule
ObjectModuleTarget(mga_hal,$(MGAHALOBJS))
#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)

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

#if BuildMatroxHal
MakeSubdirs($(SUBDIRS))
ForceSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif
