GNUmakefile.in 3.17 KB
Newer Older
1 2
#-------------------------------------------------------------------------
#
3 4
# GNUMakefile.in--
#    Build and install psqlodbc (Postgres ODBC driver).
5 6 7 8 9
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
10
#    $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.13 2000/06/06 22:01:09 petere Exp $
11 12 13 14 15
#
#-------------------------------------------------------------------------
@SET_MAKE@

NAME = psqlodbc
16
SRCDIR= ../..
17
ODBCSRCDIR= @srcdir@
18
include $(SRCDIR)/Makefile.global
19 20 21

include Version.mk

22
FIND= @find@
23
# assuming gnu tar and split here
24 25
TAR= @tar@
SPLIT= @split@
26

27
CFLAGS += -I. @DEFS@
28

29
SOURCES = *.c *.h *.in Config.mk \
30
	TODO.txt Version.mk config.guess config.sub configure \
31 32 33
	install-sh license.txt notice.txt odbcinst.ini \
	psqlodbc.def \
	psqlodbc.rc readme.txt
34

35
OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
36 37 38 39
        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)

40
SHLIB_LINK= $(LD_FLAGS)
41

42 43
# Shared library stuff, also default 'all' target
include $(SRCDIR)/Makefile.shlib
44

45
LDFLAGS_SL+= $(LDFLAGS_ODBC)
46

47
.PHONY: install install-ini beforeinstall-headers install-headers
48 49

install: $(HEADERDIR) $(LIBDIR) $(ODBCINST) install-headers \
50
	install-ini install-lib $(install-shlib-dep)
51 52 53 54 55 56 57 58 59 60 61 62 63

$(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-ini: odbcinst.ini
64
	$(INSTALL) $(INSTL_LIB_OPTS) odbcinst.ini $(ODBCINST)/odbcinst.ini
65 66 67

.PHONY: clean

68 69
clean: clean-shlib
	-rm -f lib$(NAME).a $(OBJS)
70

71 72 73 74
.PHONY: distclean

distclean: clean
	-rm -f config.h GNUmakefile Makefile.global
75
	-rm -f config.cache config.log config.status
76 77 78
ifeq ($(PORTNAME), win)
	@if [ $SRCDIR != $ODBCSRCDIR ]; then rm -f template makefiles port; fi
else
79
	@if [ $SRCDIR ne $ODBCSRCDIR ]; then rm -f template makefiles port; fi
80
endif
81 82 83 84

.PHONY: standalone

standalone:
85 86 87 88 89 90 91
	@if test "$SRCDIR" = "$ODBCSRCDIR"; then \
		echo "****************************************************"; \
		echo "Note: This was a standalone installation already"; \
		echo "This may produce a slightly inconsistant tar file..."; \
		echo "You should use the original tar file instead"; \
		echo "****************************************************"; \
	fi
92
	-rm -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar.gz
93
	$(TAR) -chf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar \
94
	    $(SOURCES) -C $(SRCDIR) makefiles template Makefile.shlib
95 96 97 98 99 100
	gzip psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar

.PHONY: integrated

integrated:
	-rm -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar.gz
101
	$(TAR) -cf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar $(SOURCES)
102
	gzip psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar
103 104 105 106 107 108 109

depend dep:
	$(CC) -MM $(CFLAGS) *.c >depend

ifeq (depend,$(wildcard depend))
include depend
endif