1 #*************************************************************************
3 # $RCSfile: makefile.mk,v $
5 # $Revision: 1.1.2.14 $
7 # last change: $Author: jbu $ $Date: 2008/07/07 21:37:11 $
9 # The Contents of this file are made available subject to the terms of
10 # either of the following licenses
12 # - GNU Lesser General Public License Version 2.1
13 # - Sun Industry Standards Source License Version 1.1
15 # Sun Microsystems Inc., October, 2000
17 # GNU Lesser General Public License Version 2.1
18 # =============================================
19 # Copyright 2000 by Sun Microsystems, Inc.
20 # 901 San Antonio Road, Palo Alto, CA 94303, USA
22 # This library is free software; you can redistribute it and/or
23 # modify it under the terms of the GNU Lesser General Public
24 # License version 2.1, as published by the Free Software Foundation.
26 # This library is distributed in the hope that it will be useful,
27 # but WITHOUT ANY WARRANTY; without even the implied warranty of
28 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29 # Lesser General Public License for more details.
31 # You should have received a copy of the GNU Lesser General Public
32 # License along with this library; if not, write to the Free Software
33 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
37 # Sun Industry Standards Source License Version 1.1
38 # =================================================
39 # The contents of this file are subject to the Sun Industry Standards
40 # Source License Version 1.1 (the "License"); You may not use this file
41 # except in compliance with the License. You may obtain a copy of the
42 # License at http://www.openoffice.org/license.html.
44 # Software provided under this License is provided on an "AS IS" basis,
45 # WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
46 # WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
47 # MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
48 # See the License for the specific provisions governing your rights and
49 # obligations concerning the Software.
51 # The Initial Developer of the Original Code is: Sun Microsystems, Inc.
53 # Copyright: 2000 by Sun Microsystems, Inc.
55 # All Rights Reserved.
57 # Contributor(s): _______________________________________
61 #*************************************************************************
66 ENABLE_EXCEPTIONS
=TRUE
71 # --- Settings -----------------------------------------------------
73 .INCLUDE
: settings.mk
74 .IF
"$(SYSTEM_POSTGRESQL)" != "YES"
75 .INCLUDE
: $(SOLARINCDIR
)$/postgresql
/postgresql-version.mk
77 #-------------------------------------------------------------------
79 # uno component naming scheme
85 .IF
"$(SYSTEM_POSTGRESQL)" == "YES"
86 POSTGRESQL_MAJOR
=`pg_config --version | awk '{ print $$2 }' | cut -d. -f1`
87 POSTGRESQL_MINOR
=`pg_config --version | awk '{ print $$2 }' | cut -d. -f2`
88 POSTGRESQL_MICRO
=`pg_config --version | awk '{ print $$2 }' | cut -d. -f3`
91 .IF
"$(SYSTEM_POSTGRESQL)" != "YES"
92 POSTGRESQL_INCLUDES
=-I
$(SOLARINCDIR
)$/postgresql
94 POSTGRESQL_INCLUDES
=-I
`pg_config --includedir`
97 CFLAGS
+=$(POSTGRESQL_INCLUDES
) \
98 -DPOSTGRESQL_MAJOR
=$(POSTGRESQL_MAJOR
) \
99 -DPOSTGRESQL_MINOR
=$(POSTGRESQL_MINOR
) \
100 -DPOSTGRESQL_MICRO
=$(POSTGRESQL_MICRO
) \
101 -DPQ_SDBC_MAJOR
=$(PQ_SDBC_MAJOR
) \
102 -DPQ_SDBC_MINOR
=$(PQ_SDBC_MINOR
) \
103 -DPQ_SDBC_MICRO
=$(PQ_SDBC_MICRO
)
105 SHL1TARGET
=postgresql-sdbc.uno
106 LIB1TARGET
=$(SLB
)$/$(SHL1TARGET
).lib
108 $(SLO
)$/pq_driver.obj
115 SHL1LIBS
= $(LIB1TARGET
)
116 SHL1DEF
= $(MISC
)$/$(SHL1TARGET
).def
117 DEF1NAME
= $(SHL1TARGET
)
118 SHL1VERSIONMAP
=$(SOLARENV
)$/src
$/component.map
120 # use the static version
122 PQLIB
=libpq.lib wsock32.lib advapi32.lib
126 SHL2TARGET
=postgresql-sdbc-impl.uno
127 LIB2TARGET
=$(SLB
)$/$(SHL2TARGET
).lib
129 $(SLO
)$/pq_connection.obj \
130 $(SLO
)$/pq_statement.obj \
131 $(SLO
)$/pq_resultset.obj \
132 $(SLO
)$/pq_preparedstatement.obj \
133 $(SLO
)$/pq_resultsetmetadata.obj \
134 $(SLO
)$/pq_databasemetadata.obj \
135 $(SLO
)$/pq_sequenceresultset.obj \
136 $(SLO
)$/pq_baseresultset.obj \
137 $(SLO
)$/pq_statics.obj \
138 $(SLO
)$/pq_xtable.obj \
139 $(SLO
)$/pq_xcontainer.obj \
140 $(SLO
)$/pq_xbase.obj \
141 $(SLO
)$/pq_xtables.obj \
142 $(SLO
)$/pq_xcolumns.obj \
143 $(SLO
)$/pq_xcolumn.obj \
144 $(SLO
)$/pq_tools.obj \
145 $(SLO
)$/pq_xkey.obj \
146 $(SLO
)$/pq_xkeys.obj \
147 $(SLO
)$/pq_xkeycolumn.obj \
148 $(SLO
)$/pq_xkeycolumns.obj \
149 $(SLO
)$/pq_xuser.obj \
150 $(SLO
)$/pq_xusers.obj \
151 $(SLO
)$/pq_xview.obj \
152 $(SLO
)$/pq_xviews.obj \
153 $(SLO
)$/pq_xindex.obj \
154 $(SLO
)$/pq_xindexes.obj \
155 $(SLO
)$/pq_xindexcolumn.obj \
156 $(SLO
)$/pq_xindexcolumns.obj \
157 $(SLO
)$/pq_updateableresultset.obj \
158 $(SLO
)$/pq_fakedupdateableresultset.obj \
159 $(SLO
)$/pq_array.obj \
160 $(SLO
)$/pq_sequenceresultsetmetadata.obj
170 SHL2LIBS
= $(LIB2TARGET
)
171 SHL2DEF
= $(MISC
)$/$(SHL2TARGET
).def
172 DEF2NAME
= $(SHL2TARGET
)
173 SHL2VERSIONMAP
=$(SOLARENV
)$/src
$/component.map
176 SLOFILES
= $(LIB1OBJFILES
) $(LIB2OBJFILES
)
179 DRIVERNAME
=postgresql-sdbc-
$(PQ_SDBC_MAJOR
).
$(PQ_SDBC_MINOR
).
$(PQ_SDBC_MICRO
).zip
180 ALLTAR
: $(DLLDEST
)$/$(DRIVERNAME
)
182 # --- Targets ------------------------------------------------------
185 .IF
"$(GUI)" == "UNX"
191 $(DLLDEST
)$/$(SHL1TARGET
)$(INI_EXT
): $(SHL1TARGET
)
195 $(DLLDEST
)$/$(DRIVERNAME
): \
196 $(DLLDEST
)$/DataAccess.xcu \
197 $(DLLDEST
)$/$(SHL1TARGET
)$(DLLPOST
) \
198 $(DLLDEST
)$/$(SHL2TARGET
)$(DLLPOST
) \
199 $(DLLDEST
)$/$(SHL1TARGET
)$(INI_EXT
)
201 zip
-r
$(DRIVERNAME
) \
202 $(SHL1TARGET
)$(DLLPOST
) \
203 $(SHL2TARGET
)$(DLLPOST
) \
204 $(SHL1TARGET
)$(INI_EXT
) \
207 $(DLLDEST
)$/DataAccess.xcu
: DataAccess.xcu
209 cat DataAccess.xcu | \
210 sed s
/PQ_SDBC_MAJOR
/$(PQ_SDBC_MAJOR
)/ | \
211 sed s
/PQ_SDBC_MINOR
/$(PQ_SDBC_MINOR
)/ | \
212 sed s
/PQ_SDBC_MICRO
/$(PQ_SDBC_MICRO
)/ > $@
217 strip $(DLLDEST
)$/$(SHL1TARGET
)$(DLLPOST
) $(DLLDEST
)$/$(SHL2TARGET
)$(DLLPOST
)