diff --git a/glide3x/Makefile.DJ b/glide3x/Makefile.DJ index e419d20..b8644bf 100644 --- a/glide3x/Makefile.DJ +++ b/glide3x/Makefile.DJ @@ -17,10 +17,10 @@ # H4=1 High speed Avenger/Napalm. # target = h3, h5 # default = no -# CPU optimize for the given processor. +# OPTFLAGS pass given optimization flags to compiler # target = sst1, sst96, cvg, h3, h5 -# default = pentium -# DEBUG=1 disable optimizations and build for debug. +# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1) +# DEBUG=1 enable debugging checks and messages # target = sst1, sst96, cvg, h3, h5 # default = no # USE_X86=1 use assembler triangle specializations; req by CVG diff --git a/glide3x/Makefile.wat b/glide3x/Makefile.wat index b272efd..7815299 100644 --- a/glide3x/Makefile.wat +++ b/glide3x/Makefile.wat @@ -18,10 +18,10 @@ # H4=1 High speed Avenger/Napalm. # target = h3, h5 # default = no -# CPU optimize for the given processor. +# OPTFLAGS pass given optimization flags to compiler # target = sst1, sst96, cvg, h3, h5 -# default = pentium -# DEBUG=1 disable optimizations and build for debug. +# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1) +# DEBUG=1 enable debugging checks and messages # target = sst1, sst96, cvg, h3, h5 # default = no # USE_X86=1 use assembler triangle specializations; req by CVG diff --git a/glide3x/Makefile.win32 b/glide3x/Makefile.win32 index e503733..3e008d8 100644 --- a/glide3x/Makefile.win32 +++ b/glide3x/Makefile.win32 @@ -18,10 +18,10 @@ # H4=1 High speed Avenger/Napalm. # target = h3, h5 # default = no -# CPU optimize for the given processor. +# OPTFLAGS pass given optimization flags to compiler # target = sst1, sst96, cvg, h3, h5 -# default = pentium -# DEBUG=1 disable optimizations and build for debug. +# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1) +# DEBUG=1 enable debugging checks and messages # target = sst1, sst96, cvg, h3, h5 # default = no # USE_X86=1 use assembler triangle specializations; req by CVG diff --git a/glide3x/cvg/glide3/src/Makefile.DJ b/glide3x/cvg/glide3/src/Makefile.DJ index 9290b09..e6cc547 100644 --- a/glide3x/cvg/glide3/src/Makefile.DJ +++ b/glide3x/cvg/glide3/src/Makefile.DJ @@ -14,15 +14,16 @@ # Environment variables: # FX_GLIDE_HW build for the given ASIC (cvg). # default = cvg -# CPU optimize for the given processor. -# default = pentium -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations; req by CVG # default = no # USE_MMX=1 allow MMX specializations. However, the true CPU # capabilities are still checked at run-time to avoid # crashes. +# default = no # USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU # capabilities are still checked at run-time to avoid # crashes. @@ -112,21 +113,11 @@ ASFLAGS += $(CDEFS) # compiler CFLAGS = -Wall -W - -ifdef DEBUG -CFLAGS += -O0 -gcoff -else -CPU ?= pentium -CFLAGS += -O2 -ffast-math -mcpu=$(CPU) -endif - CFLAGS += -I. -I../../incsrc -I../../init CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib CFLAGS += $(CDEFS) -override USE_X86 = 1 - ifeq ($(USE_MMX),1) CFLAGS += -DGL_MMX override USE_X86 = 1 @@ -137,10 +128,17 @@ CFLAGS += -DGL_AMD3D override USE_X86 = 1 endif -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +OPTFLAGS ?= -O2 -ffast-math -mcpu=pentium +else CFLAGS += -DGLIDE_USE_C_TRISETUP +OPTFLAGS ?= -O2 -ffast-math endif +# optflags +CFLAGS += $(OPTFLAGS) + ############################################################################### # objects ############################################################################### @@ -167,11 +165,11 @@ GLIDE_OBJECTS = \ gsst.o \ gtex.o \ gtexdl.o \ - cpuid.o \ xtexdl_def.o ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ + cpuid.o \ xdraw2_def.o \ xdraw3_def.o ifeq ($(USE_MMX),1) diff --git a/glide3x/cvg/glide3/src/Makefile.wat b/glide3x/cvg/glide3/src/Makefile.wat index c0377cd..af7d4a8 100644 --- a/glide3x/cvg/glide3/src/Makefile.wat +++ b/glide3x/cvg/glide3/src/Makefile.wat @@ -15,15 +15,16 @@ # Environment variables: # FX_GLIDE_HW build for the given ASIC (cvg). # default = cvg -# CPU optimize for the given processor. -# default = 5s (Pentium, stack) -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -ox -5s (Pentium, stack) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations; req by CVG # default = no # USE_MMX=1 allow MMX specializations. However, the true CPU # capabilities are still checked at run-time to avoid # crashes. +# default = no # USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU # capabilities are still checked at run-time to avoid # crashes. @@ -110,20 +111,11 @@ ASFLAGS += $(CDEFS) # compiler CFLAGS = -wx - -ifdef DEBUG -CFLAGS += -od -d2 -else -CPU ?= 5s -CFLAGS += -ox -$(CPU) -endif - CFLAGS += -I. -I../../incsrc -I../../init CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib -CFLAGS += $(CDEFS) - -override USE_X86 = 1 +OPTFLAGS ?= -ox -5s +CFLAGS += $(CDEFS) $(OPTFLAGS) ifeq ($(USE_MMX),1) CFLAGS += -DGL_MMX @@ -135,7 +127,9 @@ CFLAGS += -DGL_AMD3D override USE_X86 = 1 endif -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +else CFLAGS += -DGLIDE_USE_C_TRISETUP endif @@ -169,11 +163,11 @@ GLIDE_OBJECTS = \ gsst.obj \ gtex.obj \ gtexdl.obj \ - cpuid.obj \ xtexdl_d.obj ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ + cpuid.obj \ xdraw2_d.obj \ xdraw3_d.obj ifeq ($(USE_MMX),1) diff --git a/glide3x/cvg/glide3/src/Makefile.win32 b/glide3x/cvg/glide3/src/Makefile.win32 index 9f85e87..22604c9 100644 --- a/glide3x/cvg/glide3/src/Makefile.win32 +++ b/glide3x/cvg/glide3/src/Makefile.win32 @@ -15,15 +15,16 @@ # 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. +# OPTFLAGS pass given optimization flags to compiler +# default = -G6 -O2 (or -Od if DEBUG=1) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations; req by CVG # default = no # USE_MMX=1 allow MMX specializations. However, the true CPU # capabilities are still checked at run-time to avoid # crashes. +# default = no # USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU # capabilities are still checked at run-time to avoid # crashes. @@ -123,21 +124,21 @@ CFLAGS = -nologo -W3 -WX -D__MSC__=1 LDLIBS = user32.lib kernel32.lib advapi32.lib ifdef DEBUG -CFLAGS += -Od -MTd -Zi +CFLAGS += -MTd -Zi LDFLAGS += -debugtype:both -debug LDLIBS += LIBCMTD.lib +OPTFLAGS ?= -Od else -CPU ?= 6 -CFLAGS += -DNDEBUG -G$(CPU) -O2 -MT +CFLAGS += -DNDEBUG -MT LDLIBS += LIBCMT.lib +OPTFLAGS ?= -G6 -O2 endif + CFLAGS += -I. -I../../incsrc -I../../init CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib -CFLAGS += $(CDEFS) - -override USE_X86 = 1 +CFLAGS += $(CDEFS) $(OPTFLAGS) ifeq ($(USE_MMX),1) CFLAGS += -DGL_MMX @@ -149,7 +150,9 @@ CFLAGS += -DGL_AMD3D override USE_X86 = 1 endif -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +else CFLAGS += -DGLIDE_USE_C_TRISETUP endif @@ -179,11 +182,11 @@ GLIDE_OBJECTS = \ gsst.obj \ gtex.obj \ gtexdl.obj \ - cpuid.obj \ xtexdl_def.obj ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ + cpuid.obj \ xdraw2_def.obj \ xdraw3_def.obj ifeq ($(USE_MMX),1) diff --git a/glide3x/cvg/glide3/src/makefile.linux b/glide3x/cvg/glide3/src/makefile.linux index d1eaaec..b9e744b 100644 --- a/glide3x/cvg/glide3/src/makefile.linux +++ b/glide3x/cvg/glide3/src/makefile.linux @@ -14,15 +14,16 @@ # Environment variables: # FX_GLIDE_HW build for the given ASIC (cvg). # default = cvg -# CPU optimize for the given processor. -# default = pentium -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations; req by CVG # default = no # USE_MMX=1 allow MMX specializations. However, the true CPU # capabilities are still checked at run-time to avoid # crashes. +# default = no # USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU # capabilities are still checked at run-time to avoid # crashes. @@ -108,21 +109,11 @@ ASFLAGS += $(CDEFS) # compiler CFLAGS = -Wall -W - -ifdef DEBUG -CFLAGS += -O0 -g -else -CPU ?= pentium -CFLAGS += -O2 -ffast-math -mcpu=$(CPU) -endif - CFLAGS += -I. -I../../incsrc -I../../init CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib CFLAGS += $(CDEFS) -override USE_X86 = 1 - ifeq ($(USE_MMX),1) CFLAGS += -DGL_MMX override USE_X86 = 1 @@ -133,10 +124,17 @@ CFLAGS += -DGL_AMD3D override USE_X86 = 1 endif -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +OPTFLAGS ?= -O2 -ffast-math -mcpu=pentium +else CFLAGS += -DGLIDE_USE_C_TRISETUP +OPTFLAGS ?= -O2 -ffast-math endif +# optflags +CFLAGS += $(OPTFLAGS) + ############################################################################### # objects ############################################################################### @@ -163,11 +161,11 @@ GLIDE_OBJECTS = \ gsst.o \ gtex.o \ gtexdl.o \ - cpuid.o \ xtexdl_def.o ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ + cpuid.o \ xdraw2_def.o \ xdraw3_def.o ifeq ($(USE_MMX),1) @@ -282,8 +280,8 @@ xdraw3_3dnow.o: xdraw3.asm xtexdl_3dnow.o: xtexdl.asm $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< -cpuid.lo: cpuid.o - $(CP) $< $@ +#cpuid.lo: cpuid.o +# $(CP) $< $@ xdraw2_def.lo: xdraw2_def.o $(CP) $< $@ xdraw3_def.lo: xdraw3_def.o diff --git a/glide3x/h3/glide3/src/Makefile.DJ b/glide3x/h3/glide3/src/Makefile.DJ index dd3c7eb..a9c8621 100644 --- a/glide3x/h3/glide3/src/Makefile.DJ +++ b/glide3x/h3/glide3/src/Makefile.DJ @@ -16,9 +16,9 @@ # default = h3 # H4=1 High speed Avenger. # default = no -# CPU optimize for the given processor. -# default = pentium -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! # default = no @@ -113,14 +113,6 @@ ASFLAGS += $(CDEFS) # compiler CFLAGS = -Wall -W - -ifdef DEBUG -CFLAGS += -O0 -gcoff -else -CPU ?= pentium -CFLAGS += -O2 -ffast-math -mcpu=$(CPU) -endif - 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 += -I$(FX_GLIDE_SW)/texus2/lib @@ -131,10 +123,17 @@ CFLAGS += -DGL_AMD3D override USE_X86 = 1 endif -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +OPTFLAGS ?= -O2 -ffast-math -mcpu=pentium +else CFLAGS += -DGLIDE_USE_C_TRISETUP +OPTFLAGS ?= -O2 -ffast-math endif +# optflags +CFLAGS += $(OPTFLAGS) + ############################################################################### # objects ############################################################################### @@ -161,11 +160,11 @@ GLIDE_OBJECTS = \ gsst.o \ gtex.o \ gtexdl.o \ - cpuid.o \ xtexdl_def.o ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ + cpuid.o \ xdraw2_def.o \ xdraw3_def.o ifeq ($(USE_3DNOW),1) diff --git a/glide3x/h3/glide3/src/Makefile.wat b/glide3x/h3/glide3/src/Makefile.wat index 4a7b82f..ccd719e 100644 --- a/glide3x/h3/glide3/src/Makefile.wat +++ b/glide3x/h3/glide3/src/Makefile.wat @@ -17,9 +17,9 @@ # default = h3 # H4=1 High speed Avenger. # default = no -# CPU optimize for the given processor. -# default = 5s (Pentium, stack) -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -ox -5s (Pentium, stack) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! # default = no @@ -111,25 +111,20 @@ ASFLAGS += $(CDEFS) # compiler CFLAGS = -wx - -ifdef DEBUG -CFLAGS += -od -d2 -else -CPU ?= 5s -CFLAGS += -ox -$(CPU) -endif - 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 += -I$(FX_GLIDE_SW)/texus2/lib -CFLAGS += $(CDEFS) +OPTFLAGS ?= -ox -5s +CFLAGS += $(CDEFS) $(OPTFLAGS) ifeq ($(USE_3DNOW),1) CFLAGS += -DGL_AMD3D override USE_X86 = 1 endif -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +else CFLAGS += -DGLIDE_USE_C_TRISETUP endif @@ -163,11 +158,11 @@ GLIDE_OBJECTS = \ gsst.obj \ gtex.obj \ gtexdl.obj \ - cpuid.obj \ xtexdl_d.obj ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ + cpuid.obj \ xdraw2_d.obj \ xdraw3_d.obj ifeq ($(USE_3DNOW),1) diff --git a/glide3x/h3/glide3/src/Makefile.win32 b/glide3x/h3/glide3/src/Makefile.win32 index 1e1af1d..73e2a43 100644 --- a/glide3x/h3/glide3/src/Makefile.win32 +++ b/glide3x/h3/glide3/src/Makefile.win32 @@ -17,9 +17,9 @@ # default = h3 # H4=1 High speed Avenger. # default = no -# CPU optimize for the given processor. -# default = 6 (PentiumPro) -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -G6 -O2 (or -Od if DEBUG=1) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! # default = no @@ -117,26 +117,29 @@ CFLAGS = -nologo -W3 -WX -D__MSC__=1 LDLIBS = user32.lib kernel32.lib ddraw.lib gdi32.lib dxguid.lib advapi32.lib ifdef DEBUG -CFLAGS += -Od -MTd -Zi +CFLAGS += -MTd -Zi LDFLAGS += -debugtype:both -debug LDLIBS += LIBCMTD.lib +OPTFLAGS ?= -Od else -CPU ?= 6 -CFLAGS += -DNDEBUG -G$(CPU) -O2 -MT +CFLAGS += -DNDEBUG -MT LDLIBS += LIBCMT.lib +OPTFLAGS ?= -G6 -O2 endif CFLAGS += -I. -I../../incsrc -I../../minihwc CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib -CFLAGS += $(CDEFS) +CFLAGS += $(CDEFS) $(OPTFLAGS) ifeq ($(USE_3DNOW),1) CFLAGS += -DGL_AMD3D override USE_X86 = 1 endif -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +else CFLAGS += -DGLIDE_USE_C_TRISETUP endif @@ -167,11 +170,11 @@ GLIDE_OBJECTS = \ gsst.obj \ gtex.obj \ gtexdl.obj \ - cpuid.obj \ xtexdl_def.obj ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ + cpuid.obj \ xdraw2_def.obj \ xdraw3_def.obj ifeq ($(USE_3DNOW),1) diff --git a/glide3x/h3/glide3/src/makefile.linux b/glide3x/h3/glide3/src/makefile.linux index 17a0729..02888be 100644 --- a/glide3x/h3/glide3/src/makefile.linux +++ b/glide3x/h3/glide3/src/makefile.linux @@ -22,9 +22,9 @@ # default = /usr/X11R6/lib # H4=1 High speed Avenger. # default = no -# CPU optimize for the given processor. -# default = pentium -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! # default = no @@ -126,14 +126,6 @@ ASFLAGS += $(CDEFS) # compiler CFLAGS = -Wall -W - -ifdef DEBUG -CFLAGS += -O0 -g -else -CPU ?= pentium -CFLAGS += -O2 -ffast-math -mcpu=$(CPU) -endif - 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 += -I$(FX_GLIDE_SW)/texus2/lib @@ -144,10 +136,17 @@ CFLAGS += -DGL_AMD3D override USE_X86 = 1 endif -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +OPTFLAGS ?= -O2 -ffast-math -mcpu=pentium +else CFLAGS += -DGLIDE_USE_C_TRISETUP +OPTFLAGS ?= -O2 -ffast-math endif +# optflags +CFLAGS += $(OPTFLAGS) + ############################################################################### # objects ############################################################################### @@ -174,11 +173,11 @@ GLIDE_OBJECTS = \ gsst.o \ gtex.o \ gtexdl.o \ - cpuid.o \ xtexdl_def.o ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ + cpuid.o \ xdraw2_def.o \ xdraw3_def.o ifeq ($(USE_3DNOW),1) diff --git a/glide3x/h5/glide3/src/Makefile.DJ b/glide3x/h5/glide3/src/Makefile.DJ index 71d9234..b6d8b9c 100644 --- a/glide3x/h5/glide3/src/Makefile.DJ +++ b/glide3x/h5/glide3/src/Makefile.DJ @@ -16,9 +16,9 @@ # default = h5 # H4=1 High speed Avenger/Napalm. # default = no -# CPU optimize for the given processor. -# default = pentium -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! # default = no @@ -120,14 +120,6 @@ ASFLAGS += $(CDEFS) # compiler CFLAGS = -Wall -W - -ifdef DEBUG -CFLAGS += -O0 -gcoff -else -CPU ?= pentium -CFLAGS += -O2 -ffast-math -mcpu=$(CPU) -endif - 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 += -I$(FX_GLIDE_SW)/texus2/lib @@ -150,10 +142,17 @@ CFLAGS += -DGL_SSE2 override USE_X86 = 1 endif -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +OPTFLAGS ?= -O2 -ffast-math -mcpu=pentium +else CFLAGS += -DGLIDE_USE_C_TRISETUP +OPTFLAGS ?= -O2 -ffast-math endif +# optflags +CFLAGS += $(OPTFLAGS) + ############################################################################### # objects ############################################################################### @@ -180,11 +179,11 @@ GLIDE_OBJECTS = \ gsst.o \ gtex.o \ gtexdl.o \ - cpuid.o \ xtexdl_def.o ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ + cpuid.o \ xdraw2_def.o \ xdraw3_def.o ifeq ($(USE_3DNOW),1) diff --git a/glide3x/h5/glide3/src/Makefile.wat b/glide3x/h5/glide3/src/Makefile.wat index 92e87b9..09238b3 100644 --- a/glide3x/h5/glide3/src/Makefile.wat +++ b/glide3x/h5/glide3/src/Makefile.wat @@ -17,9 +17,9 @@ # default = h5 # H4=1 High speed Avenger/Napalm. # default = no -# CPU optimize for the given processor. -# default = 5s (Pentium, stack) -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -ox -5s (Pentium, stack) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! # default = no @@ -118,18 +118,11 @@ ASFLAGS += $(CDEFS) # compiler CFLAGS = -wx - -ifdef DEBUG -CFLAGS += -od -d2 -else -CPU ?= 5s -CFLAGS += -ox -$(CPU) -endif - 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 += -I$(FX_GLIDE_SW)/texus2/lib -CFLAGS += $(CDEFS) +OPTFLAGS ?= -ox -5s +CFLAGS += $(CDEFS) $(OPTFLAGS) ifeq ($(USE_3DNOW),1) CFLAGS += -DGL_AMD3D @@ -148,7 +141,9 @@ CFLAGS += -DGL_SSE2 override USE_X86 = 1 endif -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +else CFLAGS += -DGLIDE_USE_C_TRISETUP endif @@ -182,11 +177,11 @@ GLIDE_OBJECTS = \ gsst.obj \ gtex.obj \ gtexdl.obj \ - cpuid.obj \ xtexdl_d.obj ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ + cpuid.obj \ xdraw2_d.obj \ xdraw3_d.obj ifeq ($(USE_3DNOW),1) diff --git a/glide3x/h5/glide3/src/Makefile.win32 b/glide3x/h5/glide3/src/Makefile.win32 index d99c949..b752817 100644 --- a/glide3x/h5/glide3/src/Makefile.win32 +++ b/glide3x/h5/glide3/src/Makefile.win32 @@ -17,9 +17,9 @@ # default = h5 # H4=1 High speed Avenger/Napalm. # default = no -# CPU optimize for the given processor. -# default = 6 (PentiumPro) -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -G6 -O2 (or -Od if DEBUG=1) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! # default = no @@ -125,19 +125,20 @@ CFLAGS = -nologo -W3 -WX -D__MSC__=1 LDLIBS = user32.lib kernel32.lib ddraw.lib gdi32.lib dxguid.lib advapi32.lib ifdef DEBUG -CFLAGS += -Od -MTd -Zi +CFLAGS += -MTd -Zi LDFLAGS += -debugtype:both -debug LDLIBS += LIBCMTD.lib +OPTFLAGS ?= -Od else -CPU ?= 6 -CFLAGS += -DNDEBUG -G$(CPU) -O2 -MT +CFLAGS += -DNDEBUG -MT LDLIBS += LIBCMT.lib +OPTFLAGS ?= -G6 -O2 endif CFLAGS += -I. -I../../incsrc -I../../minihwc CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib -CFLAGS += $(CDEFS) +CFLAGS += $(CDEFS) $(OPTFLAGS) ifeq ($(USE_3DNOW),1) CFLAGS += -DGL_AMD3D @@ -156,7 +157,9 @@ CFLAGS += -DGL_SSE2 override USE_X86 = 1 endif -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +else CFLAGS += -DGLIDE_USE_C_TRISETUP endif @@ -187,11 +190,11 @@ GLIDE_OBJECTS = \ gsst.obj \ gtex.obj \ gtexdl.obj \ - cpuid.obj \ xtexdl_def.obj ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ + cpuid.obj \ xdraw2_def.obj \ xdraw3_def.obj ifeq ($(USE_3DNOW),1) diff --git a/glide3x/h5/glide3/src/makefile.linux b/glide3x/h5/glide3/src/makefile.linux index e26bb55..d975509 100644 --- a/glide3x/h5/glide3/src/makefile.linux +++ b/glide3x/h5/glide3/src/makefile.linux @@ -22,9 +22,9 @@ # default = /usr/X11R6/lib # H4=1 High speed Avenger/Napalm. # default = no -# CPU optimize for the given processor. -# default = pentium -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! # default = no @@ -133,14 +133,6 @@ ASFLAGS += $(CDEFS) # compiler CFLAGS = -Wall -W - -ifdef DEBUG -CFLAGS += -O0 -g -else -CPU ?= pentium -CFLAGS += -O2 -ffast-math -mcpu=$(CPU) -endif - 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 += -I$(FX_GLIDE_SW)/texus2/lib @@ -163,10 +155,17 @@ CFLAGS += -DGL_SSE2 override USE_X86 = 1 endif -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +OPTFLAGS ?= -O2 -ffast-math -mcpu=pentium +else CFLAGS += -DGLIDE_USE_C_TRISETUP +OPTFLAGS ?= -O2 -ffast-math endif +# optflags +CFLAGS += $(OPTFLAGS) + ############################################################################### # objects ############################################################################### @@ -193,11 +192,11 @@ GLIDE_OBJECTS = \ gsst.o \ gtex.o \ gtexdl.o \ - cpuid.o \ xtexdl_def.o ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ + cpuid.o \ xdraw2_def.o \ xdraw3_def.o ifeq ($(USE_3DNOW),1) diff --git a/glide3x/makefile.linux b/glide3x/makefile.linux index b4cf9f2..e3dc44e 100644 --- a/glide3x/makefile.linux +++ b/glide3x/makefile.linux @@ -26,10 +26,10 @@ # H4=1 High speed Avenger/Napalm. # target = h3, h5 # default = no -# CPU optimize for the given processor. +# OPTFLAGS pass given optimization flags to compiler # target = sst1, sst96, cvg, h3, h5 -# default = pentium -# DEBUG=1 disable optimizations and build for debug. +# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1) +# DEBUG=1 enable debugging checks and messages # target = sst1, sst96, cvg, h3, h5 # default = no # USE_X86=1 use assembler triangle specializations; req by CVG diff --git a/glide3x/sst1/glide3/src/Makefile.DJ b/glide3x/sst1/glide3/src/Makefile.DJ index 96e2a50..e2db272 100644 --- a/glide3x/sst1/glide3/src/Makefile.DJ +++ b/glide3x/sst1/glide3/src/Makefile.DJ @@ -14,9 +14,9 @@ # Environment variables: # FX_GLIDE_HW build for the given ASIC (sst1, sst96). # default = sst1 -# CPU optimize for the given processor. -# default = pentium -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! # default = no @@ -113,23 +113,22 @@ ASFLAGS += $(CDEFS) # compiler CFLAGS = -Wall -W - -ifdef DEBUG -CFLAGS += -O0 -gcoff -else -CPU ?= pentium -CFLAGS += -O1 -ffast-math -mcpu=$(CPU) -endif - 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 += -I$(FX_GLIDE_SW)/texus2/lib CFLAGS += $(CDEFS) -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +OPTFLAGS ?= -O2 -ffast-math -mcpu=pentium +else CFLAGS += -DGLIDE_USE_C_TRISETUP +OPTFLAGS ?= -O2 -ffast-math endif +# optflags +CFLAGS += $(OPTFLAGS) + ############################################################################### # objects ############################################################################### @@ -139,7 +138,6 @@ GLIDE_OBJECTS = \ diget.o \ gstrip.o \ distrip.o \ - cpuid.o \ diglide.o \ disst.o \ ditex.o \ @@ -159,6 +157,8 @@ GLIDE_OBJECTS = \ gxdraw.o ifeq ($(USE_X86),1) +GLIDE_OBJECTS += \ + cpuid.o ifeq ($(FX_GLIDE_HW),sst1) GLIDE_OBJECTS += \ xdraw.o diff --git a/glide3x/sst1/glide3/src/Makefile.wat b/glide3x/sst1/glide3/src/Makefile.wat index 92ec3b7..3792506 100644 --- a/glide3x/sst1/glide3/src/Makefile.wat +++ b/glide3x/sst1/glide3/src/Makefile.wat @@ -15,9 +15,9 @@ # Environment variables: # FX_GLIDE_HW build for the given ASIC (sst1, sst96). # default = sst1 -# CPU optimize for the given processor. -# default = 5s (Pentium, stack) -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -ox -5s (Pentium, stack) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! # default = no @@ -111,20 +111,15 @@ ASFLAGS += $(CDEFS) # compiler CFLAGS = -wx - -ifdef DEBUG -CFLAGS += -od -d2 -else -CPU ?= 5s -CFLAGS += -ox -$(CPU) -endif - 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 += -I$(FX_GLIDE_SW)/texus2/lib -CFLAGS += $(CDEFS) +OPTFLAGS ?= -ox -5s +CFLAGS += $(CDEFS) $(OPTFLAGS) -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +else CFLAGS += -DGLIDE_USE_C_TRISETUP endif @@ -141,7 +136,6 @@ GLIDE_OBJECTS = \ diget.obj \ gstrip.obj \ distrip.obj \ - cpuid.obj \ diglide.obj \ disst.obj \ ditex.obj \ @@ -161,6 +155,8 @@ GLIDE_OBJECTS = \ gxdraw.obj ifeq ($(USE_X86),1) +GLIDE_OBJECTS += \ + cpuid.o ifeq ($(FX_GLIDE_HW),sst1) GLIDE_OBJECTS += \ xdraw.obj diff --git a/glide3x/sst1/glide3/src/Makefile.win32 b/glide3x/sst1/glide3/src/Makefile.win32 index 9e6f441..c910b96 100644 --- a/glide3x/sst1/glide3/src/Makefile.win32 +++ b/glide3x/sst1/glide3/src/Makefile.win32 @@ -15,9 +15,9 @@ # Environment variables: # FX_GLIDE_HW build for the given ASIC (sst1, sst96). # default = sst1 -# CPU optimize for the given processor. -# default = 6 (PentiumPro) -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -G6 -O2 (or -Od if DEBUG=1) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! # default = no @@ -117,13 +117,14 @@ CFLAGS = -nologo -W3 -WX -D__MSC__=1 LDLIBS = user32.lib kernel32.lib ifdef DEBUG -CFLAGS += -Od -MTd -Zi +CFLAGS += -MTd -Zi LDFLAGS += -debugtype:both -debug LDLIBS += LIBCMTD.lib +OPTFLAGS ?= -Od else -CPU ?= 6 -CFLAGS += -DNDEBUG -G$(CPU) -O2 -MT +CFLAGS += -DNDEBUG -MT LDLIBS += LIBCMT.lib +OPTFLAGS ?= -G6 -O2 endif ifeq ($(FX_GLIDE_HW),sst96) LDLIBS += gdi32.lib ddraw.lib dxguid.lib oldnames.lib @@ -132,9 +133,11 @@ endif 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 += -I$(FX_GLIDE_SW)/texus2/lib -CFLAGS += $(CDEFS) +CFLAGS += $(CDEFS) $(OPTFLAGS) -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +else CFLAGS += -DGLIDE_USE_C_TRISETUP endif @@ -147,7 +150,6 @@ GLIDE_OBJECTS = \ diget.obj \ gstrip.obj \ distrip.obj \ - cpuid.obj \ diglide.obj \ disst.obj \ ditex.obj \ @@ -167,6 +169,8 @@ GLIDE_OBJECTS = \ gxdraw.obj ifeq ($(USE_X86),1) +GLIDE_OBJECTS += \ + cpuid.o ifeq ($(FX_GLIDE_HW),sst1) GLIDE_OBJECTS += \ xdraw.obj diff --git a/glide3x/sst1/glide3/src/makefile.linux b/glide3x/sst1/glide3/src/makefile.linux index 31dd320..62d4b4c 100644 --- a/glide3x/sst1/glide3/src/makefile.linux +++ b/glide3x/sst1/glide3/src/makefile.linux @@ -14,9 +14,9 @@ # Environment variables: # FX_GLIDE_HW build for the given ASIC (sst1, sst96). # default = sst1 -# CPU optimize for the given processor. -# default = pentium -# DEBUG=1 disable optimizations and build for debug. +# OPTFLAGS pass given optimization flags to compiler +# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1) +# DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! # default = no @@ -108,23 +108,22 @@ ASFLAGS += $(CDEFS) # compiler CFLAGS = -Wall -W - -ifdef DEBUG -CFLAGS += -O0 -g -else -CPU ?= pentium -CFLAGS += -O1 -ffast-math -mcpu=$(CPU) -endif - 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 += -I$(FX_GLIDE_SW)/texus2/lib CFLAGS += $(CDEFS) -ifneq ($(USE_X86),1) +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +OPTFLAGS ?= -O2 -ffast-math -mcpu=pentium +else CFLAGS += -DGLIDE_USE_C_TRISETUP +OPTFLAGS ?= -O2 -ffast-math endif +# optflags +CFLAGS += $(OPTFLAGS) + ############################################################################### # objects ############################################################################### @@ -134,7 +133,6 @@ GLIDE_OBJECTS = \ diget.o \ gstrip.o \ distrip.o \ - cpuid.o \ diglide.o \ disst.o \ ditex.o \ @@ -154,6 +152,8 @@ GLIDE_OBJECTS = \ gxdraw.o ifeq ($(USE_X86),1) +GLIDE_OBJECTS += \ + cpuid.o ifeq ($(FX_GLIDE_HW),sst1) GLIDE_OBJECTS += \ xdraw.o