Makefile revision 0
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# This code is free software; you can redistribute it and/or modify it
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# under the terms of the GNU General Public License version 2 only, as
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# published by the Free Software Foundation. Sun designates this
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# particular file as subject to the "Classpath" exception as provided
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# by Sun in the LICENSE file that accompanied this code.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# This code is distributed in the hope that it will be useful, but WITHOUT
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# version 2 for more details (a copy is included in the LICENSE file that
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# accompanied this code).
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# You should have received a copy of the GNU General Public License version
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# 2 along with this work; if not, write to the Free Software Foundation,
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# CA 95054 USA or visit www.sun.com if you need additional information or
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# have any questions.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# Makefile for JDBC-ODBC Bridge Driver
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# Note - the native library for the bridge may be linked with the
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# shared library for the ODBC driver manager. Or dummy libraries
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# may be used to just create libJdbcOdbc.so with a dependency on
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# Use fake libraries on Solaris and Linux just so the library we create has
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# a dependency on these two library names. (which are not part of the jdk)
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk # In jdk5 and jdk6, and on Solaris 32bit, we would have required that
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk # these two libraries exist at: $(ALT_ODBCDIR)/ISLIodbc/2.11/lib
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk # In jdk7, we just fake them out like we did on Linux in jdk5 and jdk6.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk # If you wanted to use the real odbc libraries, change the value of
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk # ODBC_LIBRARY_LOCATION, and delete the variable assignments below.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk # Tell linker to ignore missing externals when building this shared library.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk # Define a place to create the fake libraries and their names.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk ODBC_FAKE_LIBRARIES = $(ODBC_LIBRARY_LOCATION)/libodbcinst.so $(ODBC_LIBRARY_LOCATION)/libodbc.so
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk # Make sure they get created early.
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk # Files built here do not compile with warning level 3 if warnings are fatal
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# The UNIX define specifies conditional compilation for UNIX
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk LDFLAGS += -L$(ODBC_LIBRARY_LOCATION) -lodbcinst -lodbc
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# The native code for the bridge uses conditional compilation to
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# support Solaris, Win95 and Mac PPC. This is the path to the shared C files
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# (which unfortunately are in the same directory as shared Java files).
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenkvpath %.c $(CLOSED_SHARE_SRC)/classes/sun/jdbc/odbc
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# Rules to generate fake libraries
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk $(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$@ $(CFLAGS_GPROF) $<
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk $(CC) $(SHARED_LIBRARY_FLAG) $(LDFLAGS_COMMON) -o $@ $< $(EXTRA_LIBS)
4b8d88eb610aa1e0bb6ec632f792744b3d6b5f22jeff.schenk# Files that need to be copied