Switch to the new "build system", to be in sync with the rest of glide.

Backport cpudtect.asm from glide3 for h3.
Add fpu.c to cvg.
This commit is contained in:
guillemj
2006-11-30 09:16:50 +00:00
parent b11bb573b0
commit 9c38a603a0
8 changed files with 1114 additions and 800 deletions

View File

@@ -196,6 +196,7 @@ GLIDE_OBJECTS = \
gtexdl.obj \
gutex.obj \
cpuid.obj \
fpu.obj \
xtexdl_def.obj
ifeq ($(USE_X86),1)

View File

@@ -0,0 +1,85 @@
/*
* FPU handling code
*
* $Id$
*
*/
/*
* This routine sets the precision to single which effects all
* adds, mults, and divs.
*/
#if defined(__i386__) || defined(__x86_64__)
void single_precision_asm()
{
#if defined(__MSC__)
__asm {
push eax ; make room
fnclex ; clear pending exceptions
fstcw WORD PTR [esp]
mov eax, DWORD PTR [esp]
and eax, 0000fcffh ; clear bits 9:8
mov DWORD PTR [esp], eax
fldcw WORD PTR [esp]
pop eax
}
#elif defined(__GNUC__)
asm("push %eax\n"
"fnclex\n"
"fstcw (%esp)\n"
"movl (%esp), %eax\n"
"and $0x0000fcff, %eax\n"
"movl %eax, (%esp)\n"
"fldcw (%esp)\n"
"pop %eax");
#else
#error "Need to implement single_precision_asm() for this compiler"
#endif
}
#else
#warning "Using a stub for single_precision_asm() for this architecture"
void single_precision_asm()
{
}
#endif
/*
* This routine sets the precision to double which effects all
* adds, mults, and divs.
*/
#if defined(__i386__) || defined(__x86_64__)
void double_precision_asm()
{
#if defined(__MSC__)
__asm {
push eax ; make room
fnclex ; clear pending exceptions
fstcw WORD PTR [esp]
mov eax, DWORD PTR [esp]
and eax, 0000fcffh ; clear bits 9:8
or eax, 000002ffh ; set 9:8 to 10
mov DWORD PTR [esp], eax
fldcw WORD PTR [esp]
pop eax
}
#elif defined(__GNUC__)
asm("push %eax\n"
"fnclex\n"
"fstcw (%esp)\n"
"movw (%esp), %eax\n"
"and $0x0000fcff, %eax\n"
"or $0x000002ff, %eax\n"
"mov %eax, (%esp)\n"
"fldcw (%esp)\n"
"pop %eax");
#else
#error "Need to implement double_precision_asm() for this compiler"
#endif
}
#else
#warning "Using a stub for double_precision_asm() for this architecture"
void double_precision_asm()
{
}
#endif

View File

