2008-10-19 14:52:29 +00:00
|
|
|
# **********************************************************************
|
|
|
|
# * $Id: Makefile.in
|
|
|
|
# *
|
|
|
|
# * PostGIS - Spatial Types for PostgreSQL
|
|
|
|
# * http://postgis.refractions.net
|
|
|
|
# * Copyright 2008 Mark Cave-Ayland
|
|
|
|
# *
|
|
|
|
# * This is free software; you can redistribute and/or modify it under
|
|
|
|
# * the terms of the GNU General Public Licence. See the COPYING file.
|
|
|
|
# *
|
|
|
|
# **********************************************************************
|
|
|
|
|
|
|
|
CC=@CC@
|
|
|
|
CFLAGS=@CFLAGS@ @PICFLAGS@ @WARNFLAGS@
|
|
|
|
|
|
|
|
# Filenames with extension as determined by the OS
|
|
|
|
PGSQL2SHP=pgsql2shp@EXESUFFIX@
|
|
|
|
SHP2PGSQL=shp2pgsql@EXESUFFIX@
|
|
|
|
|
|
|
|
# Common shapefile library files
|
|
|
|
OBJS= shpopen.o \
|
|
|
|
dbfopen.o \
|
|
|
|
getopt.o
|
|
|
|
|
|
|
|
# PostgreSQL frontend CPPFLAGS and LDFLAGS (for compiling and linking with libpq)
|
|
|
|
PGSQL_FE_CPPFLAGS=@PGSQL_FE_CPPFLAGS@
|
|
|
|
PGSQL_FE_LDFLAGS=@PGSQL_FE_LDFLAGS@
|
|
|
|
|
|
|
|
# PostgreSQL executable directory
|
|
|
|
PGSQL_BINDIR=@PGSQL_BINDIR@
|
|
|
|
|
2008-11-03 16:23:45 +00:00
|
|
|
# iconv flags
|
|
|
|
ICONV_LDFLAGS=@ICONV_LDFLAGS@
|
|
|
|
|
2008-10-19 14:52:29 +00:00
|
|
|
|
|
|
|
all: $(SHP2PGSQL) $(PGSQL2SHP)
|
|
|
|
|
2008-11-04 09:57:03 +00:00
|
|
|
# liblwgeom.a dependency to allow "make install" in the loader/ subdirectory to work
|
|
|
|
../liblwgeom/liblwgeom.a:
|
|
|
|
make -C ../liblwgeom
|
|
|
|
|
2008-10-19 14:52:29 +00:00
|
|
|
pgsql2shp.o: pgsql2shp.c
|
|
|
|
$(CC) $(CFLAGS) $(PGSQL_FE_CPPFLAGS) -c $<
|
|
|
|
|
2008-11-04 09:57:03 +00:00
|
|
|
$(PGSQL2SHP): ../liblwgeom/liblwgeom.a $(OBJS) pgsql2shp.o
|
2008-11-03 16:17:57 +00:00
|
|
|
$(CC) $(CFLAGS) $(OBJS) pgsql2shp.o $(ICONV_LDFLAGS) $(PGSQL_FE_LDFLAGS) ../liblwgeom/liblwgeom.a -lm -o $@
|
2008-10-19 14:52:29 +00:00
|
|
|
|
2008-11-04 09:57:03 +00:00
|
|
|
$(SHP2PGSQL): ../liblwgeom/liblwgeom.a $(OBJS) shp2pgsql.o
|
2008-10-30 17:10:44 +00:00
|
|
|
$(CC) $(CFLAGS) $(OBJS) shp2pgsql.o $(ICONV_LDFLAGS) ../liblwgeom/liblwgeom.a -lm -o $@
|
2008-10-19 14:52:29 +00:00
|
|
|
|
|
|
|
install: all
|
|
|
|
cp $(PGSQL2SHP) $(PGSQL_BINDIR)/$(PGSQL2SHP)
|
|
|
|
cp $(SHP2PGSQL) $(PGSQL_BINDIR)/$(SHP2PGSQL)
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(PGSQL_BINDIR)/$(PGSQL2SHP)
|
|
|
|
rm -f $(PGSQL_BINDIR)/$(SHP2PGSQL)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJS) shp2pgsql.o pgsql2shp.o $(SHP2PGSQL) $(PGSQL2SHP)
|
|
|
|
|