ldecNumber

Artifact [9165ad1180]
Login

Artifact [9165ad1180]

Artifact 9165ad118003748fbd0fe3dae68334446b0bf852:


# makefile for decNumber library for Lua
#
# Created September 3, 2006 by e
# This version of the Makefile has been used on WinXP with MinGW/MSYS
# Subversion is used for version control 
#   and generation of version info for headers and file names
# Be sure to "make install" before "make testall"

# change these to reflect your Lua installation
LUA= /usr/local
LUAINC= $(LUA)/include
LUALIB= $(LUA)/lib
LUABIN= $(LUA)/bin
LUALUA= $(LUA)/lua

TMP=./tmp
DISTDIR=./archive

# no need to change anything below here - HAH!
CFLAGS= $(INCS) $(DEFS) $(WARN) -O2 $(SHFLAGS)
#SHFLAGS= -fPIC
SHFLAGS=
WARN= -Wall #-ansi -pedantic -Wall
INCS= -I$(LUAINC) -IdecNumber
#LIBS= -L$(LUALIB) -llualib5 -llua5
LIBS= -L$(LUALIB) -llua51

MYNAME= decNumber
MYLIB= l$(MYNAME)
VER=$(shell svnversion -c . | sed 's/.*://')
TARFILE = $(DISTDIR)/$(MYLIB)-$(VER).tar.gz

OBJS= $(MYLIB).o decNumber/decNumber.o decNumber/decContext.o
#T= $(MYLIB).so
T= $(MYLIB).dll

TESTLIBS=test/lperformance.DLL

all: $T

$T:	$(OBJS)
	$(CC) $(SHFLAGS) -o $@ -shared $(OBJS) $(LIBS)

$(MYLIB).o: version.h

version.h: vcheck

vcheck:
	SubWCRev `pwd` version.in version.h

test: $T
	cd test; $(LUABIN)/lua.exe ldecNumberUnitTest.lua
	cd test; $(LUABIN)/lua.exe ldecNumberThreadsTest.lua
	cd test; $(LUABIN)/lua.exe ldecNumberTestDriver.lua

# testall will only work on Windows unless you remove/rewrite performance tests

testall: $T $(TESTLIBS) test
	cd test; $(LUABIN)/lua.exe ldecNumberPerf.lua

test/lperformance.DLL:	test/lperformance.o
	$(CC) $(SHFLAGS) -o $@ -shared test/lperformance.o $(LIBS)

install:
	cp $T $(LUABIN)

clean:
	rm -f $(OBJS) $T core core.* a.out

td:
	touch $(MYLIB)-$(VER).tar.gz

dist: vcheck
	echo 'Exporting...'
	mkdir -p $(TMP)
	mkdir -p $(DISTDIR)
	svn export -r HEAD . $(TMP)/$(MYLIB)-$(VER)
	cp -p version.h $(TMP)/$(MYLIB)-$(VER)
	cp -p doc/decNumber.pdf $(TMP)/$(MYLIB)-$(VER)/doc
	cp -p doc/ldecNumber.pdf $(TMP)/$(MYLIB)-$(VER)/doc
	cp -p doc/ldecNumber.xhtml $(TMP)/$(MYLIB)-$(VER)/doc
	echo 'Compressing...'
	tar -zcf $(TARFILE) -C $(TMP) $(MYLIB)-$(VER)
	rm -fr $(TMP)/$(MYLIB)-$(VER)
	echo 'Done.'

.PHONY: all vcheck test testall clean td dist install