root/branches/1.4/loader/Makefile.in

Revision 5960, 2.9 KB (checked in by pramsey, 21 months ago)

Fix for #554, align internal shapelib with official shapelib

Line 
1# **********************************************************************
2# * $Id: Makefile.in
3# *
4# * PostGIS - Spatial Types for PostgreSQL
5# * http://postgis.refractions.net
6# * Copyright 2008 Mark Cave-Ayland
7# *
8# * This is free software; you can redistribute and/or modify it under
9# * the terms of the GNU General Public Licence. See the COPYING file.
10# *
11# **********************************************************************
12
13# PGXS information
14#
15# Note that PGXS currently doesn't handle building FE executables, but we need
16# the INSTALL and DESTDIR variables so we can get the correct install paths.
17# Hence we include the PGXS Makefile here, but ensure that we override the
18# 'all' and 'install' targets with the ones we really want to use below.
19PG_CONFIG = @PGCONFIG@
20PGXS := @PGXS@
21include $(PGXS)
22
23# Set CFLAGS afer PGXS, otherwise it will get overwritten with the PGXS
24# version which is not what we want.
25CC=@CC@
26CFLAGS=@ICONV_CFLAGS@ @CFLAGS@ @PICFLAGS@ @WARNFLAGS@
27
28# Filenames with extension as determined by the OS
29PGSQL2SHP=pgsql2shp@EXESUFFIX@
30SHP2PGSQL=shp2pgsql@EXESUFFIX@
31SHP2PGSQL-GUI=shp2pgsql-gui@EXESUFFIX@
32SHP2PGSQL-CLI=shp2pgsql-cli@EXESUFFIX@
33
34# PostgreSQL frontend CPPFLAGS and LDFLAGS (for compiling and linking with libpq)
35PGSQL_FE_CPPFLAGS=@PGSQL_FE_CPPFLAGS@
36PGSQL_FE_LDFLAGS=@PGSQL_FE_LDFLAGS@
37
38# iconv flags
39ICONV_LDFLAGS=@ICONV_LDFLAGS@
40
41# liblwgeom
42LIBLWGEOM=../liblwgeom/liblwgeom.a
43
44# GTK includes and libraries
45GTK_CFLAGS = @GTK_CFLAGS@
46GTK_LIBS = @GTK_LIBS@
47
48
49# The real parts of the Makefile
50all: $(SHP2PGSQL) $(PGSQL2SHP) @GTK_BUILD@
51
52gui: $(SHP2PGSQL-GUI) $(SHP2PGSQL-CLI)
53
54# liblwgeom.a dependency to allow "make install" in
55# the loader/ subdirectory to work 
56$(LIBLWGEOM):
57        make -C ../liblwgeom
58
59pgsql2shp.o: pgsql2shp.c
60        $(CC) $(CFLAGS) $(PGSQL_FE_CPPFLAGS) -c $<
61
62$(PGSQL2SHP): shpopen.o dbfopen.o getopt.o pgsql2shp.o safileio.c $(LIBLWGEOM)
63        $(CC) $(CFLAGS) $^ $(ICONV_LDFLAGS) $(PGSQL_FE_LDFLAGS) -lm -o $@
64
65$(SHP2PGSQL): shpopen.o dbfopen.o safileio.c getopt.o  shp2pgsql.o $(LIBLWGEOM)
66        $(CC) $(CFLAGS) $^ $(ICONV_LDFLAGS) -lm -o $@
67
68shp2pgsql-core-gui.o: shp2pgsql-core.c
69        $(CC) $(CFLAGS) $(ICONV_CFLAGS) -DPGUI -c -o $@ $^
70
71shp2pgsql-gui.o: shp2pgsql-gui.c
72        $(CC) $(PGSQL_FE_CPPFLAGS) $(CFLAGS) $(GTK_CFLAGS) -o $@ -c shp2pgsql-gui.c
73
74$(SHP2PGSQL-GUI): stringbuffer.o shpopen.o dbfopen.o safileio.c shp2pgsql-core-gui.o shp2pgsql-gui.o $(LIBLWGEOM)
75        $(CC) $(CFLAGS) $^ -o $@ $(GTK_LIBS) $(ICONV_LDFLAGS) $(PGSQL_FE_LDFLAGS) -lm
76
77$(SHP2PGSQL-CLI): stringbuffer.o shpopen.o dbfopen.o safileio.c getopt.o shp2pgsql-core.o shp2pgsql-cli.o $(LIBLWGEOM)
78        $(CC) $(CFLAGS) $^ -o $@ $(ICONV_LDFLAGS) -lm
79
80install: all
81        @mkdir -p $(DESTDIR)$(bindir)
82        $(INSTALL) $(PGSQL2SHP) $(DESTDIR)$(bindir)
83        $(INSTALL) $(SHP2PGSQL) $(DESTDIR)$(bindir)
84
85uninstall:
86        @rm -f $(DESTDIR)$(bindir)/$(PGSQL2SHP)
87        @rm -f $(DESTDIR)$(bindir)/$(SHP2PGSQL)
88
89clean:
90        @rm -f *.o $(SHP2PGSQL) $(PGSQL2SHP)
Note: See TracBrowser for help on using the browser.