1#   Makefile for  gpsmanshp.c (not for use with Tcl 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.5
28
29INSTALLDIR = /usr/lib/tcl$(TCLVERSION)
30
31CFLAGS = -Wall -fPIC -c -I/usr/include/tcl8.4
32LINKOPT = -lshp -ltcl8.4
33
34gpsmanshp.so: gpsmanshp.o
35	$(CC) -shared -o gpsmanshp.so $(LINKOPT) gpsmanshp.o
36
37gpsmanshp.o: gpsmanshp.c
38	$(CC) $(CFLAGS) gpsmanshp.c
39
40pkgIndex.tcl: gpsmanshp.so
41	echo "pkg_mkIndex -lazy -verbose . gpsmanshp.so" | tclsh$(TCLVERSION)
42	chmod 644 gpsmanshp.so pkgIndex.tcl
43
44install: pkgIndex.tcl
45	-mkdir $(INSTALLDIR)
46	cp gpsmanshp.so pkgIndex.tcl $(INSTALLDIR)
47
48clean:
49	rm -f gpsmanshp.o gpsmanshp.so pkgIndex.tcl G*.aux G*.log
50
51www : GPSManSHP.tex
52	hyperlatex GPSManSHP.tex
53	chmod 644 gpsmanshp-www/GPSManSHP*.html
54#	scp -p gpsmanshp-www/GPSManSHP*.html gpsmanshp@ssh:public_html
55
56distrib: GPSManSHP.tex gpsmanshp.c gpstr2shp.c Makefile
57	-mkdir -m 755 gpsmanshp_$(VERSION)
58	rm -fr gpsmanshp_$(VERSION)/*
59	cp gpsmanshp.c gpstr2shp.c Makefile Makefile*[0-9] gpsmanshp_$(VERSION)
60	chmod 644 gpsmanshp_$(VERSION)/*
61	mkdir -m 755 gpsmanshp_$(VERSION)/doc
62	pdflatex GPSManSHP.tex
63	pdflatex GPSManSHP.tex
64	cp GPSManSHP.pdf gpsmanshp_$(VERSION)/doc
65	hyperlatex GPSManSHP.tex
66	cp gpsmanshp-www/GPSManSHP*.html gpsmanshp-www/*.gif gpsmanshp-www/GPL.txt gpsmanshp_$(VERSION)/doc
67	chmod 644 gpsmanshp_$(VERSION)/doc/*
68	tar czvf gpsmanshp_$(VERSION).tgz gpsmanshp_$(VERSION)
69	zip -r gpsmanshp_$(VERSION).zip gpsmanshp_$(VERSION)
70	chmod 644 gpsmanshp_$(VERSION).tgz gpsmanshp_$(VERSION).zip
71#	scp -p gpsmanshp-www/GPSManSHP*.html gpsmanshp_$(VERSION).tgz gpsmanshp_$(VERSION).zip gpsmanshp@ssh:public_html
72	mv gpsmanshp_$(VERSION).tgz gpsmanshp_$(VERSION).zip distrib
73
74