@@ -1,263 +1,325 @@
# Linux makefile for Glide2/CVG
# This makefile MUST be processed by GNU make!!!
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
TAG_REGEXP = $(BUILD_ROOT)/$(FX_GLIDE_HW)/glide/src/glide.rx
# Compile for specific hardware
ifeq ($(FX_GLIDE_HW),cvg)
FX_GLIDE_REAL_HW= 1
FX_GLIDE_CTRISETUP = 0
HWSPEC = fifo.c
LCDEFS += -DCVG \
-DGLIDE_CHIP_BROADCAST=1 -DGLIDE_DEFAULT_GAMMA=1.3 \
-DGLIDE_BLIT_CLEAR=1
else
ifeq ($(FX_GLIDE_HW),h3)
FX_GLIDE_REAL_HW= 1
FX_GLIDE_NO_FIFO= 1
FX_GLIDE_CTRISETUP = 1
HWSPEC = fifo.c
LCDEFS += -DH3 \
-DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=0
else
error "FX_GLIDE_HW == unknown value (h3|cvg)"
endif
endif
ifeq ($(DEBUG),1)
DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON
GLIDE_SANITY_ALL = 1
endif
ifeq ($(FX_GLIDE_HW),)
error "FX_GLIDE_HW not defined"
endif
# Display Options
DSPOPTS =
SUBLIBRARIES =
ifeq ($(HAL_HW),1)
DSPOPTS += -DHAL_HW=1
SUBLIBRARIES += $(BUILD_ROOT)/$(FX_GLIDE_HW)/lib/libsst1init.a \
$(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \
$(BUILD_ROOT_SWLIBS)/lib/libfxpci.a
endif
ifeq ($(DSPOPTS),)
error "Unknown HAL_* configuration"
endif
# GLIDE_HW_TRI_SETUP: Use the hw TSU for triangle rendering.
# GLIDE_TRI_CULLING: Cull backfaced/zero area triangles in sw before the fifo.
# NB: This must be set if GLIDE_HW_TRI_SETUP=0
ifeq ($(FX_GLIDE_SW_SETUP),1)
LCDEFS += -DGLIDE_HW_TRI_SETUP=0 -DGLIDE_TRI_CULLING=1
FX_GLIDE_CTRISETUP = 1
else
# Do culling test in sw for independent triangles
CULL_MODE = -DGLIDE_TRI_CULLING=0
ifeq ($(FX_GLIDE_HW_CULL),1)
CULL_MODE = -DGLIDE_TRI_CULLING=1
endif
DSPOPTS += $(CULL_MODE)
# Send a single DWORD ARGB rather than 4 fp values, at
# the cost of doing the conversion.
ifeq ($(FX_GLIDE_PACK_RGB),1)
LCDEFS += -DGLIDE_PACKED_RGB=1
endif
endif
ifneq ($(FX_GLIDE_NO_FIFO),1)
FIFODEFS = -DUSE_PACKET_FIFO=1 \
-DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=1
ifeq ($(FX_GLIDE_DEBUG_FIFO),1)
# GLIDE_USE_DEBUG_FIFO: Run w/ the small fifo to cause me/glide more stress
# FIFO_ASSERT_FULL: Check hw depth/fifo a lot (slow)
LCDEFS += -DGLIDE_USE_DEBUG_FIFO=1 -DFIFO_ASSERT_FULL=1 \
-DASSERT_FAULT=0 #-DGLIDE_SANITY_SIZE=1
endif
else
FX_GLIDE_CTRISETUP = 1
FIFODEFS = -DGLIDE_HW_TRI_SETUP=1
endif
# Optimization Options
# This is for turning on and off algorithmic optimizations,
# not flags to the C compiler. Usually this involves
# enabling/disabling assembly language code, but it can also
# change the way C code works, or how C code generates data to be
# used by various pieces of code.
# Usually these are set with environment variables or arguments to
# nmake.
# $Id$
#
# Copyright (c) 2004 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Copyright (c) 2004 - Hiroshi Morii
# Email : koolsmoky@users.sourceforge.net
# Web : http://www.3dfxzone.it/koolsmoky
#
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
#
# Turn on/off assembly language trisetup code.
# (C on is Assembly off) (A ssembly T ri S etup OPTS)
ifeq ($(FX_GLIDE_CTRISETUP),1)
ASMTRISETUP =
ATSOPTS = -DGLIDE_USE_C_TRISETUP
CFILES = gxdraw.c
else
ASMTRISETUP = xdraw2.S
DSPOPTS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_PACKED_RGB=0
endif
OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS)
# local defines, begin with basics and then add on
LCDEFS += -DGLIDE_LIB
ifeq ($(FX_GLIDE_CRYBABY),1)
LCDEFS += -DGLIDE_CHECK_COMPATABILITY=1
endif
# Turn Off/On compilation of shameless plug
ifeq ($(FX_GLIDE_NO_PLUG),1)
else
LCDEFS += -DGLIDE_PLUG
endif
# Turn Off/On splash screen
ifeq ($(FX_GLIDE_NO_SPLASH),1)
else
LCDEFS += -DGLIDE_SPLASH
endif
#Glide 3 Stuff, for migration all
ifneq ($(FX_GLIDE3),)
LCDEFS += -DGLIDE3
GLIDE3FILES = gstrip.c distrip.c distate.c diget.c
endif
#Glide 3. remove migration stuff
ifneq ($(FX_GLIDE3_ALPHA),)
LCDEFS += -DGLIDE3_ALPHA
GLIDE3FILES = gstrip.c distrip.c distate.c diget.c
endif
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_SIZE),)
LCDEFS += -DGLIDE_SANITY_SIZE
endif
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_ASSERT),)
LCDEFS += -DGLIDE_SANITY_ASSERT
endif
# Local Defs, Includes, and Options (C)
LCINCS += -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LCOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
# Local Defs, Includes, and Options (ASM)
LADEFS += $(ASM_REGMAP_DEFS)
LAINCS = -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
AFILES = $(ASMTRISETUP)
# sources
HEADERS = glide.h gump.h glidesys.h glideutl.h
PRIVATE_HEADERS = fxglide.h gsstdef.h fxinline.h
INSTALL_DESTINATION = $(BUILD_ROOT)/$(FX_GLIDE_HW)
CFILES += gsplash.c g3df.c gu.c guclip.c gpci.c gump.c\
diglide.c disst.c ditex.c gbanner.c gerror.c\
gmovie.c digutex.c ddgump.c gaa.c gdraw.c\
gglide.c glfb.c gsst.c gtex.c gtexdl.c\
gutex.c $(HWSPEC) $(GLIDE3FILES) \
cpudetect.c
OFILES = $(CFILES:.c=.o)
OTHER_CFILES = fxgasm.c fxbldno.c fxinline.h
CODFILES = $(CFILES:.c=.cod)
# targets
LDIRT = fxgasm.o fxgasm fxgasm.h fxinline.h fxbldno.o fxbldno fxbldno.h
ifeq ($(FX_GLIDE3),1)
LIBRARIES = libglide3.a
SHARED_LIBRARY = libglide3.so.3.01
else
LIBRARIES = libglide.a
SHARED_LIBRARY = libglide.so.2.53
endif
RCFILE = glide.rc
# Make a static link library for things like the diags.
ifeq ($(FX_DLL_BUILD),1)
FX_DLL_LIBRARY = 1
else
LCDEFS += -DFX_STATIC_BUILD
endif
LCDEFS += $(FIFODEFS)
include $(BUILD_ROOT)/swlibs/include/make/3dfx.mak
codfiles: $(CODFILES)
ctags: $(CFILES)
ctags $(CFILES)
gbanner.o : banner.inc
gsplash.o : splshdat.c
#--------------------------------------------------------------------------
# special rules for making FXGASM.H
#
fxgasm: fxgasm.c $(HEADERS) gsstdef.h fxglide.h
$(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
-I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include -I$(BUILD_ROOT)/swlibs/include $(LDFLAGS)
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (cvg).
# default = cvg
# CPU optimize for the given processor.
# default = 6 (PentiumPro)
# DEBUG=1 disable optimizations and build for debug.
# default = no
# USE_X86=1 use assembler triangle specializations; req by CVG
# default = yes
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# default = no
# USE_MMX=1 allow MMX specializations.
# default = no
# FXOEM2X=1 build fxoem2x.so
# default = no
#
# Targets:
# all: build everything
# glide2x: build Glide2x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide2x clean realclean
.INTERMEDIATE: fxgasm
.SUFFIXES: .lo
export PATH := $(PATH):.
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_VERSION_MAJOR = 2
GLIDE_VERSION_MINOR = 53
GLIDE_LIB = libglide.a
GLIDE_SO = libglide.so
GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR)
GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR)
FX_GLIDE_HW ?= cvg
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
CP = cp
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -DINIT_LINUX -D__3Dfx_PCI_CFG__
LDLIBS = -lm
# general
CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=1 -DGLIDE_TRI_CULLING=1 -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1
#CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE3_SCALER
# special sli buffer clears
CDEFS += -DGLIDE_BLIT_CLEAR=1
# workaround for CVGs with broken tsus which cannot send commands to multiple
# tmus using chipfield. chipfield will always be set to 0xf
CDEFS += -DGLIDE_CHIP_BROADCAST=1
# subsystem
CDEFS += -DCVG
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
override USE_FIFO = 1
#override USE_X86 = 1
ifeq ($(USE_X86),1)
CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1
override USE_FIFO = 1
else
CDEFS += -DGLIDE_USE_C_TRISETUP=1
endif
# fifo
ifeq ($(USE_FIFO),1)
CDEFS += -DUSE_PACKET_FIFO=1 -DGLIDE_PACKET3_TRI_SETUP=1
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O6 -felf -D__linux__
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
CFLAGS += -I. -I../../incsrc -I../../init
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += $(CDEFS)
# cpu optimized triangle
ifeq ($(USE_MMX),1)
CFLAGS += -DGL_MMX
override USE_X86 = 1
endif
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifeq ($(USE_X86),1)
CFLAGS += -DGL_X86
OPTFLAGS ?= -O2 -ffast-math
else
CFLAGS += -DGLIDE_USE_C_TRISETUP
OPTFLAGS ?= -O2 -ffast-math
endif
# optflags
CFLAGS += $(OPTFLAGS)
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
fifo.o \
gsplash.o \
g3df.o \
gu.o \
guclip.o \
gpci.o \
gump.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gmovie.o \
digutex.o \
ddgump.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
gutex.o \
cpuid.o \
fpu.o \
xtexdl_def.o
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.o
ifeq ($(USE_MMX),1)
GLIDE_OBJECTS += \
xtexdl_mmx.o
endif
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.o \
xtexdl_3dnow.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
GLIDE_OBJECTS += \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \
../../init/canopus.o \
../../init/dac.o \
../../init/gamma.o \
../../init/gdebug.o \
../../init/info.o \
../../init/parse.o \
../../init/print.o \
../../init/sli.o \
../../init/sst1init.o \
../../init/util.o \
../../init/video.o
# FIXME: needed for now to match the old library signature, should be checked
# if it's really needed.
GLIDE_OBJECTS += \
$(FX_GLIDE_SW)/fxmisc/fxos.o \
$(FX_GLIDE_SW)/fxmisc/fximg.o
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.c.lo:
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $<
###############################################################################
# main
###############################################################################
all: glide2x fxoem2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
ifeq ($(FXOEM2X),1)
$(GLIDE_LIBDIR)/libfxoem2x.so: ../oem/oeminit.o
# $(LD) -o $@ $(LDFLAGS) ../oem/oeminit.o $(LDLIBS)
else
$(GLIDE_LIBDIR)/libfxoem2x.so:
# $(warning FxOem2x not enabled... Skipping libfxoem2x.so)
endif
fxoem2x: $(GLIDE_LIBDIR)/libfxoem2x.so
###############################################################################
# rules(2)
###############################################################################
#cpuid.o: cpudtect.asm
# $(AS) -o $@ $(ASFLAGS) $<
xdraw2_def.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xtexdl_def.o: xtexdl.c
$(CC) -o $@ $(CFLAGS) -c $<
xtexdl_mmx.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $<
xdraw2_3dnow.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
#cpuid.lo: cpuid.o
# $(CP) $< $@
xdraw2_def.lo: xdraw2_def.o
$(CP) $< $@
xtexdl_def.lo: xtexdl_def.o
$(CP) $< $@
xtexdl_mmx.lo: xtexdl_mmx.o
$(CP) $< $@
xdraw2_3dnow.lo: xdraw2_3dnow.o
$(CP) $< $@
xtexdl_3dnow.lo: xtexdl_3dnow.o
$(CP) $< $@
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm
./$< -inline > $@
fxgasm.h: fxgasm
./fxgasm > fxgasm.h
fxinline.h: fxgasm
./fxgasm -inline > fxinline.h
./$< -hex > $@
#--------------------------------------------------------------------------
# special rules for making FXBLDNO.H
#
fxgasm: fxgasm.c
$(CC) -o $@ $(CFLAGS) $<
fxbldno: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS)
$(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS)
###############################################################################
# clean, realclean
###############################################################################
fxbldno.h: fxbldno.exe
fxbldno > fxbldno.h
clean:
-$(RM) *.o *.lo
-$(RM) ../../init/*.o ../../init/*.lo
-$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo
-$(RM) fxinline.h
-$(RM) fxgasm.h
glide.res: rcver.h fxbldno.h
gglide.obj: rcver.h
ifeq ($(FX_GLIDE_CTRISETUP),1)
gdraw.o: fxinline.h
endif
xdraw2.o : xdraw2.S xdraw2.inc.S fxgasm.h fxinline.h
gasp xdraw2.S $(ASM_OPTS) $(LAOPTS) | as -V -Qy -o xdraw2.o
cpudtect.o :
gasp cpudtect.S $(LAOPTS) | as -V -Qy -o cpudtect.o
realclean: clean
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)

View File

@@ -19,9 +19,15 @@
;;
;; $Header$
;; $Log$
;; Revision 1.1.1.1.8.1 2003/11/07 13:38:38 dborca
;; unite the clans
;;
;; Revision 1.1.1.1 1999/11/24 21:44:53 joseph
;; Initial checkin for SourceForge
;;
;;
;; 3 3/17/99 6:14p Dow
;; Phantom Menace and other fixes.
;; 4 4/06/99 3:54p Dow
;; Alt tab again.
;;
;; 9 3/10/99 10:40a Peter
;; detect katmai-ness
@@ -45,10 +51,7 @@
;;
;;
TITLE cpudtect.asm
.586P
.model FLAT,C ; Flat memory, mangle publics with leading '_'
%include "xos.inc"
;; Data for data segment goes here
;_DATA SEGMENT DWORD USE32 PUBLIC 'DATA';
@@ -56,14 +59,14 @@ TITLE cpudtect.asm
;;; Some useful constants
; CPU Type
CPUTypeUnknown = 0ffffffffh
CPUTypePrePent = 4h
CPUTypeP5 = 5h
CPUTypeP6 = 6h
CPUTypeUnknown equ 0ffffffffh
CPUTypePrePent equ 4h
CPUTypeP5 equ 5h
CPUTypeP6 equ 6h
;;; References to external data:
_TEXT SEGMENT
segment TEXT
;;
;; _cpu_detect_asm - detect the type of CPU
;;
@@ -73,10 +76,8 @@ _TEXT SEGMENT
;;
;; returns 4 for non-pen
PUBLIC _cpu_detect_asm
_cpu_detect_asm PROC NEAR
proc _cpu_detect_asm
P6Stuff:
.586
push esi ; save registers that are not volatile
push edi
push ebx
@@ -276,45 +277,38 @@ UnknownVendor:
jmp DoneCpu
_cpu_detect_asm ENDP
endp
;------------------------------------------------------------------------------
; this routine sets the precision to single
; which effects all adds, mults, and divs
align 4 ;
PUBLIC single_precision_asm
single_precision_asm PROC NEAR
.586
proc single_precision_asm
push eax ; make room
fnclex ; clear pending exceptions
fstcw WORD PTR [esp]
mov eax, DWORD PTR [esp]
fstcw WORD [esp]
mov eax, DWORD [esp]
and eax, 0000fcffh ; clear bits 9:8
mov DWORD PTR [esp], eax
fldcw WORD PTR [esp]
mov DWORD [esp], eax
fldcw WORD [esp]
pop eax
ret 0
single_precision_asm ENDP
ret
endp
;------------------------------------------------------------------------------
; this routine sets the precision to double
; which effects all adds, mults, and divs
align 4 ;
PUBLIC double_precision_asm
double_precision_asm PROC NEAR
.586
proc double_precision_asm
push eax ; make room
fnclex ; clear pending exceptions
fstcw WORD PTR [esp]
mov eax, DWORD PTR [esp]
fstcw WORD [esp]
mov eax, DWORD [esp]
and eax, 0000fcffh ; clear bits 9:8
or eax, 000002ffh ; set 9:8 to 10
mov DWORD PTR [esp], eax
fldcw WORD PTR [esp]
mov DWORD [esp], eax
fldcw WORD [esp]
pop eax
ret 0
double_precision_asm ENDP
_TEXT ENDS
END
ret
endp

View File

@@ -1,279 +1,318 @@
# Linux makefile for Glide2/H3
# This makefile MUST be processed by GNU make!!!
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
ifeq ($(FX_CHRIS_DENIS_ANTHONY_HACK),1)
LCDEFS += -DCHRIS_DENIS_ANTHONY_HACK=1
endif
FX_TACO_MEMORY_FIFO_HACK =
ifneq ($(FX_TACO_MEMORY_FIFO_HACK),)
LCDEFS += -DTACO_MEMORY_FIFO_HACK
endif
ifneq ($(DIAG_BUILD),)
LCDEFS += -DDIAG_BUILD
endif
# This is a bit of a red herring
ifeq ($(FX_GLIDE_DIRECT_WRITE),1)
FX_GLIDE_DIRECT_WRITE = 1
LCDEFS += -DDIRECT_IO=1
else
FX_GLIDE_PACKET_FIFO = 1
endif
ifeq ($(FX_GLIDE_PACKET_FIFO),1)
CMDXPORTDEFS = -DGLIDE_PACKET3_TRI_SETUP=1 -DUSE_PACKET_FIFO=1 -DGLIDE_HW_TRI_SETUP=1
else
CMDXPORTDEFS = -DUSE_PACKET_FIFO=0 -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=0
FX_GLIDE_DEBUG_FIFO=1
endif
FX_GLIDE_REAL_HW= 1
FX_GLIDE_NO_FIFO= 1
ifneq ($(FX_GLIDE_CTRISETUP),1)
FX_GLIDE_CTRISETUP = 0
endif
HWSPEC = fifo.c
LCDEFS += -DH3 $(CMDXPORTDEFS)
INITLIB = $(BUILD_ROOT)/$(FX_GLIDE_HW)/lib$(FX_GLIDE_HW)init.a
ifeq ($(DEBUG),1)
DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON
GLIDE_SANITY_ALL = 1
endif
ifeq ($(FX_GLIDE_HW),)
error "FX_GLIDE_HW not defined"
endif
# Display Options
DSPOPTS =
SUBLIBRARIES =
DSPOPTS += -DGLIDE_INIT_HWC
ifeq ($(HAL_HW),1)
DSPOPTS += -DHAL_HW=1
SUBLIBRARIES += $(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \
$(BUILD_ROOT_SWLIBS)/lib/libfxpci.a \
$(BUILD_ROOT)/$(FX_GLIDE_HW)/lib/libminihwc.a
LINKLIBRARIES += -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm
endif
ifeq ($(HAL_HW),)
SUBLIBRARIES += $(BUILD_ROOT)/h3/lib/libminihwc.a
endif
# 3DNow stuff
GL_AMD3D = 1
ifneq ($(GL_AMD3D),)
LCDEFS += -DGL_AMD3D
LIBOBJS += xtexdl_3dnow.o
CFILES += xtexdl_def.c
endif
# Do culling test in sw for independent triangles
CULL_MODE =
ifneq ($(FX_GLIDE_HW_CULL),1)
CULL_MODE = -DGLIDE_TRI_CULLING=1
endif
DSPOPTS += $(CULL_MODE)
# Send a single DWORD ARGB rather than 4 fp values, at
# the cost of doing the conversion.
ifeq ($(FX_GLIDE_PACK_RGB),1)
LCDEFS += -DGLIDE_PACKED_RGB=1
endif
ifneq ($(FX_GLIDE_NO_FIFO),1)
FIFODEFS = -DUSE_PACKET_FIFO=1
ifeq ($(FX_GLIDE_DEBUG_FIFO),1)
# GLIDE_USE_DEBUG_FIFO: Run w/ the small fifo to cause me/glide more stress
# FIFO_ASSERT_FULL: Check hw depth/fifo a lot (slow)
LCDEFS += -DGLIDE_USE_DEBUG_FIFO=1 -DFIFO_ASSERT_FULL=1 -DASSERT_FAULT=0 -DGLIDE_SANITY_SIZE=1
endif
endif
# Optimization Options
# This is for turning on and off algorithmic optimizations,
# not flags to the C compiler. Usually this involves
# enabling/disabling assembly language code, but it can also
# change the way C code works, or how C code generates data to be
# used by various pieces of code.
# Usually these are set with environment variables or arguments to
# nmake.
# $Id$
#
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
#
# Turn on/off assembly language trisetup code.
# (C on is Assembly off) (A ssembly T ri S etup OPTS)
ifeq ($(FX_GLIDE_CTRISETUP),1)
ASMTRISETUP =
ATSOPTS = -DGLIDE_USE_C_TRISETUP
CFILES = gxdraw.c
else
DSPOPTS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_PACKED_RGB=0
ifeq ($(GL_AMD3D),)
ASMTRISETUP = xdraw2.S
else
LIBOBJS += xdraw2_def.o xdraw2_3dnow.o
endif #GL_AMD3D
endif
OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS)
# local defines, begin with basics and then add on
LCDEFS += -DGLIDE_LIB
# Turn Off/On compilation of shameless plug
ifeq ($(FX_GLIDE_NO_PLUG),1)
else
LCDEFS += -DGLIDE_PLUG
endif
# Turn Off/On splash screen
ifeq ($(FX_GLIDE_NO_SPLASH),1)
else
LCDEFS += -DGLIDE_SPLASH
endif
#Glide 3 Stuff, for migration all
ifneq ($(FX_GLIDE3),)
LCDEFS += -DGLIDE3
GLIDE3FILES = gstrip.c distrip.c distate.c diget.c
endif
#Glide 3. remove migration stuff
ifneq ($(FX_GLIDE3_ALPHA),)
LCDEFS += -DGLIDE3_ALPHA
GLIDE3FILES = gstrip.c distrip.c distate.c diget.c
endif
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_SIZE),)
LCDEFS += -DGLIDE_SANITY_SIZE
endif
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_ASSERT),)
LCDEFS += -DGLIDE_SANITY_ASSERT
endif
# Local Defs, Includes, and Options (C)
LCINCS += -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LCOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
# Local Defs, Includes, and Options (ASM)
LADEFS += $(ASM_REGMAP_DEFS)
LAINCS = -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
AFILES = $(ASMTRISETUP) cpudtect.S
# sources
HEADERS = glide.h gump.h glidesys.h glideutl.h
PRIVATE_HEADERS = fxglide.h gsstdef.h fxinline.h fxsplash.h
INSTALL_DESTINATION = $(BUILD_ROOT)/$(FX_GLIDE_HW)
CFILES += gsplash.c g3df.c gu.c guclip.c\
gpci.c gump.c diglide.c disst.c ditex.c\
gbanner.c gerror.c gmovie.c digutex.c ddgump.c\
gaa.c gdraw.c gglide.c glfb.c gsst.c gtex.c\
gtexdl.c gutex.c $(HWSPEC) $(GLIDE3FILES)
OFILES = $(CFILES:.c=.o)
OTHER_CFILES = fxgasm.c fxbldno.c fxinline.h
# targets
LDIRT = fxgasm.o fxgasm fxgasm.h fxinline.h fxbldno.o fxbldno fxbldno.h
ifeq ($(FX_GLIDE3),1)
LIBRARIES = libglide3.a
SHARED_LIBRARY = libglide3.so.3.10
else
LIBRARIES = libglide.a
SHARED_LIBRARY = libglide.so.2.60
endif
RCFILE = glide.rc
# Make a static link library for things like the diags.
ifeq ($(FX_DLL_BUILD),1)
FX_DLL_LIBRARY = 1
else
LCDEFS += -DFX_STATIC_BUILD
endif
LCDEFS += $(FIFODEFS)
include $(BUILD_ROOT)/swlibs/include/make/3dfx.mak
ctags: $(CFILES)
ctags $(CFILES)
gbanner.obj : banner.inc
gsplash.obj : splshdat.c
#--------------------------------------------------------------------------
# special rules for making FXGASM.H
#
fxgasm: fxgasm.c $(HEADERS) gsstdef.h fxglide.h makefile.linux
$(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
-I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include -I$(BUILD_ROOT)/swlibs/include \
$(LDFLAGS)
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (h3).
# default = h3
# DRI=1 Build DRI version.
# default = no
# XPATH specify X libraries path; needed by DRI.
# default = /usr/X11R6/lib
# H4=1 High speed Avenger.
# default = no
# OPTFLAGS pass given optimization flags to compiler
# default = -O2 -ffast-math
# DEBUG=1 enable debugging checks and messages
# default = no
# USE_X86=1 use assembler triangle specializations!
# default = no
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# default = no
#
# Targets:
# all: build everything
# glide2x: build Glide2x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide2x clean realclean
.INTERMEDIATE: fxgasm
.SUFFIXES: .lo
export PATH := $(PATH):.
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_VERSION_MAJOR = 2
GLIDE_VERSION_MINOR = 60
GLIDE_LIB = libglide.a
GLIDE_SO = libglide.so
GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR)
GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR)
FX_GLIDE_HW ?= h3
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
CP = cp
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__linux__
XPATH ?= /usr/X11R6/lib
ifeq ($(DRI),1)
CDEFS += -DDRI_BUILD -DX11
LDFLAGS = -L$(XPATH)
LDLIBS = -lX11 -lXext -lXxf86dga -lXxf86vm
endif
LDLIBS += -lm
# general
CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1
CDEFS += -DENDB -DGLIDE_LIB -DFX_STATIC_BUILD -DHAL_HW=1
#CDEFS += -DGLIDE_CHECK_CONTEXT
# subsystem
CDEFS += -DH3
ifdef H4
CDEFS += -DH4
endif
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
override USE_FIFO = 1
#override USE_X86 = 1
ifeq ($(USE_X86),1)
CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1
override USE_FIFO = 1
else
CDEFS += -DGLIDE_USE_C_TRISETUP=1
endif
# fifo
ifeq ($(USE_FIFO),1)
CDEFS += -DUSE_PACKET_FIFO=1 -DGLIDE_PACKET3_TRI_SETUP=1
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
# obsolete options
# -DDIAG_BUILD
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O6 -felf -D__linux__
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
CFLAGS += -I. -I../../incsrc -I../../minihwc -I../../cinit
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += $(CDEFS)
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifeq ($(USE_X86),1)
CFLAGS += -DGL_X86
OPTFLAGS ?= -O2 -ffast-math
else
CFLAGS += -DGLIDE_USE_C_TRISETUP
OPTFLAGS ?= -O2 -ffast-math
endif
# optflags
CFLAGS += $(OPTFLAGS)
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
fifo.o \
gsplash.o \
g3df.o \
gu.o \
guclip.o \
gpci.o \
gump.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gmovie.o \
digutex.o \
ddgump.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
gutex.o \
cpuid.o \
xtexdl_def.o
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.o \
xdraw3_def.o
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.o \
xdraw3_3dnow.o \
xtexdl_3dnow.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
GLIDE_OBJECTS += \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o \
../../minihwc/hwcio.o \
../../minihwc/gdebug.o
# FIXME: needed for now to match the old library signature, should be checked
# if it's really needed.
GLIDE_OBJECTS += \
$(FX_GLIDE_SW)/fxmisc/fxos.o \
$(FX_GLIDE_SW)/fxmisc/fximg.o
ifeq ($(DRI),1)
GLIDE_OBJECTS += \
../../minihwc/linhwc.o \
$(FX_GLIDE_SW)/fxmisc/linutil.o
else
GLIDE_OBJECTS += \
../../minihwc/minihwc.o \
../../minihwc/lin_mode.o \
../../cinit/h3cinit.o
endif
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.c.lo:
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $<
.S.o:
$(CC) -o $@ $(CFLAGS) -c $<
.s.o:
$(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
###############################################################################
# main
###############################################################################
all: glide2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
###############################################################################
# rules(2)
###############################################################################
cpuid.o: cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw2_def.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw3_def.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw2_3dnow.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdraw3_3dnow.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
cpuid.lo: cpuid.o
$(CP) $< $@
xdraw2_def.lo: xdraw2_def.o
$(CP) $< $@
xdraw3_def.lo: xdraw3_def.o
$(CP) $< $@
xdraw2_3dnow.lo: xdraw2_3dnow.o
$(CP) $< $@
xdraw3_3dnow.lo: xdraw3_3dnow.o
$(CP) $< $@
xtexdl_3dnow.lo: xtexdl_3dnow.o
$(CP) $< $@
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm
./$< -inline > $@
fxgasm.h: fxgasm
./fxgasm -hex > fxgasm.h
fxinline.h: fxgasm
./fxgasm -inline > fxinline.h
./$< -hex > $@
fxgasm: fxgasm.c
$(CC) -o $@ $(CFLAGS) $<
#--------------------------------------------------------------------------
# special rules for making FXBLDNO.H
#
###############################################################################
# clean, realclean
###############################################################################
fxbldno: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS)
$(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS)
clean:
-$(RM) *.o *.lo
-$(RM) ../../cinit/*.o ../../cinit/*.lo
-$(RM) ../../minihwc/*.o ../../minihwc/*.lo
-$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo
-$(RM) $(FX_GLIDE_SW)/fxmisc/linutil.o $(FX_GLIDE_SW)/fxmisc/linutil.lo
-$(RM) fxinline.h
-$(RM) fxgasm.h
fxbldno.h: fxbldno
./fxbldno > fxbldno.h
ifneq ($(FX_GLIDE_CTRISETUP),1)
gdraw.o: fxinline.h
endif
xdraw2.o : xdraw2.S xdraw2.inc.S fxgasm.h fxinline.h
$(CC) -c -o xdraw2.o $(AFLAGS) xdraw2.S
cpudtect.o : cpudtect.S
$(CC) -c -o cpudtect.o $(AFLAGS) cpudtect.S
ifneq ($(GL_AMD3D),)
xdraw2_def.o: xdraw2.S xdraw2.inc.S fxgasm.h
$(CC) -c -o $@ $(AFLAGS) xdraw2.S
xdraw2_3dnow.o: xdraw2.S xdraw2.inc.S fxgasm.h
$(CC) -c -o $@ $(AFLAGS) -DGL_AMD3D -DUSE_PACKET_FIFO xdraw2.S
xtexdl_3dnow.o: xtexdl.S fxgasm.h
$(CC) -c -o $@ $(AFLAGS) -DGL_AMD3D -DUSE_PACKET_FIFO xtexdl.S
endif
realclean: clean
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)

View File

@@ -1,62 +1,77 @@
# Linux makefile for Glide2 and Texus2
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
# $Id$
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
# $Revision$
# $Date$
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
#
export TOPDIR := $(shell pwd)
THISDIR = devel
SUBDIRS = swlibs
#
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3).
# default = h3
# DRI=1 Build DRI version.
# target = h3
# default = no
# XPATH specify X libraries path; needed by DRI.
# target = h3
# default = /usr/X11R6/lib
# H4=1 High speed Avenger/Napalm.
# target = h3
# default = no
# OPTFLAGS pass given optimization flags to compiler
# target = sst1, sst96, cvg, h3
# default = -O2 -ffast-math
# DEBUG=1 enable debugging checks and messages
# target = sst1, sst96, cvg, h3
# default = no
# USE_X86=1 use assembler triangle specializations
# target = sst1, sst96, cvg, h3
# default = no
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# target = cvg, h3
# default = no
# USE_MMX=1 (see USE_3DNOW)
# target = h3
# default = no
# TEXUS2=1 embed Texus2 functions into Glide2.
# target = sst1, sst96, cvg, h3
# default = no
#
# Targets:
# all: build everything
# clean: remove object files
# realclean: remove all generated files
#
# We branched glide starting w/ Voodoo2(aka CVG) so
# make sure that the right thing happens. If this sort
# of branching happens again then add it to the list below.
ifeq ($(FX_GLIDE_HW),sst1)
SUBDIRS += sst1
.PHONY: all clean realclean
.EXPORT_ALL_VARIABLES:
export BUILD_NUMBER = 40404
export FX_GLIDE_HW ?= h3
ifeq ($(FX_GLIDE_HW),sst96)
G3_DIR = sst1/glide/src
else
ifeq ($(FX_GLIDE_HW),sst96)
SUBDIRS += sst1
else
ifeq ($(FX_GLIDE_HW),cvg)
SUBDIRS += cvg
else
ifeq ($(FX_GLIDE_HW),h3)
SUBDIRS += h3
else
FX_GLIDE_HW = h3
SUBDIRS += h3
endif
endif
endif
G3_DIR = $(FX_GLIDE_HW)/glide/src
endif
#
# Other variables we need to set
#
export FX_HW_PROJECTS=glide
ifeq ($(HAL_HW),)
export HAL_HW=1
endif
export FX_NO_GET_BOF=1
export FX_GLIDE_HW
export SCRIPTDIR=$(TOPDIR)/swlibs/include/make
all:
make -f makefile.linux -C $(G3_DIR)
include swlibs/include/make/3dfx.mak
clean:
make -f makefile.linux -C $(G3_DIR) clean
realclean:
make -f makefile.linux -C $(G3_DIR) realclean

View File

@@ -1,23 +1,3 @@
/*
* THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
* PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
* TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
* INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
* DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
* THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
* FULL TEXT OF THE NON-WARRANTY PROVISIONS.
*
* USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
* RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
* TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
* AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
* SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
* THE UNITED STATES.
*
* COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
*/
#ifndef __FX_INLINE_H__
#define __FX_INLINE_H__

