File: Makefile

package info (click to toggle)
simpledb 1.5-1.4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, squeeze
  • size: 888 kB
  • ctags: 238
  • sloc: cpp: 529; makefile: 127; perl: 23; sh: 9
file content (109 lines) | stat: -rw-r--r-- 3,283 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# __BEGIN_COPYRIGHT
# SimpleDB API
# 
# Copyright (C) 2005 Eminence Technology Pty Ltd
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
# 
# You can view the GNU Lesser General Public Licence at
# http://www.gnu.org/licenses/lgpl.html or you can write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# 
# Eminence Technology Pty Ltd can be contacted by writing to
# Eminence Technology, PO Box 118, Moorooka QLD 4105, Australia.
# Alternatively, you may email opensource [at] eminence [dot] com [dot] au
# __END_COPYRIGHT

prefix=/usr/local
exec_prefix=$(prefix)
libdir=$(exec_prefix)/lib
includedir=$(prefix)/include

OBJ_FILES=Query.o Column.o LongColumn.o StringColumn.o Database.o SimpleDBFactory.o Exception.o BoolColumn.o
LIB_NAME=libSimpleDB
include version

LIB_VERSION=$(SO_VER).$(MAJ_VER).$(REV)

GXX=gcc
CXXFLAGS=-g

.PHONY : all clean copyright_notice

all : $(LIB_NAME).so.$(LIB_VERSION) doc

doc :
	doxygen

copyright_notice :
	for sourcefile in \
		*.cpp *.h Makefile examples/*.cpp examples/Makefile; do \
		cat $$sourcefile | \
		./populateKeyword.pl COPYRIGHT COPYRIGHT > temp; \
		mv temp $$sourcefile; \
	done

version_temp :
	echo $(MAJ_VER).$(REV) > version_temp
	cat README | ./populateKeyword.pl VERSION version_temp > temp
	mv temp README
	cat SimpleDB.h | ./populateKeyword.pl VERSION version_temp > temp
	mv temp SimpleDB.h


install : $(LIB_NAME).so.$(LIB_VERSION)
	install -d $(includedir)/SimpleDB $(libdir)
	cp $< $(libdir)/
	cd $(libdir); ln -s $(LIB_NAME).so.$(LIB_VERSION) $(LIB_NAME).so.$(SO_VER); \
		ln -s $(LIB_NAME).so.$(SO_VER) $(LIB_NAME).so
	cp *.h $(includedir)/SimpleDB/

install-strip : install
	strip $(libdir)/$(LIB_NAME).so.$(LIB_VERSION)


uninstall :
	rm -rf $(includedir)/SimpleDB
	rm -f $(libdir)/$(LIB_NAME).so*

dist : maintainer-clean version_temp copyright_notice doc
	ln -s $(CURDIR) ../simpledb-$(MAJ_VER).$(REV)
	cd ..; tar --exclude=CVS --exclude=debian -czf simpledb-$(MAJ_VER).$(REV).tar.gz \
		simpledb-$(MAJ_VER).$(REV)/*
	rm ../simpledb-$(MAJ_VER).$(REV)

$(LIB_NAME).so.$(LIB_VERSION) : $(OBJ_FILES)
	$(CXX) -shared -Wl,-soname,$(LIB_NAME).so.$(SO_VER) -lstdc++ -lodbc -o $@ $(OBJ_FILES)

%.o : %.cpp
	$(CXX) -fPIC $(CXXFLAGS) -c $<

clean :
	rm -f *.so.* *.o version_temp

distclean : clean

maintainer-clean : clean
	rm -rf doc
	rm -f *~
	make -C examples clean

# only run this with each new revision that is released
tag :
	cvs tag v$(MAJ_VER)-$(REV)

# rules to do with sourceforge project maintainence
install-sf:
	cd doc; tar -cj * | ssh eminence_tech@shell.sourceforge.net "tar -xj -C /home/groups/s/si/simpledb/htdocs"
	./install-sf.sh .. simpledb-$(MAJ_VER).$(REV).tar.gz
	./install-sf.sh .. libsimpledb-dev_$(MAJ_VER).$(REV)_all.deb
	./install-sf.sh .. libsimpledb1_$(MAJ_VER).$(REV)_i386.deb