Category : C++ Source Code
Archive   : OS2SDI.ZIP
Filename : MAKEFILE
Output of file : MAKEFILE contained in archive : OS2SDI.ZIP
MYROOT=SDIBar
OBJS=$(MYROOT).obj app.obj
LIBS=
TARGET=$(MYROOT)
.autodepend
.swap
#----------------------------------------------------------------------------
# fill in defaults
#----------------------------------------------------------------------------
!if !$d(WIN16) && !$d(WIN32)
WIN16 = 1
!endif
!if !$d(USESTATIC)
USEDLL = 1
!endif
!if $d(USEDLL)
_USEDLL = 1
!endif
!if $d(WIN32)
MODEL = f
!else
! if $d(USEDLL)
MODEL = l
! elif !$d(MODEL)
! if $d(DEFMODEL)
MODEL = $(DEFMODEL)
! else
MODEL = l
! endif
! endif
DMODEL= l
!endif
!if $(DEFMODEL) != s && $(MODEL) == s
! error "Small model not supported for this example"
!endif
#----------------------------------------------------------------------------
# debug & diagnostic flags
#----------------------------------------------------------------------------
!if $d(DEBUG)
CDBG = -v -k -Od
! if $d(WIN32)
LDBG = -v
! else
LDBG = -v -Vt
! endif
!endif
!if $d(DIAGS) # default diags use precondition, check, trace & warn
__DEBUG=2
__TRACE=1
__WARN=1
BD=d # Use Bids Diag version
BDO=db # Use Bids Diag version, old 'db' name
OD=d # Use Owl Diag version
!endif
!if $d(__DEBUG)
CDIAG = -D__DEBUG=$(__DEBUG)
!endif
!if $d(__TRACE)
CDIAG = $(CDIAG) -D__TRACE
!endif
!if $d(__WARN)
CDIAG = $(CDIAG) -D__WARN
!endif
#----------------------------------------------------------------------------
# dir & search paths
#----------------------------------------------------------------------------
!if !$d(BCROOT)
! include $(MAKEDIR)\bcroot.inc
!endif
!if !$d(OWLLIBDIR)
OWLLIBDIR = $(BCROOT)\lib
!endif
!if !$d(OWLINCDIR)
OWLINCDIR = $(BCROOT)\include
!endif
BCBINDIR = $(BCROOT)\bin
BCINCDIR = $(BCROOT)\include
BCLIBDIR = $(BCROOT)\lib
LIBPATH = $(BCLIBDIR)
!if "$(OWLINCDIR)" == "$(BCINCDIR)"
INCLUDE = $(BCINCDIR)
RCINCLUDEPATH = -i$(BCINCDIR)
!else
INCLUDE = $(OWLINCDIR);$(BCINCDIR)
RCINCLUDEPATH = -i$(OWLINCDIR) -i$(BCINCDIR)
!endif
#
# Path for default OWL make file and def file
#
!if !$d(OWLMAKDIR)
OWLMAKDIR=$(BCROOT)\examples\owl
!endif
#
# If OWLPCH is defined, then build command line for compiler that includes
# the CSM filename, and the owl header file to end the precompile.
#
!if $d(OWLPCH)
! if $d(DLL)
! if $d(WIN32)
KEY = wfi
! else
KEY = wi
! endif
! else
KEY = w$(MODEL)
! endif
CPCH = -H=$(OWLLIBDIR)\owl$(OD)$(KEY).csm -H"owl\owlpch.h" -D_OWLPCH
!endif
#----------------------------------------------------------------------------
# library names
# OWLDLIBS - Owl libs for use by DLLs
# STDDLIBS - RTL libs for use by DLLs
# OWLLIBS - Owl libs for use by current model
# STDLIBS - RTL libs for use by current model
# MATHLIB - Math library for current model
# C0D - Startup code for DLLs
# C0 - Startup code for current model
#----------------------------------------------------------------------------
!if $d(WIN32)
OWLDLIBS = $(OWLLIBDIR)\owl$(OD)wfi $(BCLIBDIR)\bids$(BD)fi
STDDLIBS = $(BCLIBDIR)\imprtw32 $(BCLIBDIR)\import32 $(BCLIBDIR)\cw32i
MATHLIB =
C0 = $(BCLIBDIR)\c0w32
C0D = $(BCLIBDIR)\c0d32
! if $d(USEDLL)
OWLLIBS = $(OWLDLIBS)
STDLIBS = $(STDDLIBS)
! else
OWLLIBS = $(OWLLIBDIR)\owl$(OD)wf /v- $(BCLIBDIR)\bids$(BD)f
STDLIBS = $(BCLIBDIR)\imprtw32 $(BCLIBDIR)\import32 $(BCLIBDIR)\cw32
! endif
!else #WIN16
OWLDLIBS = $(OWLLIBDIR)\owl$(OD)wi $(BCLIBDIR)\bids$(BD)i
STDDLIBS = $(BCLIBDIR)\import $(BCLIBDIR)\crtldll
MATHLIB = $(BCLIBDIR)\mathw$(MODEL)
C0 = $(BCLIBDIR)\c0w$(MODEL)
C0D = $(BCLIBDIR)\c0d$(DMODEL)
! if $d(USEDLL)
OWLLIBS = $(OWLDLIBS)
STDLIBS = $(STDDLIBS)
! else
OWLLIBS = $(OWLLIBDIR)\owl$(OD)w$(MODEL) /v- $(BCLIBDIR)\bids$(BDO)$(MODEL)
STDLIBS = $(BCLIBDIR)\import $(BCLIBDIR)\cw$(MODEL)
! endif
!endif #$d(WIN32)
#----------------------------------------------------------------------------
# tools and options for 32bit
#----------------------------------------------------------------------------
!if $d(WIN32)
BCC = bcc32
BRCC = brcc32
TLINK = tlink32
RLINK = rlink32
COPTS = -d -k- -vi- -Od $(COPTS)
#COPTS = -3 -d -k- -O1gmpv -vi $(COPTS)
COPTSD = -d -k- -Od
#COPTSD = -3 -d -k- -O1gmpv -vi
CFGFILE = bcc32.cfg
!if $d(USEDLL)
CFLAGS = -WE -w -D_USEDLL $(COPTS)
!else
CFLAGS = -WE -w $(COPTS)
!endif
CFLAGSD = -WDE -w $(COPTSD)
CFLAGSUD = -WE -w -D_USEDLL $(COPTSD)
LFLAGS = $(LDBG) -Tpe -aa -m -c
LFLAGSD = $(LDBG) -Tpd -aa -m -c
#----------------------------------------------------------------------------
# tools and options for 16bit
#----------------------------------------------------------------------------
!else
BCC = bcc
BRCC = brcc
TLINK = tlink
RLINK = rlink -K
COPTS = -3 -d -k- -O1gmpv -xd $(COPTS)
!if $(MODEL) != s && $(MODEL) != m
CDC = -dc # -dc shouldn't be used in small & medium
!endif
CFGFILE = turboc.cfg
!if $d(USEDLL)
CFLAGS = -WS -w -D_USEDLL $(COPTS) $(CDC) -m$(MODEL)
!else
CFLAGS = -WSE -w $(COPTS) $(CDC) -m$(MODEL)
!endif
CFLAGSD = -WDE -w $(COPTS) $(CDC) -m$(DMODEL) # building DLLs
CFLAGSUD = -WS -w -D_USEDLL $(COPTS) $(CDC) -m$(DMODEL) # using DLLs
LFLAGS = $(LDBG) -Tw -m -c -C -A=16 -E -s
LFLAGSD = $(LDBG) -Twd -m -c -C -A=16 -E
!endif #if/else $d(WIN32)
#---------------------------------------------------------------------------
# rules
#---------------------------------------------------------------------------
.rc.res:
$(BRCC) -r $(RCINCLUDEPATH) $.
.cpp.obj:
$(BCC) $.
#----------------------------------------------------------------------------
# Default, implicit link rule assumes one OBJ and one RES file w/ same name
# Apps with different arrangements need to use an explicit rule
#----------------------------------------------------------------------------
.obj.exe:
$(TLINK) $(LFLAGS) @&&|
$(C0) $&
$&
$(LIBS) $(OWLLIBS) $(STDLIBS)
$(OWLMAKDIR)\owl.def $(RESLINK)
|
#----------------------------------------------------------------------------
# targets
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Make will build the first dependency if no explicit target is specified
# This allows make to be used with no arguments
# One of various target macros can be defined to get the right dependencies
# TARGET - cpp + rc to build exe w/ res
# TARGETNR - cpp to build exe w/o res
#----------------------------------------------------------------------------
!if $d(TARGET)
all: cfgfile $(TARGET).exe
!if !$d(OBJS)
OBJS = $(TARGET).obj
!endif
RESLINK =,$(TARGET).res
$(TARGET).exe: $(OBJS) $(TARGET).res
!endif
!if $d(TARGETNR)
all: cfgfile $(TARGETNR).exe
!if !$d(OBJS)
OBJS = $(TARGETNR).obj
!endif
$(TARGETNR).exe: $(OBJS)
$(TLINK) $(LFLAGS) @&&|
$(C0) $&
$&
$(LIBS) $(OWLLIBS) $(STDLIBS)
$(OWLMAKDIR)\owl.def
|
!endif
#----------------------------------------------------------------------------
# Create a local .cfg file with include path & other options
#----------------------------------------------------------------------------
cfgfile:
@echo -I$(INCLUDE) > $(CFGFILE)
@echo -c $(CFLAGS) $(CDBG) >> $(CFGFILE)
@echo -c $(CDIAG) $(CPCH) >> $(CFGFILE)
$(CFGFILE):
@echo -I$(INCLUDE) > $(CFGFILE)
@echo -c $(CFLAGS) $(CDBG) >> $(CFGFILE)
@echo -c $(CDIAG) $(CPCH) >> $(CFGFILE)
#----------------------------------------------------------------------------
# Delete unnecessary files after building
#----------------------------------------------------------------------------
clean:
@if exist *.obj del *.obj
@if exist *.exe del *.exe
@if exist *.scr del *.scr
@if exist *.res del *.res
@if exist *.rws del *.rws
@if exist *.dll del *.dll
@if exist *.lib del *.lib
@if exist *.map del *.map
@if exist *.csm del *.csm
@if exist *.dsk del *.dsk
@if exist turboc.cfg del turboc.cfg
@if exist tlink.cfg del tlink.cfg
@if exist *.tdr del *.tdr
@if exist *.tdw del *.tdw
$(MYROOT).exe: $(OBJS) $(MYROOT).res
$(TLINK) $(LFLAGS) @&&|
$(C0) $(OBJS)
$&
$&
$(LIBS) $(OWLLIBS) $(STDLIBS)
$&.def
$&.res
|
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/