1#   Makefile for  gpsmanshp.c   Tcl version 8.3
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) 2002-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
25TCLVERSION = 8.3
26
27INSTALLDIR = /usr/lib/tcl$(TCLVERSION)
28
29CFLAGS = -Wall -fPIC -c -I/usr/include/tcl$(TCLVERSION)
30LINKOPT = -lshp -ltcl$(TCLVERSION)
31
32gpsmanshp.so: gpsmanshp.o
33	$(CC) -shared -o gpsmanshp.so $(LINKOPT) gpsmanshp.o
34
35gpsmanshp.o: gpsmanshp.c
36	$(CC) $(CFLAGS) gpsmanshp.c
37
38pkgIndex.tcl: gpsmanshp.so
39	echo "pkg_mkIndex -lazy -verbose . gpsmanshp.so" | tclsh$(TCLVERSION)
40	chmod 644 gpsmanshp.so pkgIndex.tcl
41
42install: pkgIndex.tcl
43	-mkdir $(INSTALLDIR)
44	cp gpsmanshp.so pkgIndex.tcl $(INSTALLDIR)
45
46clean:
47	rm -f gpsmanshp.o gpsmanshp.so pkgIndex.tcl
48