Makefile.wat: revise so that watcom builds work on both linux and win32

- not tested on pure dos, and it shouldn't be a problem really..
- this needs to be done for Makefile.DJ and Makefile.mingw, too.
This commit is contained in:
sezero
2018-09-11 17:21:04 +03:00
parent 186bb19d28
commit 99ee5eec74
9 changed files with 232 additions and 132 deletions

View File

@@ -1,5 +1,7 @@
# DOS / OpenWatcom makefile for Glide3 and Texus2
# This makefile MUST be processed by GNU make!!!
# Building under native DOS is not supported:
# only tested under Win32 or Linux
#
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
@@ -48,7 +50,6 @@
# realclean: remove all generated files
#
.PHONY: all clean realclean
export BUILD_NUMBER = 40404

View File

@@ -1,5 +1,7 @@
# OpenWatcom makefile for Glide3/CVG and Texus2
# This makefile MUST be processed by GNU make!!!
# Building under native DOS is not supported:
# only tested under Win32 or Linux
#
# Copyright (c) 2004 - Daniel Borca
# Email : dborca@users.sourceforge.net
@@ -57,10 +59,15 @@ CC = wcl386
AS = nasm
AR = wlib
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
# detect if running under unix by finding 'rm' in $PATH :
ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
DOSMODE= 1
UNLINK = del $(subst /,\,$(1))
FIXPATH= $(subst /,\,$1)
else
DOSMODE= 0
UNLINK = $(RM) $(1)
FIXPATH= $1
endif
###############################################################################
@@ -108,12 +115,13 @@ ASFLAGS = -O6 -fobj -D__WATCOMD__ --prefix _
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -bt=dos -wx
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 = -bt=dos -wx -zq
INCPATH = -I. -I../../incsrc -I../../init
INCPATH += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
INCPATH += -I$(FX_GLIDE_SW)/texus2/lib
OPTFLAGS ?= -ox -5s
CFLAGS += $(CDEFS) $(OPTFLAGS)
CFLAGS += $(call FIXPATH,$(INCPATH))
ifeq ($(USE_MMX),1)
CFLAGS += -DGL_MMX
@@ -132,8 +140,8 @@ CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
# Watcom woes: pass parameters through environment vars
export WCC386 = $(subst /,\,$(CFLAGS))
export WCL386 = -zq
#export WCC386 = $(call FIXPATH,$(CFLAGS))
#export WCL386 = -zq
###############################################################################
# objects
@@ -235,7 +243,7 @@ endif
###############################################################################
.c.obj:
$(CC) -fo=$@ -c $<
$(CC) $(CFLAGS) -fo=$@ -c $<
###############################################################################
# main
@@ -245,11 +253,11 @@ all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): wlib.lbc
$(AR) $(ARFLAGS) -o $(subst /,\,$@) @wlib
$(AR) $(ARFLAGS) -o $(call FIXPATH,$@) @wlib.lbc
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)
$(CC) -fe=$(subst /,\,$@) $(subst /,\,$^)
$(CC) $(CFLAGS) -fe=$(call FIXPATH,$@) $(call FIXPATH,$^)
else
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
endif
@@ -265,7 +273,7 @@ xdraw2_d.obj: xdraw2.asm
xdraw3_d.obj: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
xtexdl_d.obj: xtexdl.c
$(CC) -fo=$@ -c $<
$(CC) $(CFLAGS) -fo=$@ -c $<
xtexdl_mmx.obj: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $<
xdraw2_3.obj: xdraw2.asm
@@ -278,15 +286,16 @@ xtexdl_3.obj: xtexdl.asm
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm.exe
$< -inline > $@
$(call FIXPATH,./$<) -inline > $@
fxgasm.h: fxgasm.exe
$< -hex > $@
$(call FIXPATH,./$<) -hex > $@
# -bt without args resets build target to native OS
fxgasm.exe: fxgasm.c
$(CC) -fe=$@ $<
$(CC) $(CFLAGS) -bt -fe=$@ $<
wlib.lbc: $(subst /,\,$(GLIDE_OBJECTS))
wlib.lbc: $(call FIXPATH,$(GLIDE_OBJECTS))
@echo $(addprefix +,$^) > wlib.lbc
###############################################################################
@@ -295,6 +304,7 @@ wlib.lbc: $(subst /,\,$(GLIDE_OBJECTS))
clean:
-$(call UNLINK,*.obj)
-$(call UNLINK,*.o)
-$(call UNLINK,../../init/*.obj)
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj)
-$(call UNLINK,fxinline.h)

View File

@@ -1,5 +1,7 @@
# OpenWatcom tests makefile for Glide3
# This makefile MUST be processed by GNU make!!!
# Building under native DOS is not supported:
# only tested under Win32 or Linux
#
# Copyright (c) 2004 - Borca Daniel
# Email : dborca@users.sourceforge.net
@@ -26,12 +28,24 @@
FX_GLIDE_HW = cvg
TOP = ../../..
# detect if running under unix by finding 'rm' in $PATH :
ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
DOSMODE= 1
UNLINK = del $(subst /,\,$(1))
FIXPATH= $(subst /,\,$1)
else
DOSMODE= 0
UNLINK = $(RM) $(1)
FIXPATH= $1
endif
CC = wcl386
CFLAGS = -bt=dos -wx
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc
CFLAGS += -I$(TOP)/swlibs/fxmisc
CFLAGS = -bt=dos -wx -zq
INCPATH = -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc
INCPATH += -I$(TOP)/swlibs/fxmisc
CFLAGS += -D__DOS__ -DCVG
CFLAGS += -D__DOS32__
CFLAGS += $(call FIXPATH,$(INCPATH))
ifdef DEBUG
CFLAGS += -od -d2
@@ -40,24 +54,21 @@ CPU ?= 5s
CFLAGS += -ox -$(CPU)
endif
LDFLAGS = -k16384
# pick either of causeway, dos4g, dos32a or stub32a as link target
LDFLAGS = -zq -k16384 -l=dos32a
LDLIBS = $(TOP)/$(FX_GLIDE_HW)/lib/glide3x.lib
# Watcom woes: pass parameters through environment vars
export WCC386 = $(subst /,\,$(CFLAGS))
export WCL386 = -zq
.c.obj:
$(CC) -fo=$@ -c $<
$(CC) $(CFLAGS) -fo=$@ -c $<
%.exe: tlib.obj %.obj
$(CC) -fe=$@ $(LDFLAGS) $^ $(subst /,\,$(LDLIBS))
$(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS))
all:
$(error Must specify <filename.exe> to build)
sbench.exe: sbench.obj fxos.obj tlib.obj
$(CC) -fe=$@ $(LDFLAGS) $^ $(subst /,\,$(LDLIBS))
$(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS))
fxos.obj: $(TOP)/swlibs/fxmisc/fxos.c
$(CC) -fo=$@ -c $<
fxos.obj: $(call FIXPATH,$(TOP)/swlibs/fxmisc/fxos.c)
$(CC) $(CFLAGS) -fo=$@ -c $<

View File

@@ -1,5 +1,7 @@
# OpenWatcom makefile for Glide3/H3 and Texus2
# This makefile MUST be processed by GNU make!!!
# Building under native DOS is not supported:
# only tested under Win32 or Linux
#
# Copyright (c) 2004 - Daniel Borca
# Email : dborca@users.sourceforge.net
@@ -55,10 +57,15 @@ CC = wcl386
AS = nasm
AR = wlib
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
# detect if running under unix by finding 'rm' in $PATH :
ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
DOSMODE= 1
UNLINK = del $(subst /,\,$(1))
FIXPATH= $(subst /,\,$1)
else
DOSMODE= 0
UNLINK = $(RM) $(1)
FIXPATH= $1
endif
###############################################################################
@@ -102,12 +109,13 @@ ASFLAGS = -O6 -fobj -D__WATCOMD__ --prefix _
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -bt=dos -wx
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 = -bt=dos -wx -zq
INCPATH = -I. -I../../incsrc -I../../minihwc -I../../cinit
INCPATH += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
INCPATH += -I$(FX_GLIDE_SW)/texus2/lib
OPTFLAGS ?= -ox -5s
CFLAGS += $(CDEFS) $(OPTFLAGS)
CFLAGS += $(call FIXPATH,$(INCPATH))
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
@@ -121,8 +129,8 @@ CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
# Watcom woes: pass parameters through environment vars
export WCC386 = $(subst /,\,$(CFLAGS))
export WCL386 = -zq
#export WCC386 = $(call FIXPATH,$(CFLAGS))
#export WCL386 = -zq
###############################################################################
# objects
@@ -150,7 +158,7 @@ GLIDE_OBJECTS = \
gsst.obj \
gtex.obj \
gtexdl.obj \
xtexdl_d.obj
xtexdl_def.obj
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
@@ -212,7 +220,7 @@ endif
###############################################################################
.c.obj:
$(CC) -fo=$@ -c $<
$(CC) $(CFLAGS) -fo=$@ -c $<
###############################################################################
# main
@@ -222,11 +230,11 @@ all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): wlib.lbc
$(AR) $(ARFLAGS) -o $(subst /,\,$@) @wlib
$(AR) $(ARFLAGS) -o $(call FIXPATH,$@) @wlib.lbc
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)
$(CC) -fe=$(subst /,\,$@) $(subst /,\,$^)
$(CC) $(CFLAGS) -fe=$(call FIXPATH,$@) $(call FIXPATH,$^)
else
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
endif
@@ -241,10 +249,6 @@ xdraw2_d.obj: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw3_d.obj: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
xtexdl_d.obj: xtexdl_def.c
copy xtexdl_def.c xtexdl_d.c
$(CC) -fo=$@ -c xtexdl_d.c
-$(call UNLINK,xtexdl_d.c)
xdraw2_3.obj: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdraw3_3.obj: xdraw3.asm
@@ -255,15 +259,16 @@ xtexdl_3.obj: xtexdl.asm
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm.exe
$< -inline > $@
$(call FIXPATH,./$<) -inline > $@
fxgasm.h: fxgasm.exe
$< -hex > $@
$(call FIXPATH,./$<) -hex > $@
# -bt without args resets build target to native OS
fxgasm.exe: fxgasm.c
$(CC) -fe=$@ $<
$(CC) $(CFLAGS) -bt -fe=$@ $<
wlib.lbc: $(subst /,\,$(GLIDE_OBJECTS))
wlib.lbc: $(call FIXPATH,$(GLIDE_OBJECTS))
@echo $(addprefix +,$^) > wlib.lbc
###############################################################################
@@ -272,6 +277,7 @@ wlib.lbc: $(subst /,\,$(GLIDE_OBJECTS))
clean:
-$(call UNLINK,*.obj)
-$(call UNLINK,*.o)
-$(call UNLINK,../../cinit/*.obj)
-$(call UNLINK,../../minihwc/*.obj)
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj)

View File

@@ -1,5 +1,7 @@
# OpenWatcom tests makefile for Glide3
# This makefile MUST be processed by GNU make!!!
# Building under native DOS is not supported:
# only tested under Win32 or Linux
#
# Copyright (c) 2004 - Borca Daniel
# Email : dborca@users.sourceforge.net
@@ -26,12 +28,24 @@
FX_GLIDE_HW = h3
TOP = ../../..
# detect if running under unix by finding 'rm' in $PATH :
ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
DOSMODE= 1
UNLINK = del $(subst /,\,$(1))
FIXPATH= $(subst /,\,$1)
else
DOSMODE= 0
UNLINK = $(RM) $(1)
FIXPATH= $1
endif
CC = wcl386
CFLAGS = -bt=dos -wx
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc
CFLAGS += -I$(TOP)/swlibs/fxmisc
CFLAGS = -bt=dos -wx -zq
INCPATH = -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc
INCPATH += -I$(TOP)/swlibs/fxmisc
CFLAGS += -D__DOS__ -DH3
CFLAGS += -D__DOS32__
CFLAGS += $(call FIXPATH,$(INCPATH))
ifdef DEBUG
CFLAGS += -od -d2
@@ -40,24 +54,21 @@ CPU ?= 5s
CFLAGS += -ox -$(CPU)
endif
LDFLAGS = -k16384
# pick either of causeway, dos4g, dos32a or stub32a as link target
LDFLAGS = -zq -k16384 -l=dos32a
LDLIBS = $(TOP)/$(FX_GLIDE_HW)/lib/glide3x.lib
# Watcom woes: pass parameters through environment vars
export WCC386 = $(subst /,\,$(CFLAGS))
export WCL386 = -zq
.c.obj:
$(CC) -fo=$@ -c $<
$(CC) $(CFLAGS) -fo=$@ -c $<
%.exe: tlib.obj %.obj
$(CC) -fe=$@ $(LDFLAGS) $^ $(subst /,\,$(LDLIBS))
$(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS))
all:
$(error Must specify <filename.exe> to build)
sbench.exe: sbench.obj fxos.obj tlib.obj
$(CC) -fe=$@ $(LDFLAGS) $^ $(subst /,\,$(LDLIBS))
$(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS))
fxos.obj: $(TOP)/swlibs/fxmisc/fxos.c
$(CC) -fo=$@ -c $<
fxos.obj: $(call FIXPATH,$(TOP)/swlibs/fxmisc/fxos.c)
$(CC) $(CFLAGS) -fo=$@ -c $<

View File

@@ -1,5 +1,7 @@
# OpenWatcom makefile for Glide3/H5 and Texus2
# This makefile MUST be processed by GNU make!!!
# Building under native DOS is not supported:
# only tested under Win32 or Linux
#
# Copyright (c) 2004 - Daniel Borca
# Email : dborca@users.sourceforge.net
@@ -61,10 +63,15 @@ CC = wcl386
AS = nasm
AR = wlib
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
# detect if running under unix by finding 'rm' in $PATH :
ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
DOSMODE= 1
UNLINK = del $(subst /,\,$(1))
FIXPATH= $(subst /,\,$1)
else
DOSMODE= 0
UNLINK = $(RM) $(1)
FIXPATH= $1
endif
###############################################################################
@@ -109,12 +116,13 @@ ASFLAGS = -O6 -fobj -D__WATCOMD__ --prefix _
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -bt=dos -wx
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 = -bt=dos -wx -zq
INCPATH = -I. -I../../incsrc -I../../minihwc -I../../cinit
INCPATH += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
INCPATH += -I$(FX_GLIDE_SW)/texus2/lib
OPTFLAGS ?= -ox -5s
CFLAGS += $(CDEFS) $(OPTFLAGS)
CFLAGS += $(call FIXPATH,$(INCPATH))
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
@@ -140,8 +148,8 @@ CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
# Watcom woes: pass parameters through environment vars
export WCC386 = $(subst /,\,$(CFLAGS))
export WCL386 = -zq
#export WCC386 = $(call FIXPATH,$(CFLAGS))
#export WCL386 = -zq
###############################################################################
# objects
@@ -169,7 +177,7 @@ GLIDE_OBJECTS = \
gsst.obj \
gtex.obj \
gtexdl.obj \
xtexdl_d.obj
xtexdl_def.obj
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
@@ -245,7 +253,7 @@ endif
###############################################################################
.c.obj:
$(CC) -fo=$@ -c $<
$(CC) $(CFLAGS) -fo=$@ -c $<
###############################################################################
# main
@@ -255,11 +263,11 @@ all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): wlib.lbc
$(AR) $(ARFLAGS) -o $(subst /,\,$@) @wlib
$(AR) $(ARFLAGS) -o $(call FIXPATH,$@) @wlib.lbc
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)
$(CC) -fe=$(subst /,\,$@) $(subst /,\,$^)
$(CC) $(CFLAGS) -fe=$(call FIXPATH,$@) $(call FIXPATH,$^)
else
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
endif
@@ -272,10 +280,6 @@ xdraw2_d.obj: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw3_d.obj: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
xtexdl_d.obj: xtexdl_def.c
copy xtexdl_def.c xtexdl_d.c
$(CC) -fo=$@ -c xtexdl_d.c
-$(call UNLINK,xtexdl_d.c)
xdraw2_3.obj: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdraw3_3.obj: xdraw3.asm
@@ -294,21 +298,22 @@ xtexdl_2.obj: xtexdl.asm
$(GLIDE_OBJECTS): fxinline.h fxgasm.h fxbldno.h
fxinline.h: fxgasm.exe
$< -inline > $@
$(call FIXPATH,./$<) -inline > $@
fxgasm.h: fxgasm.exe
$< -hex > $@
$(call FIXPATH,./$<) -hex > $@
# -bt without args resets build target to native OS
fxgasm.exe: fxgasm.c
$(CC) -fe=$@ $<
$(CC) $(CFLAGS) -bt -fe=$@ $<
fxbldno.h: fxbldno.exe
$< > $@
$(call FIXPATH,./$<) > $@
fxbldno.exe: fxbldno.c
$(CC) -fe=$@ $<
$(CC) -zq -bt -fe=$@ $<
wlib.lbc: $(subst /,\,$(GLIDE_OBJECTS))
wlib.lbc: $(call FIXPATH,$(GLIDE_OBJECTS))
@echo $(addprefix +,$^) > wlib.lbc
###############################################################################
@@ -317,6 +322,7 @@ wlib.lbc: $(subst /,\,$(GLIDE_OBJECTS))
clean:
-$(call UNLINK,*.obj)
-$(call UNLINK,*.o)
-$(call UNLINK,../../cinit/*.obj)
-$(call UNLINK,../../minihwc/*.obj)
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj)

View File

@@ -1,5 +1,7 @@
# OpenWatcom tests makefile for Glide3
# This makefile MUST be processed by GNU make!!!
# Building under native DOS is not supported:
# only tested under Win32 or Linux
#
# Copyright (c) 2004 - Borca Daniel
# Email : dborca@users.sourceforge.net
@@ -26,12 +28,24 @@
FX_GLIDE_HW = h5
TOP = ../../..
# detect if running under unix by finding 'rm' in $PATH :
ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
DOSMODE= 1
UNLINK = del $(subst /,\,$(1))
FIXPATH= $(subst /,\,$1)
else
DOSMODE= 0
UNLINK = $(RM) $(1)
FIXPATH= $1
endif
CC = wcl386
CFLAGS = -bt=dos -wx
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc
CFLAGS += -I$(TOP)/swlibs/fxmisc
CFLAGS = -bt=dos -wx -zq
INCPATH = -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc
INCPATH += -I$(TOP)/swlibs/fxmisc
CFLAGS += -D__DOS__ -DH3
CFLAGS += -D__DOS32__
CFLAGS += $(call FIXPATH,$(INCPATH))
ifdef DEBUG
CFLAGS += -od -d2
@@ -40,24 +54,21 @@ CPU ?= 5s
CFLAGS += -ox -$(CPU)
endif
LDFLAGS = -k32768
# pick either of causeway, dos4g, dos32a or stub32a as link target
LDFLAGS = -zq -k32768 -l=dos32a
LDLIBS = $(TOP)/$(FX_GLIDE_HW)/lib/glide3x.lib
# Watcom woes: pass parameters through environment vars
export WCC386 = $(subst /,\,$(CFLAGS))
export WCL386 = -zq
.c.obj:
$(CC) -fo=$@ -c $<
$(CC) $(CFLAGS) -fo=$@ -c $<
%.exe: tlib.obj %.obj
$(CC) -fe=$@ $(LDFLAGS) $^ $(subst /,\,$(LDLIBS))
$(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS))
all:
$(error Must specify <filename.exe> to build)
sbench.exe: sbench.obj fxos.obj tlib.obj
$(CC) -fe=$@ $(LDFLAGS) $^ $(subst /,\,$(LDLIBS))
$(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS))
fxos.obj: $(TOP)/swlibs/fxmisc/fxos.c
$(CC) -fo=$@ -c $<
fxos.obj: $(call FIXPATH,$(TOP)/swlibs/fxmisc/fxos.c)
$(CC) $(CFLAGS) -fo=$@ -c $<

View File

@@ -1,5 +1,7 @@
# OpenWatcom makefile for Glide3/SST1 and Texus2
# This makefile MUST be processed by GNU make!!!
# Building under native DOS is not supported:
# only tested under Win32 or Linux
#
# Copyright (c) 2004 - Daniel Borca
# Email : dborca@users.sourceforge.net
@@ -52,10 +54,15 @@ CC = wcl386
AS = nasm
AR = wlib
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
# detect if running under unix by finding 'rm' in $PATH :
ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
DOSMODE= 1
UNLINK = del $(subst /,\,$(1))
FIXPATH= $(subst /,\,$1)
else
DOSMODE= 0
UNLINK = $(RM) $(1)
FIXPATH= $1
endif
###############################################################################
@@ -108,12 +115,13 @@ ASFLAGS = -O6 -fobj -D__WATCOMD__ --prefix _
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -bt=dos -wx
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 = -bt=dos -wx -zq
INCPATH = -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96
INCPATH += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
INCPATH += -I$(FX_GLIDE_SW)/texus2/lib
OPTFLAGS ?= -ox -5s
CFLAGS += $(CDEFS) $(OPTFLAGS)
CFLAGS += $(call FIXPATH,$(INCPATH))
ifeq ($(USE_X86),1)
CFLAGS += -DGL_X86
@@ -122,8 +130,8 @@ CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
# Watcom woes: pass parameters through environment vars
export WCC386 = $(subst /,\,$(CFLAGS))
export WCL386 = -zq
#export WCC386 = $(call FIXPATH,$(CFLAGS))
#export WCL386 = -zq
###############################################################################
# objects
@@ -226,7 +234,7 @@ endif
###############################################################################
.c.obj:
$(CC) -fo=$@ -c $<
$(CC) $(CFLAGS) -fo=$@ -c $<
###############################################################################
# main
@@ -236,11 +244,11 @@ all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): wlib.lbc
$(AR) $(ARFLAGS) -o $(subst /,\,$@) @wlib
$(AR) $(ARFLAGS) -o $(call FIXPATH,$@) @wlib.lbc
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)
$(CC) -fe=$(subst /,\,$@) $(subst /,\,$^)
$(CC) $(CFLAGS) -fe=$(call FIXPATH,$@) $(call FIXPATH,$^)
else
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
endif
@@ -257,40 +265,64 @@ xdraw96.obj: xdraw96.asm
$(AS) -o $@ $(ASFLAGS) $<
ifeq ($(FX_GLIDE_HW),sst96)
ifeq ($(DOSMODE),1)
..\..\init\initvg\gamma.obj: ..\..\init\initvg\gamma.c
$(CC) -fo=$@ -USST96 -c $<
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
..\..\init\initvg\dac.obj: ..\..\init\initvg\dac.c
$(CC) -fo=$@ -USST96 -c $<
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
..\..\init\initvg\video.obj: ..\..\init\initvg\video.c
$(CC) -fo=$@ -USST96 -c $<
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
..\..\init\initvg\parse.obj: ..\..\init\initvg\parse.c
$(CC) -fo=$@ -USST96 -c $<
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
..\..\init\initvg\sli.obj: ..\..\init\initvg\sli.c
$(CC) -fo=$@ -USST96 -c $<
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
..\..\init\initvg\util.obj: ..\..\init\initvg\util.c
$(CC) -fo=$@ -USST96 -c $<
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
..\..\init\initvg\info.obj: ..\..\init\initvg\info.c
$(CC) -fo=$@ -USST96 -c $<
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
..\..\init\initvg\print.obj: ..\..\init\initvg\print.c
$(CC) -fo=$@ -USST96 -c $<
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
..\..\init\initvg\gdebug.obj: ..\..\init\initvg\gdebug.c
$(CC) -fo=$@ -USST96 -c $<
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
..\..\init\initvg\sst1init.obj: ..\..\init\initvg\sst1init.c
$(CC) -fo=$@ -USST96 -c $<
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
else
../../init/initvg/gamma.obj: ../../init/initvg/gamma.c
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/dac.obj: ../../init/initvg/dac.c
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/video.obj: ../../init/initvg/video.c
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/parse.obj: ../../init/initvg/parse.c
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/sli.obj: ../../init/initvg/sli.c
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/util.obj: ../../init/initvg/util.c
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/info.obj: ../../init/initvg/info.c
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/print.obj: ../../init/initvg/print.c
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/gdebug.obj: ../../init/initvg/gdebug.c
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/sst1init.obj: ../../init/initvg/sst1init.c
$(CC) -fo=$@ $(CFLAGS) -USST96 -c $<
endif
endif
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm.exe
$< -inline > $@
$(call FIXPATH,./$<) -inline > $@
fxgasm.h: fxgasm.exe
$< -hex > $@
$(call FIXPATH,./$<) -hex > $@
# -bt without args resets build target to native OS
fxgasm.exe: fxgasm.c
$(CC) -fe=$@ $<
$(CC) $(CFLAGS) -bt -fe=$@ $<
wlib.lbc: $(subst /,\,$(GLIDE_OBJECTS))
wlib.lbc: $(call FIXPATH,$(GLIDE_OBJECTS))
@echo $(addprefix +,$^) > wlib.lbc
###############################################################################
@@ -299,6 +331,7 @@ wlib.lbc: $(subst /,\,$(GLIDE_OBJECTS))
clean:
-$(call UNLINK,*.obj)
-$(call UNLINK,*.o)
-$(call UNLINK,../../init/*.obj)
-$(call UNLINK,../../init/initvg/*.obj)
-$(call UNLINK,../../init/init96/*.obj)

View File

@@ -1,5 +1,7 @@
# OpenWatcom tests makefile for Glide3
# This makefile MUST be processed by GNU make!!!
# Building under native DOS is not supported:
# only tested under Win32 or Linux
#
# Copyright (c) 2004 - Borca Daniel
# Email : dborca@users.sourceforge.net
@@ -37,12 +39,24 @@ endif
override FX_HW_BASE = sst1
TOP = ../../..
# detect if running under unix by finding 'rm' in $PATH :
ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
DOSMODE= 1
UNLINK = del $(subst /,\,$(1))
FIXPATH= $(subst /,\,$1)
else
DOSMODE= 0
UNLINK = $(RM) $(1)
FIXPATH= $1
endif
CC = wcl386
CFLAGS = -bt=dos -wx
CFLAGS += -I$(TOP)/$(FX_HW_BASE)/glide3/src -I$(TOP)/$(FX_HW_BASE)/incsrc -I$(TOP)/$(FX_HW_BASE)/init
CFLAGS += -I$(TOP)/swlibs/fxmisc
CFLAGS = -bt=dos -wx -zq
INCPATH = -I$(TOP)/$(FX_HW_BASE)/glide3/src -I$(TOP)/$(FX_HW_BASE)/incsrc -I$(TOP)/$(FX_HW_BASE)/init
INCPATH += -I$(TOP)/swlibs/fxmisc
CFLAGS += -D__DOS__ $(HWDEF)
CFLAGS += -D__DOS32__
CFLAGS += $(call FIXPATH,$(INCPATH))
ifdef DEBUG
CFLAGS += -od -d2
@@ -51,24 +65,21 @@ CPU ?= 5s
CFLAGS += -ox -$(CPU)
endif
LDFLAGS = -k16384
# pick either of causeway, dos4g, dos32a or stub32a as link target
LDFLAGS = -zq -k16384 -l=dos32a
LDLIBS = $(TOP)/$(FX_HW_BASE)/lib/$(FX_GLIDE_HW)/glide3x.lib
# Watcom woes: pass parameters through environment vars
export WCC386 = $(subst /,\,$(CFLAGS))
export WCL386 = -zq
.c.obj:
$(CC) -fo=$@ -c $<
$(CC) $(CFLAGS) -fo=$@ -c $<
%.exe: tlib.obj %.obj
$(CC) -fe=$@ $(LDFLAGS) $^ $(subst /,\,$(LDLIBS))
$(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS))
all:
$(error Must specify <filename.exe> to build)
sbench.exe: sbench.obj fxos.obj tlib.obj
$(CC) -fe=$@ $(LDFLAGS) $^ $(subst /,\,$(LDLIBS))
$(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS))
fxos.obj: $(TOP)/swlibs/fxmisc/fxos.c
$(CC) -fo=$@ -c $<
fxos.obj: $(call FIXPATH,$(TOP)/swlibs/fxmisc/fxos.c)
$(CC) $(CFLAGS) -fo=$@ -c $<