mirror of
https://github.com/postgres/postgres.git
synced 2026-06-09 08:42:38 -04:00
Use @top-srcdir@ to find the right Makefile.global and use ODBCSRCDIR to point to this local directory. Move non-platform-specific stuff to outside the if clauses. Still need to move all platform-specific stuff to the templates.
124 lines
3.6 KiB
Makefile
124 lines
3.6 KiB
Makefile
#-------------------------------------------------------------------------
|
|
#
|
|
# Makefile.inc--
|
|
# Build and install postgres.
|
|
#
|
|
# Copyright (c) 1994, Regents of the University of California
|
|
#
|
|
#
|
|
# IDENTIFICATION
|
|
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.2 1998/10/07 06:49:19 thomas Exp $
|
|
#
|
|
#-------------------------------------------------------------------------
|
|
@SET_MAKE@
|
|
|
|
NAME = psqlodbc
|
|
SRCDIR=@top_srcdir@
|
|
ODBCSRCDIR=@srcdir@
|
|
include $(SRCDIR)/Makefile.global
|
|
|
|
include Version.mk
|
|
PORTNAME= @PORTNAME@
|
|
|
|
FIND = @find@
|
|
|
|
# assuming gnu tar and split here
|
|
TAR = @tar@
|
|
SPLIT = @split@
|
|
|
|
install-shlib-dep := install-shlib
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
|
|
|
ifeq ($(PORTNAME), linux)
|
|
LDFLAGS_SL = -shared -soname lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
|
LDFLAGS_SL += -Bsymbolic $(LDFLAGS) -lc -lm
|
|
endif
|
|
|
|
ifeq ($(PORTNAME), bsd)
|
|
ifdef BSD_SHLIB
|
|
LDFLAGS_SL = -x -Bshareable -Bforcearchive $(LDFLAGS)
|
|
endif
|
|
endif
|
|
|
|
SOURCES = *.c *.h *.in Config.mk Makefile Makefile.unx README.Linux \
|
|
TODO.txt Version.mk config.guess config.sub configure \
|
|
install-sh license.txt notice.txt odbcinst.ini patch \
|
|
psqlodbc.aps psqlodbc.def psqlodbc.mak psqlodbc.mdp \
|
|
psqlodbc.ncb psqlodbc.rc readme.txt
|
|
|
|
OBJECTS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
|
|
environ.o execute.o lobj.o misc.o options.o \
|
|
pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o statement.o \
|
|
gpps.o tuple.o tuplelist.o dlg_specific.o $(OBJX)
|
|
|
|
CFLAGS += -I. @DEFS@
|
|
|
|
all: libpsqlodbc.a $(shlib)
|
|
|
|
libpsqlodbc.a: $(OBJECTS)
|
|
$(AR) $(AROPT) libpsqlodbc.a $(OBJS)
|
|
$(RANLIB) libpsqlodbc.a
|
|
|
|
$(shlib): $(OBJECTS)
|
|
$(LD) $(LDFLAGS_SL) $(OBJECTS) \
|
|
-o $(shlib) $(LIBS)
|
|
|
|
.PHONY: beforeinstall-headers
|
|
|
|
.PHONY: install
|
|
|
|
install: $(HEADERDIR) $(LIBDIR) $(ODBCINST) install-headers \
|
|
install-libpsqlodbc install-ini $(install-shlib-dep)
|
|
|
|
$(HEADERDIR) $(LIBDIR) $(ODBCINST):
|
|
mkdir -p $@
|
|
|
|
install-headers: beforeinstall-headers isql.h isqlext.h iodbc.h
|
|
$(INSTALL) $(INSTLOPTS) iodbc.h $(HEADERDIR)/iodbc/iodbc.h
|
|
$(INSTALL) $(INSTLOPTS) isql.h $(HEADERDIR)/iodbc/isql.h
|
|
$(INSTALL) $(INSTLOPTS) isqlext.h $(HEADERDIR)/iodbc/isqlext.h
|
|
|
|
beforeinstall-headers:
|
|
@if [ ! -d $(HEADERDIR)/iodbc ]; then mkdir -p $(HEADERDIR)/iodbc; fi
|
|
|
|
install-libpsqlodbc: libpsqlodbc.a
|
|
$(INSTALL) $(INSTL_LIB_OPTS) libpsqlodbc.a $(DESTDIR)$(LIBDIR)/lib$(NAME).a
|
|
|
|
install-shlib: $(shlib)
|
|
$(INSTALL) $(INSTL_LIB_OPTS) $(shlib) $(DESTDIR)$(LIBDIR)/$(shlib)
|
|
rm -f $(DESTDIR)$(LIBDIR)/lib$(NAME)$(DLSUFFIX)
|
|
rm -f $(DESTDIR)$(LIBDIR)/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
|
cd $(DESTDIR)$(LIBDIR) && $(LN_S) -f $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
|
cd $(DESTDIR)$(LIBDIR) && $(LN_S) -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) lib$(NAME)$(DLSUFFIX)
|
|
|
|
install-ini: odbcinst.ini
|
|
$(INSTALL) $(INSTL_LIB_OPTS) odbcinst.ini $(ODBCINST)/odbcinst.ini
|
|
|
|
depend dep:
|
|
$(CC) -MM *.c >depend
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
-rm -f lib$(NAME).a $(shlib) $(OBJECTS) lib$(NAME)$(DLSUFFIX)
|
|
-rm -f config.log config.cache config.status
|
|
|
|
.PHONY: distclean
|
|
|
|
distclean: clean
|
|
-rm -f config.h GNUmakefile Makefile.global
|
|
|
|
.PHONY: standalone
|
|
|
|
standalone:
|
|
-rm -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar.gz
|
|
tar -cf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar $(SOURCES)
|
|
tar -r -C ../.. -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar template
|
|
gzip psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar
|
|
|
|
.PHONY: integrated
|
|
|
|
integrated:
|
|
-rm -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar.gz
|
|
tar -cf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar $(SOURCES)
|
|
gzip psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar
|