1#   Makefile for  gpsmanshp.c (Tcl 8.4 except 8.4.4)
2#
3#    A layer for writing GPS data to Shapefile format files
4#    using shapelib from Tcl, as a Tcl package
5#
6#    This program was developed for use with
7#    gpsman --- GPS Manager: a manager for GPS receiver data
8#
9#    Copyright (c) 2003-2013 Miguel Filgueiras (migfilg@t-online.de)
10#
11#     This program is free software; you can redistribute it and/or modify
12#       it under the terms of the GNU General Public License as published by
13#       the Free Software Foundation; either version 3 of the License, or
14#       (at your option) any later version.
15#
16#     This program is distributed in the hope that it will be useful,
17#       but WITHOUT ANY WARRANTY; without even the implied warranty of
18#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19#       GNU General Public License for more details.
20#
21#       You should have received a copy of the GNU General Public License
22#       along with this program.
23#
24
25VERSION = 1.2.3
26
27TCLVERSION ?= 8.4
28TCLLVERSION = $(TCLVERSION:S/.//)
29
30INSTALLDIR = ${DESTDIR}${PREFIX}/lib/tcl$(TCLVERSION)/gpsmanshp-$(VERSION)
31
32CFLAGS += -Wall -fPIC -c -I${LOCALBASE}/include/tcl$(TCLVERSION)
33CFLAGS += -I${LOCALBASE}/include
34LINKOPT = -L${LOCALBASE}/lib -lshp -ltcl$(TCLLVERSION)
35
36all:	pkgIndex.tcl
37
38gpsmanshp.so: gpsmanshp.o
39	$(CC) -shared -o gpsmanshp.so $(LINKOPT) gpsmanshp.o
40
41gpsmanshp.o: gpsmanshp.c
42	$(CC) $(CFLAGS) gpsmanshp.c
43
44pkgIndex.tcl: gpsmanshp.so
45	echo "pkg_mkIndex -lazy -verbose . gpsmanshp.so" | tclsh$(TCLVERSION)
46	chmod 644 gpsmanshp.so pkgIndex.tcl
47
48install: pkgIndex.tcl
49	-mkdir -p $(INSTALLDIR)
50	$(BSD_INSTALL_LIB) gpsmanshp.so $(INSTALLDIR)/
51	$(BSD_INSTALL_SCRIPT) pkgIndex.tcl $(INSTALLDIR)/
52
53clean:
54	rm -f gpsmanshp.o gpsmanshp.so pkgIndex.tcl G*.aux G*.log
55
56www : GPSManSHP.tex
57	hyperlatex GPSManSHP.tex
58	chmod 644 gpsmanshp-www/GPSManSHP*.html
59#	scp -p gpsmanshp-www/GPSManSHP*.html gpsmanshp@ssh:public_html
60
61distrib: GPSManSHP.tex gpsmanshp.c gpstr2shp.c Makefile
62	-mkdir -m 755 gpsmanshp_$(VERSION)
63	rm -fr gpsmanshp_$(VERSION)/*
64	cp gpsmanshp.c gpstr2shp.c Makefile Makefile*[0-9] gpsmanshp_$(VERSION)
65	chmod 644 gpsmanshp_$(VERSION)/*
66	mkdir -m 755 gpsmanshp_$(VERSION)/doc
67	pdflatex GPSManSHP.tex
68	pdflatex GPSManSHP.tex
69	cp GPSManSHP.pdf gpsmanshp_$(VERSION)/doc
70#	hyperlatex GPSManSHP.tex
71#	cp gpsmanshp-www/GPSManSHP*.html gpsmanshp-www/*.gif gpsmanshp-www/GPL.txt gpsmanshp_$(VERSION)/doc
72	chmod 644 gpsmanshp_$(VERSION)/doc/*
73	tar czvf gpsmanshp_$(VERSION).tgz gpsmanshp_$(VERSION)
74#	zip -r gpsmanshp_$(VERSION).zip gpsmanshp_$(VERSION)
75#	chmod 644 gpsmanshp_$(VERSION).tgz gpsmanshp_$(VERSION).zip
76	chmod 644 gpsmanshp_$(VERSION).tgz
77#	scp -p gpsmanshp-www/GPSManSHP*.html gpsmanshp_$(VERSION).tgz gpsmanshp_$(VERSION).zip gpsmanshp@ssh:public_html
78	sha1sum gpsmanshp_$(VERSION).tgz > distrib/gpsmanshp_$(VERSION).tgz.sha1sum
79	mv gpsmanshp_$(VERSION).tgz distrib
80
81