#
# PostGIS Loader Makefile
#
+SHELL = /bin/sh
+
subdir = contrib/postgis/loader
+EXE =
+
+ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
+ EXE = .exe
+endif
# Root of the pgsql source tree
ifeq (${PGSQL_SRC},)
override CPPFLAGS := -g -I$(srcdir) -I$(top_builddir)/src/interfaces/libpq $(CPPFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"'
-all: shp2pgsql pgsql2shp
+all: shp2pgsql$(EXE) pgsql2shp$(EXE)
-pgsql2shp: $(OBJS) pgsql2shp.o
+pgsql2shp$(EXE): $(OBJS) pgsql2shp.o
$(CC) $(CFLAGS) $(OBJS) pgsql2shp.o $(libpq) $(LDFLAGS) $(LIBS) -o $@
-shp2pgsql: $(OBJS) shp2pgsql.o
+shp2pgsql$(EXE): $(OBJS) shp2pgsql.o
$(CC) $(CFLAGS) $(OBJS) shp2pgsql.o $(libpq) $(LDFLAGS) $(LIBS) -o $@
install: all
- $(INSTALL_PROGRAM) pgsql2shp $(bindir)
- $(INSTALL_PROGRAM) shp2pgsql $(bindir)
+ $(INSTALL_PROGRAM) pgsql2shp$(EXE) $(bindir)/pgsql2shp$(EXE)
+ $(INSTALL_PROGRAM) shp2pgsql$(EXE) $(bindir)/shp2pgsql$(EXE)
clean:
- @rm -f $(OBJS) shp2pgsql.o pgsql2shp.o shp2pgsql pgsql2shp
+ @rm -f $(OBJS) shp2pgsql.o pgsql2shp.o shp2pgsql$(EXE) pgsql2shp$(EXE)