View File

@@ -1,199 +1,337 @@
# Linux makefile for Glide2/SST1
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
# $Id$
#
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
#
# local defines, options, includes
# Stuff for debugging
ifneq ($(DEBUG),)
DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON
GLIDE_SANITY_ALL = 1
endif
# Display Options (Hardware)
DSPOPTS = -DGLIDE_HARDWARE
#
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (sst1, sst96).
# default = sst1
# XPATH specify X libraries path; needed for sst96.
# default = /usr/X11R6/lib (sst96 only)
# OPTFLAGS pass given optimization flags to compiler
# default = -O1 -ffast-math
# DEBUG=1 enable debugging checks and messages
# default = no
# USE_X86=1 use assembler triangle specializations!
# default = no
#
# Targets:
# all: build everything
# glide2x: build Glide2x lib
# clean: remove object files
# realclean: remove all generated files
#
# Compile for specific hardware
.PHONY: all glide3x clean realclean
.INTERMEDIATE: fxgasm
.SUFFIXES: .lo
export PATH := $(PATH):.
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_VERSION_MAJOR = 2
GLIDE_VERSION_MINOR = 46
GLIDE_LIB = libglide.a
GLIDE_SO = libglide.so
GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR)
GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR)
FX_GLIDE_HW ?= sst1
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
CP = cp
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -DINIT_LINUX
XPATH ?= /usr/X11R6/lib
ifeq ($(FX_GLIDE_HW),sst96)
HWSPEC = sst96.c
LCDEFS += -DSST96 -DGLIDE_USE_ALT_REGMAP
ASMTRISETUP = xdraw96.S
# LIBOBJS = xdraw96.o
FX_GLIDE_FIFO96 = 1
FX_GLIDE_GROUP_WRITE=1
# Turn on the alternate fifo handling code
ifeq ($(FX_SST96_ALT_FIFO),1)
LCDEFS += -DSST96_ALT_FIFO_WRAP
LDFLAGS = -L$(XPATH)
LDLIBS = -lX11 -lXxf86dga -lXxf86rush -lXxf86vm
endif
else # Default to SST1
LCDEFS += -DSST1
LADEFS += /DSST1
ASMTRISETUP = xdraw.S
# LIBOBJS = xdraw.o
endif
LDLIBS += -lm
# Optimization Options
# This is for turning on and off algorithmic optimizations,
# not flags to the C compiler. Usually this involves
# enabling/disabling assembly language code, but it can also
# change the way C code works, or how C code generates data to be
# used by various pieces of code.
# Usually these are set with environment variables or arguments to
# nmake.
#
# general
CDEFS += -DGLIDE_HARDWARE -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1
# SST96 has no notion of alternate register mapping
ifneq ($(FX_GLIDE_HW),sst96)
# Turn on/off alt register set. (G lide R eg M ap OPTS)
ifeq ($(FX_GLIDE_REG_MAP),ORIG)
GRMOPTS = -DGLIDE_USE_ALT_REGMAP
ASM_REGMAP_DEFS = -DGLIDE_USE_ALT_REGMAP
# subsystem
ifeq ($(FX_GLIDE_HW),sst1)
CDEFS += -DSST1
else
endif
endif
# Turn on/off assembly language trisetup code.
# (C on is Assembly off) (A ssembly T ri S etup OPTS)
ifeq ($(FX_GLIDE_CTRISETUP),1)
ASMTRISETUP =
ATSOPTS = -DGLIDE_USE_C_TRISETUP
LIBOBJS =
endif
OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS)
# local defines, begin with basics and then add on
LCDEFS += -DGLIDE_LIB
# Turn Off/On compilation of shameless plug
ifneq ($(FX_GLIDE_NO_PLUG),1)
LCDEFS += -DGLIDE_PLUG
endif
# Turn Off/On splash screen
ifneq ($(FX_GLIDE_NO_SPLASH),1)
LCDEFS += -DGLIDE_SPLASH
endif
# Turn On group writes
ifneq ($(FX_GLIDE_GROUP_WRITE),)
LCDEFS += -DGROUP_WRITE
endif
ifeq ($(FX_GLIDE_FIFO96),1)
LCDEFS += -DSST96_FIFO
endif
ifdef GLIDE_SANITY_ALL
GLIDE_SANITY_SIZE = $(GLIDE_SANITY_ALL)
GLIDE_SANITY_ASSERT = $(GLIDE_SANITY_ALL)
endif
ifdef GLIDE_SANITY_SIZE
LCDEFS += -DGLIDE_SANITY_SIZE
endif
ifdef GLIDE_SANITY_ASSERT
LCDEFS += -DGLIDE_SANITY_ASSERT
endif
# Local Defs, Includes, and Options (C)
LCINCS = -I$(SST1INC)
LCOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
# Local Defs, Includes, and Options (ASM)
LADEFS += $(ASM_REGMAP_DEFS)
LAINCS = -I$(SST1INC)
LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
AFILES = $(ASMTRISETUP)
# sources
HEADERS = glide.h gump.h glidesys.h glideutl.h
PRIVATE_HEADERS = fxglide.h gsstdef.h
INSTALL_DESTINATION = $(BUILD_ROOT_HW)
CFILES = gsplash.c g3df.c gu.c guclip.c gpci.c gump.c\
diglide.c disst.c ditex.c gbanner.c gerror.c\
gmovie.c digutex.c ddgump.c gaa.c gdraw.c\
gglide.c glfb.c gsst.c gtex.c gtexdl.c\
gutex.c gxdraw.c $(HWSPEC) \
cpudetect.c
OFILES = $(CFILES:.c=.o)
OTHER_CFILES = fxgasm.c
CODFILES = $(CFILES:.c=.cod)
SST1INC = $(BUILD_ROOT_HW)/include
SWLIBSINC = $(BUILD_ROOT_SWLIBS)/include
# sublibs for hardware
SUBLIBRARIES = \
$(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \
$(BUILD_ROOT_SWLIBS)/lib/libfxpci.a \
$(BUILD_ROOT_HW)/lib/libinit.a \
$(BUILD_ROOT_HW)/lib/libsst1.a \
$(BUILD_ROOT_HW)/lib/libinit96.a
LINKLIBRARIES+=-lm
ifeq ($(FX_GLIDE_HW),sst96)
LINKLIBRARIES += -L$(XLOCATION)/lib -lX11 -lXext \
-lXxf86rush -lXxf86dga -lXxf86vm
CDEFS += -DSST96
CDEFS += -DSST96_FIFO
#CDEFS += -DSST96_ALT_FIFO_WRAP
#CDEFS += -DINIT96VGASWAP -DINIT_ACCESS_DIRECT
CDEFS += -DGLIDE_USE_ALT_REGMAP
endif
endif
# targets
LDIRT = fxgasm.o fxgasm fxgasm.h
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
LIBRARIES = libglide.a
SHARED_LIBRARY = libglide.so.2.46
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak
###############################################################################
# flags
###############################################################################
fxgasm : fxgasm.c $(HEADERS) $(PRIVATE_HEADERS)
$(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
-I$(BUILD_ROOT_HW)/include -I$(BUILD_ROOT_SWLIBS)/include $(LDFLAGS)
# librarian
ARFLAGS = rus
fxgasm.h : fxgasm
./fxgasm > fxgasm.h
# assembler
ASFLAGS = -O6 -felf -D__linux__
ASFLAGS += $(CDEFS)
fxinline.h : fxgasm
./fxgasm -inline > fxinline.h
# compiler
CFLAGS = -Wall -W
CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += $(CDEFS)
ASM_DEFINES = -DGLIDE_HARDWARE=1
ifneq ($(DEBUG),)
ASM_DEFINES += -DGLIDE_DEBUG=1
ifeq ($(USE_X86),1)
CFLAGS += -DGL_X86
OPTFLAGS ?= -O1 -ffast-math
else
ASM_DEFINES += -DGLIDE_DEBUG=0
CFLAGS += -DGLIDE_USE_C_TRISETUP
OPTFLAGS ?= -O1 -ffast-math
endif
xdraw.o : fxgasm.h xdraw.S
# $(CC) -c -o $@ xdraw.S $(ASM_OPTS) $(LAOPTS)
gasp xdraw.S $(ASM_DEFINES) | as -V -Qy -o xdraw.o
# optflags
CFLAGS += $(OPTFLAGS)
xdraw96.o : fxgasm.h xdraw96.
# $(CC) -c -o $@ xdraw96.S $(ASM_OPTS) $(LAOPTS)
gasp xdraw96.S $(ASM_DEFINES) | as -V -Qy -o xdraw96.o
###############################################################################
# objects
###############################################################################
gsplash.o : gsplash.c splshdat.c fxinline.h
GLIDE_HEADERS = \
glide.h gump.h glidesys.h glideutl.h
GLIDE_PRIVATE_HEADERS = \
fxglide.h gsstdef.h
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
gsplash.o \
g3df.o \
gu.o \
guclip.o \
gpci.o \
gump.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gmovie.o \
digutex.o \
ddgump.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
gutex.o \
cpuid.o
ifeq ($(USE_X86),1)
ifeq ($(FX_GLIDE_HW),sst1)
GLIDE_OBJECTS += \
xdraw.o
else
GLIDE_OBJECTS += \
xdraw96.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
ifeq ($(FX_GLIDE_HW),sst96)
GLIDE_OBJECTS += \
sst96.o \
../../init/init96/init96.o \
../../init/init96/lindrvr.o \
../../init/init96/initat3d.o \
../../init/init96/initmcrx.o
endif
GLIDE_OBJECTS += \
../../init/init.o \
../../init/vgdrvr.o \
../../init/vg96drvr.o \
../../init/h3drvr.o \
../../init/initvg/gamma.o \
../../init/initvg/dac.o \
../../init/initvg/video.o \
../../init/initvg/parse.o \
../../init/initvg/sli.o \
../../init/initvg/util.o \
../../init/initvg/info.o \
../../init/initvg/print.o \
../../init/initvg/gdebug.o \
../../init/initvg/sst1init.o \
$(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o
# FIXME: needed for now to match the old library signature, should be checked
# if it's really needed.
GLIDE_OBJECTS += \
$(FX_GLIDE_SW)/fxmisc/fxos.o \
$(FX_GLIDE_SW)/fxmisc/fximg.o
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.c.lo:
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $<
###############################################################################
# main
###############################################################################
all: glide2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
###############################################################################
# rules(2)
###############################################################################
cpuid.o: cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw.o: xdraw.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw96.o: xdraw96.asm
$(AS) -o $@ $(ASFLAGS) $<
cpuid.lo: cpuid.o
$(CP) $< $@
xdraw.lo: xdraw.o
$(CP) $< $@
xdraw96.lo: xdraw96.o
$(CP) $< $@
ifeq ($(FX_GLIDE_HW),sst96)
../../init/initvg/gamma.o: ../../init/initvg/gamma.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/dac.o: ../../init/initvg/dac.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/video.o: ../../init/initvg/video.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/parse.o: ../../init/initvg/parse.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/sli.o: ../../init/initvg/sli.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/util.o: ../../init/initvg/util.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/info.o: ../../init/initvg/info.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/print.o: ../../init/initvg/print.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/gdebug.o: ../../init/initvg/gdebug.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/sst1init.o: ../../init/initvg/sst1init.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/gamma.lo: ../../init/initvg/gamma.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/dac.lo: ../../init/initvg/dac.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/video.lo: ../../init/initvg/video.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/parse.lo: ../../init/initvg/parse.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/sli.lo: ../../init/initvg/sli.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/util.lo: ../../init/initvg/util.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/info.lo: ../../init/initvg/info.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/print.lo: ../../init/initvg/print.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/gdebug.lo: ../../init/initvg/gdebug.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/sst1init.lo: ../../init/initvg/sst1init.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
endif
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm
$< -inline > $@
fxgasm.h: fxgasm
$< -hex > $@
fxgasm: fxgasm.c $(GLIDE_HEADERS) $(GLIDE_PRIVATE_HEADERS)
$(CC) -o $@ $(CFLAGS) $<
###############################################################################
# clean, realclean
###############################################################################
clean:
-$(RM) *.o *.lo
-$(RM) ../../init/*.o ../../init/*.lo
-$(RM) ../../init/initvg/*.o ../../init/initvg/*.lo
-$(RM) ../../init/init96/*.o ../../init/init96/*.lo
-$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo
-$(RM) fxinline.h
-$(RM) fxgasm.h
realclean: clean
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)