2010-08-11 09:50:38 +00:00
|
|
|
# **********************************************************************
|
|
|
|
# * $Id: Makefile.in
|
|
|
|
# *
|
|
|
|
# * PostGIS - Spatial Types for PostgreSQL
|
2014-01-29 17:49:35 +00:00
|
|
|
# * http://postgis.net
|
2010-08-11 09:50:38 +00:00
|
|
|
# * Copyright 2008 Paul Ramsey, 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@
|
2013-05-12 02:27:58 +00:00
|
|
|
CFLAGS=@CFLAGS@ @WARNFLAGS@
|
2010-08-11 09:50:38 +00:00
|
|
|
|
|
|
|
CUNIT_LDFLAGS=@CUNIT_LDFLAGS@
|
|
|
|
CUNIT_CPPFLAGS=@CUNIT_CPPFLAGS@ -I..
|
|
|
|
|
|
|
|
# GTK includes and libraries
|
|
|
|
GTK_CFLAGS = @GTK_CFLAGS@ @IGE_MAC_CFLAGS@
|
|
|
|
GTK_LIBS = @GTK_LIBS@ @IGE_MAC_LIBS@
|
|
|
|
GTK_WIN32_FLAGS = @GTK_WIN32_FLAGS@
|
|
|
|
|
2011-04-03 19:19:30 +00:00
|
|
|
# PostgreSQL frontend CPPFLAGS and LDFLAGS (for compiling and linking with libpq)
|
|
|
|
PGSQL_FE_CPPFLAGS=@PGSQL_FE_CPPFLAGS@
|
|
|
|
PGSQL_FE_LDFLAGS=@PGSQL_FE_LDFLAGS@
|
|
|
|
|
|
|
|
# liblwgeom
|
2011-08-13 10:06:07 +00:00
|
|
|
LIBLWGEOM=../../liblwgeom/.libs/liblwgeom.a
|
2011-04-03 19:19:30 +00:00
|
|
|
|
2011-06-14 08:20:16 +00:00
|
|
|
# iconv flags
|
|
|
|
ICONV_LDFLAGS=@ICONV_LDFLAGS@
|
|
|
|
ICONV_CFLAGS=@ICONV_CFLAGS@
|
|
|
|
|
2011-06-13 20:20:56 +00:00
|
|
|
# GetText includes and libraries
|
|
|
|
GETTEXT_CFLAGS = @GETTEXT_CFLAGS@
|
|
|
|
GETTEXT_LDFLAGS = @GETTEXT_LDFLAGS@ @LIBINTL@
|
|
|
|
|
2013-03-29 20:37:55 +00:00
|
|
|
# Built out CFLAGS with ICONV and GETTEXT
|
|
|
|
CFLAGS += $(GETTEXT_CFLAGS) $(ICONV_CFLAGS)
|
|
|
|
|
2011-06-13 20:20:56 +00:00
|
|
|
# Build full linking line
|
2013-05-06 07:58:11 +00:00
|
|
|
LDFLAGS = -lm $(GEOS_LDFLAGS) $(GETTEXT_LDFLAGS) $(PGSQL_FE_LDFLAGS) $(ICONV_LDFLAGS) $(CUNIT_LDFLAGS)
|
2011-06-13 20:20:56 +00:00
|
|
|
|
2011-07-02 12:34:16 +00:00
|
|
|
# Object files
|
2010-08-11 09:50:38 +00:00
|
|
|
OBJS= \
|
2011-04-03 19:19:30 +00:00
|
|
|
cu_pgsql2shp.o \
|
2011-07-02 13:43:35 +00:00
|
|
|
cu_shp2pgsql.o \
|
2010-08-11 09:50:38 +00:00
|
|
|
cu_tester.o
|
|
|
|
|
|
|
|
LOADER_OBJS= \
|
2011-04-03 19:19:30 +00:00
|
|
|
../dbfopen.o \
|
|
|
|
../shpopen.o \
|
|
|
|
../getopt.o \
|
|
|
|
../shpcommon.o \
|
|
|
|
../safileio.o \
|
2011-07-02 13:43:35 +00:00
|
|
|
../pgsql2shp-core.o \
|
|
|
|
../shp2pgsql-core.o
|
2010-08-11 09:50:38 +00:00
|
|
|
|
|
|
|
# If we couldn't find the cunit library then display a helpful message
|
|
|
|
ifeq ($(CUNIT_LDFLAGS),)
|
|
|
|
all: requirements_not_met_cunit
|
|
|
|
check: requirements_not_met_cunit
|
|
|
|
else
|
|
|
|
|
|
|
|
$(LOADER_OBJS):
|
|
|
|
make -C ..
|
|
|
|
|
|
|
|
# Build the unit tester
|
|
|
|
all: cu_tester
|
|
|
|
|
|
|
|
# Build and run the unit tester
|
|
|
|
check: cu_tester
|
|
|
|
@./cu_tester
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Build the main unit test executable
|
|
|
|
cu_tester: $(LOADER_OBJS) $(OBJS)
|
2011-06-13 20:20:56 +00:00
|
|
|
$(CC) $^ -o $@ $(LIBLWGEOM) $(LDFLAGS)
|
2010-08-11 09:50:38 +00:00
|
|
|
|
|
|
|
# Command to build each of the .o files
|
|
|
|
$(OBJS): %.o: %.c
|
2011-04-03 19:19:30 +00:00
|
|
|
$(CC) $(CFLAGS) $(CUNIT_CPPFLAGS) $(GTK_CFLAGS) $(PGSQL_FE_CPPFLAGS) -c -o $@ $<
|
2010-08-11 09:50:38 +00:00
|
|
|
|
|
|
|
# Clean target
|
|
|
|
clean:
|
2012-03-21 21:36:59 +00:00
|
|
|
rm -f $(OBJS)
|
|
|
|
rm -f cu_tester.exe
|
2010-08-11 09:50:38 +00:00
|
|
|
|
2012-03-21 20:32:29 +00:00
|
|
|
distclean: clean
|
2012-03-21 21:36:59 +00:00
|
|
|
rm -f Makefile
|
2012-03-21 20:32:29 +00:00
|
|
|
|
2010-08-11 09:50:38 +00:00
|
|
|
# Requirements message
|
|
|
|
requirements_not_met_cunit:
|
|
|
|
@echo
|
|
|
|
@echo "WARNING:"
|
|
|
|
@echo
|
|
|
|
@echo "configure was unable to find CUnit which is required for unit testing."
|
|
|
|
@echo "In order to enable unit testing, you must install CUnit and then re-run configure."
|
|
|
|
@echo
|