[Expat-discuss] Borland makefile for 1.95.1

Bob Jamison rjamison@lincom-asg.com
Fri, 27 Apr 2001 15:49:41 -0500


Hi, guys,

I don't know if this thing would be useful to anyone,
but recently I needed to make a static linking library
for Win32.  I couldn't find out how to add another
target to a VC++ project, so I used Borland.

So if anyone could use it, here it a Makefile for Borland
C++ 5 (or 5.5), command-line style.  It makes the DLL,
import lib, and static lib fairly cleanly. 

By the way, the Borland C++ command-line compiler has
been a free download for the last few months. (which
is a great deal, I think).

Another thought:  since several Win32 compilers are becoming
either fairly cheap or free, it might help to use a common
compiler switch for all of them.  Would it maybe be possible
to use  '__WIN32__' instead of  'COMPILED_FROM_DSP'  ?
This is pre-defined, and does not need to be set in either VC++ or
Borland.  Just a suggestion.

Anyway, I hope this is of use to someone.  Thanks
for maintaining this nice library.  I'll see what I can do for
the CVS version soon.


Bob




===== SNIP! ======

#########################################################################
## Borland C++ 5 Makefile for Expat
## Date: 01 Apr 01
## Author: Bob Jamison
#########################################################################
## NOTES
## This file works with Borland C++ Builder's 5's
## command-line compiler,  The IDE-less compiler is also
## available as a free download at http://Borland.com.
##
## Please note that this makefile requires the Borland C++ \bin
## directory to be in the current PATH setting.
##
## To use, type
## make -f Makefile.bcc
##    to build
##         expat.dll       - the main Dymanic Link Library
##         expat.lib       - the corresponding import library
##         expatstatic.lib - a static linking library, possibly
##                           producing smaller executables
## make -f Makefile.bcc clean
##    Removes objects from directory
##
## On the first build, you can ignore the Tlib "not found" warnings.
##
#########################################################################

EXPAT_MAJOR_VERSION=1
EXPAT_MINOR_VERSION=95
EXPAT_EDIT=1

EXPAT_VERSION=$(EXPAT_MAJOR_VERSION).$(EXPAT_MINOR_VERSION).$(EXPAT_EDIT)
VERSION="\"$(EXPAT_VERSION)\""

CC     = bcc32
LINK   = ilink32
AR     = tlib
USERDEFINES = _DEBUG;COMPILED_FROM_DSP;VERSION=$(VERSION)
WARNINGS = -w-rch -w-par -w-ccc
CFLAGS = -O2 -H- -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi- -c -tW -tWM

all: expat.dll expatstatic.lib

OBJ    = xmlparse.obj xmlrole.obj xmltok.obj

SRCS   = xmlparse.c xmlrole.c xmltok.c


.c.obj:
   $(CC) $(CFLAGS) $(WARNINGS) -D$(USERDEFINES) -n$(@D) {$< }


expat.dll: $(OBJ)
   $(CC) -WD -lGi -eexpat.dll $(OBJ)
  

expatstatic.lib: $(OBJ)
   $(AR) /u expatstatic.lib $(OBJ)


clean:
   del /q /f $(OBJ) *.tds expat.dll expat.lib expatstatic.lib


==== UN-SNIP =====