cleaned up DJGPP/MinGW makefiles
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# DOS/DJGPP makefile for Glide3
|
||||
# DOS/DJGPP makefile for Glide3(h5)
|
||||
#
|
||||
# Copyright (c) 2003 - Borca Daniel
|
||||
# Email : dborca@users.sourceforge.net
|
||||
@@ -12,12 +12,10 @@
|
||||
# Available options:
|
||||
#
|
||||
# Environment variables:
|
||||
# FX_GLIDE_HW=[h3|h5] build for the given ASIC.
|
||||
# default = h5
|
||||
# H4=1 tune for Avenger highspeed.
|
||||
# H4=1 Avenger/Napalm.
|
||||
# default = no
|
||||
# CPU optimize for the given processor.
|
||||
# default = k6
|
||||
# default = pentium
|
||||
# DEBUG=1 disable optimizations and build for debug.
|
||||
# default = no
|
||||
# USE_X86=1 use assembler triangle specializations.
|
||||
@@ -34,26 +32,26 @@
|
||||
# default = no
|
||||
#
|
||||
# Targets:
|
||||
# glid3: build glide3
|
||||
# all: build everything
|
||||
# glide3x: build Glide3x lib
|
||||
# clean: remove object files
|
||||
# realclean: remove all generated files
|
||||
#
|
||||
|
||||
|
||||
|
||||
.PHONY: glid3 all clean realclean
|
||||
.INTERMEDIATE: fxgasm.exe gendate.exe
|
||||
.PHONY: glide3x all clean realclean
|
||||
.INTERMEDIATE: fxgasm.exe gendate.exe fxbldno.exe
|
||||
|
||||
###############################################################################
|
||||
# general defines (user settable?)
|
||||
###############################################################################
|
||||
|
||||
GLIDE_LIB = libglid3.a
|
||||
GLIDE_DXE = glid3.dxe
|
||||
GLIDE_IMP = libg3i.a
|
||||
GLIDE_LIB = libglide.a
|
||||
GLIDE_DXE = glide3x.dxe
|
||||
GLIDE_IMP = libglid3.a
|
||||
|
||||
FX_GLIDE_HW ?= h5
|
||||
FX_GLIDE_HW = h5
|
||||
FX_GLIDE_SW = swlibs
|
||||
GLIDE_LIBDIR = $(FX_GLIDE_HW)/lib
|
||||
|
||||
@@ -118,20 +116,14 @@ CFLAGS = -Wall -W
|
||||
ifdef DEBUG
|
||||
CFLAGS += -O0 -gcoff
|
||||
else
|
||||
CPU ?= k6
|
||||
CPU ?= pentium
|
||||
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
|
||||
endif
|
||||
|
||||
CFLAGS += -I$(FX_GLIDE_HW)/glide3/src -I$(FX_GLIDE_HW)/incsrc -I$(FX_GLIDE_HW)/minihwc -Ih3/cinit
|
||||
CFLAGS += -I$(FX_GLIDE_HW)/glide3/src -I$(FX_GLIDE_HW)/incsrc -I$(FX_GLIDE_HW)/minihwc -I$(FX_GLIDE_HW)/cinit
|
||||
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
|
||||
CFLAGS += $(CDEFS)
|
||||
|
||||
ifeq ($(FX_GLIDE_HW),h3)
|
||||
override USE_MMX = 0
|
||||
override USE_SSE = 0
|
||||
override USE_SSE2 = 0
|
||||
endif
|
||||
|
||||
ifeq ($(USE_3DNOW),1)
|
||||
CFLAGS += -DGL_AMD3D
|
||||
override USE_X86 = 1
|
||||
@@ -212,17 +204,9 @@ endif
|
||||
GLIDE_OBJECTS += \
|
||||
$(FX_GLIDE_HW)/glide3/src/xtexdl_def.o
|
||||
|
||||
ifeq ($(FX_GLIDE_HW),h5)
|
||||
GLIDE_OBJECTS += \
|
||||
h5/glide3/src/cpuid.o
|
||||
endif
|
||||
ifeq ($(FX_GLIDE_HW),h3)
|
||||
GLIDE_OBJECTS += \
|
||||
h3/glide3/src/cpudtect.o
|
||||
endif
|
||||
|
||||
GLIDE_OBJECTS += \
|
||||
h3/cinit/h3cinit.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/cpuid.o \
|
||||
$(FX_GLIDE_HW)/cinit/h3cinit.o \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxdpmi2.o \
|
||||
$(FX_GLIDE_HW)/minihwc/hwcio.o \
|
||||
@@ -244,9 +228,9 @@ GLIDE_OBJECTS += \
|
||||
###############################################################################
|
||||
# main
|
||||
###############################################################################
|
||||
all: glid3
|
||||
all: glide3x
|
||||
|
||||
glid3: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP)
|
||||
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP)
|
||||
|
||||
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
|
||||
$(AR) $(ARFLAGS) $@ $^
|
||||
@@ -255,51 +239,36 @@ $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_OBJECTS)
|
||||
ifeq ($(HAVEDXE3),)
|
||||
$(warning Missing DXE3 package... Skipping $(GLIDE_DXE))
|
||||
else
|
||||
-dxe3gen -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -D "Glide3/$(FX_GLIDE_HW) DJGPP" -E _gr -E _gu -U $^
|
||||
-dxe3gen -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -D "Glide3($(FX_GLIDE_HW)) DJGPP" -E _gr -E _gu -U $^
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# rules(2)
|
||||
###############################################################################
|
||||
|
||||
h3/glide3/src/gglide.o: h3/glide3/src/gglide.c.save
|
||||
$(CC) -o $@ $(CFLAGS) -x c -c $<
|
||||
h3/glide3/src/glfb.o: h3/glide3/src/glfb.c.save
|
||||
$(CC) -o $@ $(CFLAGS) -x c -c $<
|
||||
h3/glide3/src/gsst.o: h3/glide3/src/gsst.c.save
|
||||
$(CC) -o $@ $(CFLAGS) -x c -c $<
|
||||
|
||||
h3/glide3/src/xdraw2_def.o: h3/glide3/src/xdraw2.S
|
||||
$(CC) -o $@ $(CFLAGS) -UGL_AMD3D -c $<
|
||||
h3/glide3/src/xdraw3_def.o: h3/glide3/src/xdraw3.S
|
||||
$(CC) -o $@ $(CFLAGS) -UGL_AMD3D -c $<
|
||||
h3/glide3/src/xtexdl_3dnow.o: h3/glide3/src/xtexdl.S
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
h3/glide3/src/xdraw2_3dnow.o: h3/glide3/src/xdraw2.S
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
h3/glide3/src/xdraw3_3dnow.o: h3/glide3/src/xdraw3.S
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
|
||||
h5/glide3/src/xdraw2_def.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.asm
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw2_def.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.asm
|
||||
$(AS) -o $@ $(ASFLAGS) $<
|
||||
h5/glide3/src/xdraw3_def.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.asm
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw3_def.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.asm
|
||||
$(AS) -o $@ $(ASFLAGS) $<
|
||||
h5/glide3/src/xdraw2_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.asm
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw2_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.asm
|
||||
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
|
||||
h5/glide3/src/xdraw3_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.asm
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw3_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.asm
|
||||
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
|
||||
h5/glide3/src/xtexdl_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.asm
|
||||
$(FX_GLIDE_HW)/glide3/src/xtexdl_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.asm
|
||||
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
|
||||
h5/glide3/src/xtexdl_mmx.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.asm
|
||||
$(FX_GLIDE_HW)/glide3/src/xtexdl_mmx.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.asm
|
||||
$(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $<
|
||||
h5/glide3/src/xdraw2_sse.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.asm
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw2_sse.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.asm
|
||||
$(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $<
|
||||
h5/glide3/src/xdraw3_sse.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.asm
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw3_sse.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.asm
|
||||
$(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $<
|
||||
h5/glide3/src/xtexdl_sse2.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.asm
|
||||
$(FX_GLIDE_HW)/glide3/src/xtexdl_sse2.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.asm
|
||||
$(AS) -o $@ $(ASFLAGS) -DGL_SSE2=1 $<
|
||||
|
||||
$(GLIDE_OBJECTS): $(FX_GLIDE_HW)/glide3/src/fxinline.h $(FX_GLIDE_HW)/glide3/src/fxgasm.h
|
||||
GENDATE = $(FX_GLIDE_HW)/incsrc/gendate.h
|
||||
FXBLDNO = $(FX_GLIDE_HW)/glide3/src/fxbldno.h
|
||||
|
||||
$(GLIDE_OBJECTS): $(FX_GLIDE_HW)/glide3/src/fxinline.h $(FX_GLIDE_HW)/glide3/src/fxgasm.h $(FXBLDNO)
|
||||
|
||||
$(FX_GLIDE_HW)/glide3/src/fxinline.h: fxgasm.exe
|
||||
$< -inline > $@
|
||||
@@ -307,17 +276,19 @@ $(FX_GLIDE_HW)/glide3/src/fxinline.h: fxgasm.exe
|
||||
$(FX_GLIDE_HW)/glide3/src/fxgasm.h: fxgasm.exe
|
||||
$< -hex > $@
|
||||
|
||||
ifeq ($(FX_GLIDE_HW),h5)
|
||||
GENDATE = h5/incsrc/gendate.h
|
||||
endif
|
||||
|
||||
fxgasm.exe: $(FX_GLIDE_HW)/glide3/src/fxgasm.c $(GENDATE)
|
||||
$(CC) -o $@ $(CFLAGS) $<
|
||||
|
||||
$(GENDATE): gendate.exe
|
||||
$< > $@
|
||||
|
||||
gendate.exe: h5/incsrc/gendate.c
|
||||
$(FXBLDNO): fxbldno.exe
|
||||
$< > $@
|
||||
|
||||
gendate.exe: $(GENDATE:.h=.c)
|
||||
$(CC) -o $@ $(CFLAGS) $<
|
||||
|
||||
fxbldno.exe: $(FXBLDNO:.h=.c)
|
||||
$(CC) -o $@ $(CFLAGS) $<
|
||||
|
||||
###############################################################################
|
||||
@@ -325,16 +296,16 @@ gendate.exe: h5/incsrc/gendate.c
|
||||
###############################################################################
|
||||
|
||||
clean:
|
||||
-$(call UNLINK,h3/cinit/*.o)
|
||||
-$(call UNLINK,$(FX_GLIDE_HW)/cinit/*.o)
|
||||
-$(call UNLINK,$(FX_GLIDE_HW)/glide3/src/*.o)
|
||||
-$(call UNLINK,$(FX_GLIDE_HW)/minihwc/*.o)
|
||||
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.o)
|
||||
-$(call UNLINK,$(FX_GLIDE_HW)/glide3/src/fxinline.h)
|
||||
-$(call UNLINK,$(FX_GLIDE_HW)/glide3/src/fxgasm.h)
|
||||
ifneq ($(GENDATE),)
|
||||
-$(call UNLINK,$(GENDATE))
|
||||
endif
|
||||
-$(call UNLINK,$(FXBLDNO))
|
||||
|
||||
realclean: clean
|
||||
-$(call UNLINK,$(GLIDE_LIBDIR)/*.a)
|
||||
-$(call UNLINK,$(GLIDE_LIBDIR)/*.dxe)
|
||||
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_LIB))
|
||||
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DXE))
|
||||
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#
|
||||
# Environment variables:
|
||||
# CPU optimize for the given processor.
|
||||
# default = k6
|
||||
# default = pentium
|
||||
# DXE=1 use DXE modules.
|
||||
# default = no
|
||||
#
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
FX_GLIDE_HW = h5
|
||||
TOP = ../../..
|
||||
CPU ?= k6
|
||||
CPU ?= pentium
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -O2 -ffast-math -mcpu=$(CPU)
|
||||
@@ -41,9 +41,9 @@ CFLAGS += -DFX_GLIDE_NAPALM=1
|
||||
LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib
|
||||
|
||||
ifdef DXE
|
||||
LDLIBS = -lg3i
|
||||
else
|
||||
LDLIBS = -lglid3
|
||||
else
|
||||
LDLIBS = -lglide
|
||||
endif
|
||||
|
||||
.c.o:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#
|
||||
# Environment variables:
|
||||
# CPU optimize for the given processor.
|
||||
# default = k6
|
||||
# default = pentium
|
||||
#
|
||||
# Targets:
|
||||
# <file.exe> build a specific file
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
FX_GLIDE_HW = h5
|
||||
TOP = ../../..
|
||||
CPU ?= k6
|
||||
CPU ?= pentium
|
||||
|
||||
CC = mingw32-gcc
|
||||
CFLAGS = -Wall -O2 -ffast-math -mcpu=$(CPU)
|
||||
@@ -37,7 +37,7 @@ CFLAGS += -DFX_GLIDE_NAPALM=1
|
||||
|
||||
LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib
|
||||
|
||||
LDLIBS = -lgdi32 -lglide
|
||||
LDLIBS = -lgdi32 -lglide3x
|
||||
|
||||
.c.o:
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
|
||||
Reference in New Issue
Block a user