OSDN Git Service

Add User's Guide chapters on Data Definition and Data Manipulation.
[pg-rex/syncrep.git] / src / Makefile.global.in
1 # -*-makefile-*-
2 # $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.152 2002/07/27 20:10:04 petere Exp $
3
4 #------------------------------------------------------------------------------
5 # All PostgreSQL makefiles include this file and use the variables it sets,
6 # which in turn are put here by the configure script. There is no need for
7 # users to edit this file -- if it turns out to be necessary then that's a
8 # bug.
9 #
10 # A makefile that includes this file needs to set the variable `subdir' to
11 # the relative path from the top to itself and `top_builddir' to the relative
12 # path from itself to the top before including this file. (The "top" is the
13 # parent directory of the directory this file is in.)
14 #------------------------------------------------------------------------------
15
16
17 ##########################################################################
18 #
19 # Meta configuration
20
21 .PHONY: all install install-strip installdirs uninstall clean distclean maintainer-clean distprep check installcheck maintainer-check
22 .SILENT: installdirs
23
24 # make `all' the default target
25 all:
26
27 # Delete target files if the command fails after it has
28 # started to update the file.
29 .DELETE_ON_ERROR:
30
31 # PostgreSQL version number
32 VERSION = @PACKAGE_VERSION@
33
34 # Support for VPATH builds
35 vpath_build = @vpath_build@
36 abs_top_srcdir = @abs_top_srcdir@
37
38 ifneq ($(vpath_build),yes)
39 top_srcdir = $(top_builddir)
40 srcdir = .
41 else # vpath_build = yes
42 top_srcdir = $(abs_top_srcdir)
43 srcdir = $(top_srcdir)/$(subdir)
44 VPATH = $(srcdir)
45 endif
46
47 # Saved arguments from configure
48 configure_args = @configure_args@
49
50
51 ##########################################################################
52 #
53 # Installation directories
54 #
55 # These are set by the equivalent --xxxdir configure options.  We
56 # append "postgresql" to some of them, if the string does not already
57 # contain "pgsql" or "postgres", in order to avoid directory clutter.
58
59 prefix := @prefix@
60 exec_prefix := @exec_prefix@
61
62 bindir := @bindir@
63 sbindir := @sbindir@
64
65 libexecdir := @libexecdir@
66 ifeq "$(findstring pgsql, $(libexecdir))" ""
67 ifeq "$(findstring postgres, $(libexecdir))" ""
68 override libexecdir := $(libexecdir)/postgresql
69 endif
70 endif
71
72 datadir := @datadir@
73 ifeq "$(findstring pgsql, $(datadir))" ""
74 ifeq "$(findstring postgres, $(datadir))" ""
75 override datadir := $(datadir)/postgresql
76 endif
77 endif
78
79 sysconfdir := @sysconfdir@
80 ifeq "$(findstring pgsql, $(sysconfdir))" ""
81 ifeq "$(findstring postgres, $(sysconfdir))" ""
82 override sysconfdir := $(sysconfdir)/postgresql
83 endif
84 endif
85
86 libdir := @libdir@
87 pkglibdir = $(libdir)
88 ifeq "$(findstring pgsql, $(pkglibdir))" ""
89 ifeq "$(findstring postgres, $(pkglibdir))" ""
90 override pkglibdir := $(pkglibdir)/postgresql
91 endif
92 endif
93
94 includedir := @includedir@
95 pkgincludedir = $(includedir)
96 ifeq "$(findstring pgsql, $(pkgincludedir))" ""
97 ifeq "$(findstring postgres, $(pkgincludedir))" ""
98 override pkgincludedir := $(pkgincludedir)/postgresql
99 endif
100 endif
101 includedir_server = $(pkgincludedir)/server
102 includedir_internal = $(pkgincludedir)/internal
103
104 mandir := @mandir@
105 sqlmansect_dummy = l
106
107 docdir := @docdir@
108 ifeq "$(findstring pgsql, $(docdir))" ""
109 ifeq "$(findstring postgres, $(docdir))" ""
110 override docdir := $(docdir)/postgresql
111 endif
112 endif
113
114 odbcinst_ini_dir = @odbcinst_ini_dir@
115
116 javadir := $(DESTDIR)$(datadir)/java
117 localedir := @localedir@
118
119
120 ##########################################################################
121 #
122 # Features
123 #
124 # Records the choice of the various --enable-xxx and --with-xxx options.
125
126 with_CXX        = @with_CXX@
127 with_java       = @with_java@
128 with_perl       = @with_perl@
129 with_python     = @with_python@
130 with_tcl        = @with_tcl@
131 with_tk         = @with_tk@
132 enable_odbc     = @enable_odbc@
133 with_iodbc      = @with_iodbc@
134 with_unixodbc   = @with_unixodbc@
135 MULTIBYTE       = @MULTIBYTE@
136 enable_shared   = @enable_shared@
137 enable_rpath    = @enable_rpath@
138 enable_nls      = @enable_nls@
139 enable_debug    = @enable_debug@
140
141 python_version          = @python_version@
142 python_includespec      = @python_includespec@
143 python_moduledir        = @python_moduledir@
144 python_moduleexecdir    = @python_moduleexecdir@
145 python_libspec          = @python_libspec@
146 python_configdir        = @python_configdir@
147
148 krb_srvtab = @krb_srvtab@
149
150 TCLSH                   = @TCLSH@
151 TCL_LIB_FILE            = @TCL_LIB_FILE@
152 TCL_LIBS                = @TCL_LIBS@
153 TCL_LIB_SPEC            = @TCL_LIB_SPEC@
154 TCL_SHARED_BUILD        = @TCL_SHARED_BUILD@
155 TCL_SHLIB_LD_LIBS       = @TCL_SHLIB_LD_LIBS@
156
157 TK_LIBS                 = @TK_LIBS@
158 TK_LIB_SPEC             = @TK_LIB_SPEC@
159 TK_XINCLUDES            = @TK_XINCLUDES@
160
161 have_docbook    = @have_docbook@
162 DOCBOOKSTYLE    = @DOCBOOKSTYLE@
163 COLLATEINDEX    = @COLLATEINDEX@
164
165
166 ##########################################################################
167 #
168 # Programs and flags
169
170 # Compilers
171
172 CPP = @CPP@
173 CPPFLAGS = @CPPFLAGS@
174 override CPPFLAGS := -I$(top_srcdir)/src/include $(CPPFLAGS)
175 ifdef VPATH
176 override CPPFLAGS := -I$(top_builddir)/src/include $(CPPFLAGS)
177 endif
178
179 CC = @CC@
180 GCC = @GCC@
181 CFLAGS = @CFLAGS@
182 ifeq ($(GCC), yes)
183   CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations
184 endif
185
186 CXX = @CXX@
187 GXX = @GXX@
188 CXXFLAGS = @CXXFLAGS@
189 ifeq ($(GXX), yes)
190   CXXFLAGS += -Wall
191 endif
192
193 # Kind-of compilers
194
195 YACC = @YACC@
196 YFLAGS = @YFLAGS@
197 FLEX = @FLEX@
198 FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS)
199
200 # Linking
201
202 LIBS = @LIBS@
203 LD = @LD@
204 with_gnu_ld = @with_gnu_ld@
205 ld_R_works = @ld_R_works@
206 LDFLAGS = @LDFLAGS@
207 LDREL = -r
208 LDOUT = -o
209 RANLIB = @RANLIB@
210 LORDER = @LORDER@
211 X = @EXEEXT@
212
213 # Perl 
214
215 PERL                    = @PERL@
216 perl_installsitearch    = @perl_installsitearch@
217 perl_installman3dir     = @perl_installman3dir@
218 perl_archlibexp         = @perl_archlibexp@
219 perl_privlibexp         = @perl_privlibexp@
220 perl_useshrplib         = @perl_useshrplib@
221 perl_embed_ldflags      = @perl_embed_ldflags@
222 perl_man3ext            = @perl_man3ext@
223
224 # Miscellaneous
225
226 ANT     = @ANT@
227 AWK     = @AWK@
228 LN_S    = @LN_S@
229 MSGFMT  = @MSGFMT@
230 MSGMERGE = @MSGMERGE@
231 PYTHON  = @PYTHON@
232 TAR     = @TAR@
233 WISH    = @WISH@
234 XGETTEXT = @XGETTEXT@
235
236 GZIP    = gzip
237 BZIP2   = bzip2
238
239 # Installation.
240
241 INSTALL = $(SHELL) $(top_srcdir)/config/install-sh -c
242
243 INSTALL_PROGRAM = $(INSTALL_PROGRAM_ENV) $(INSTALL) $(INSTALL_STRIP_FLAG)
244 INSTALL_SCRIPT  = $(INSTALL) -m 755
245 INSTALL_DATA    = $(INSTALL) -m 644
246 INSTALL_STLIB   = $(INSTALL_STLIB_ENV) $(INSTALL_DATA) $(INSTALL_STRIP_FLAG)
247 INSTALL_SHLIB   = $(INSTALL_SHLIB_ENV) $(INSTALL) $(INSTALL_SHLIB_OPTS) $(INSTALL_STRIP_FLAG)
248 # Override in Makefile.port if necessary
249 INSTALL_SHLIB_OPTS = -m 755
250
251 mkinstalldirs   = $(SHELL) $(top_srcdir)/config/mkinstalldirs
252 missing         = $(SHELL) $(top_srcdir)/config/missing
253
254 STRIP           = @STRIP@
255 STRIP_STATIC_LIB = @STRIP_STATIC_LIB@
256 STRIP_SHARED_LIB = @STRIP_SHARED_LIB@
257
258 # Documentation
259
260 JADE    = @JADE@
261 NSGMLS  = @NSGMLS@
262 SGMLSPL = @SGMLSPL@
263
264 # Feature settings
265
266 DEF_PGPORT = @default_port@
267 WANTED_LANGUAGES = @WANTED_LANGUAGES@
268
269
270 ##########################################################################
271 #
272 # Additional platform-specific settings
273 #
274
275 # Name of the "template"
276 PORTNAME= @PORTNAME@
277
278 host_tuple = @host@
279 host_os = @host_os@
280 host_cpu = @host_cpu@
281
282 # Grungy things needed for HP-UX
283 HAVE_POSIX_SIGNALS= @HAVE_POSIX_SIGNALS@
284 HPUXMATHLIB= @HPUXMATHLIB@
285
286 # This is mainly for use on FreeBSD, where we have both a.out and elf
287 # systems now.  May be applicable to other systems to?
288 ELF_SYSTEM= @ELF_SYS@
289
290 # Pull in platform-specific magic
291 include $(top_builddir)/src/Makefile.port
292
293 ifeq ($(enable_rpath), yes)
294 LDFLAGS += $(rpath)
295 endif
296
297
298 ##########################################################################
299 #
300 # Some variables needed to find some client interfaces
301
302 libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
303 libpq_builddir = $(top_builddir)/src/interfaces/libpq
304 libpq = -L$(libpq_builddir) -lpq
305
306 submake-libpq:
307         $(MAKE) -C $(libpq_builddir) all
308
309 submake-libpgport:
310         $(MAKE) -C $(top_builddir)/src/port all
311
312 .PHONY: submake-libpq submake-libpgport
313
314
315 ##########################################################################
316 #
317 # Customization
318 #
319 # This includes your local customizations if Makefile.custom exists
320 # in the source directory.  This file doesn't exist in the original
321 # distribution so that it doesn't get overwritten when you upgrade.
322 #
323 # NOTE:  Makefile.custom is from the pre-Autoconf days of PostgreSQL.
324 # You are liable to shoot yourself in the foot if you use it without
325 # knowing exactly what you're doing.  The preferred (and more
326 # reliable) method is to communicate what you want to do to the
327 # configure script, and leave the makefiles alone.
328
329 -include $(top_srcdir)/src/Makefile.custom
330
331 ifneq ($(CUSTOM_INSTALL),)
332 INSTALL= $(CUSTOM_INSTALL)
333 endif
334
335 ifneq ($(CUSTOM_CC),)
336   CC= $(CUSTOM_CC)
337 endif
338
339 ifneq ($(CUSTOM_COPT),)
340   COPT= $(CUSTOM_COPT)
341 endif
342
343 ifdef COPT
344    CFLAGS+= $(COPT)
345    LDFLAGS+= $(COPT)
346 endif
347
348 ifdef PROFILE
349    CFLAGS+= $(PROFILE)
350    LDFLAGS+= $(PROFILE)
351 endif
352
353
354 ##########################################################################
355 #
356 # substitute implementations of the C library
357
358 LIBOBJS = @LIBOBJS@
359
360 ifneq (,$(LIBOBJS))
361 LIBS += -lpgport
362 LDFLAGS := -L$(top_builddir)/src/port $(LDFLAGS)
363 endif
364
365 # Not really standard libc functions, used by the backend.
366 TAS         = @TAS@
367
368
369 ##########################################################################
370 #
371 # Global targets and rules
372
373 %.gz: %
374         $(GZIP) -f --best $<
375
376 %.bz2: %
377         $(BZIP2) -f $<
378
379 # Remake Makefile.global from Makefile.global.in if the latter
380 # changed. In order to trigger this rule, the including file must
381 # write `include $(top_builddir)/src/Makefile.global', not some
382 # shortcut thereof.
383 $(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_builddir)/config.status
384         cd $(top_builddir) && ./config.status src/Makefile.global
385
386 # Remake pg_config.h from pg_config.h.in if the latter changed.
387 # config.status will not change the timestamp on pg_config.h if it
388 # doesn't change, so as to avoid recompiling the entire tree
389 # unnecessarily. Therefore we make config.status update a timestamp file
390 # stamp-h everytime it runs, so that we don't trigger this rule everytime.
391 # (We do trigger the null rule for stamp-h to pg_config.h everytime; so it's
392 # important for that rule to be null!)
393 #
394 # Of course you need to turn on dependency tracking to get any
395 # dependencies on pg_config.h.
396 $(top_builddir)/src/include/pg_config.h: $(top_builddir)/src/include/stamp-h
397
398 $(top_builddir)/src/include/stamp-h: $(top_srcdir)/src/include/pg_config.h.in $(top_builddir)/config.status
399         cd $(top_builddir) && ./config.status src/include/pg_config.h
400
401 # When configure changes, rerun configure with the same options as
402 # last time. To change configure, you need to run autoconf manually.
403 $(top_builddir)/config.status: $(top_srcdir)/configure
404         cd $(top_builddir) && ./config.status --recheck
405
406
407 install-strip:
408         @$(MAKE) INSTALL_PROGRAM_ENV="STRIPPROG='$(STRIP)'" \
409             INSTALL_STLIB_ENV="STRIPPROG='$(STRIP_STATIC_LIB)'" \
410             INSTALL_SHLIB_ENV="STRIPPROG='$(STRIP_SHARED_LIB)'" \
411             INSTALL_STRIP_FLAG=-s \
412             install
413
414
415 ##########################################################################
416 #
417 # Automatic dependency generation
418 # -------------------------------
419 # When we configure with --enable-depend then we override the default
420 # compilation rule with the magic below. While or after creating the
421 # actual output file we also create a dependency list for the .c file.
422 # Next time we invoke make we will have top-notch information about
423 # whether this file needs to be updated. The dependency files are kept
424 # in the .deps subdirectory of each directory.
425 #
426 # The sed command is necessary to post-process the dependency file:
427 # Each dependency file becomes a target of its own, without
428 # dependencies or commands. This is because if you happen to remove a
429 # file that is a dependency (say, you rename a header file) the
430 # dependency would point to a non-existing file and make would fail.
431 # But if the file is listed as a target of its own, without
432 # prerequisites and commands, and doesn't exist then make will
433 # consider it updated. (That in turn also has the nice side effect
434 # that make will update all files that depended on the now removed
435 # file.)
436
437 autodepend = @autodepend@
438
439 ifeq ($(autodepend), yes)
440
441 ifndef COMPILE.c
442 COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
443 endif
444
445 ifndef COMPILE.cc
446 COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
447 endif
448
449 DEPDIR = .deps
450 df = $(DEPDIR)/$(*F)
451
452 # This converts a .d file in the current directory to a .P file in the .deps
453 # subdirectory, with the dummy targets as explained above.
454 define postprocess-depend
455 @if test ! -d $(DEPDIR); then mkdir $(DEPDIR); fi
456 @cp $*.d $(df).P
457 @sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
458      -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $(df).P
459 @rm -f $*.d
460 endef
461
462 ifeq ($(GCC), yes)
463
464 # GCC allows us to create object and dependency file in one invocation.
465 %.o : %.c
466         $(COMPILE.c) -o $@ $< -MMD
467         $(postprocess-depend)
468
469 endif # GCC
470
471 ifeq ($(GXX), yes)
472
473 %.o : %.cc
474         $(COMPILE.cc) -o $@ $< -MMD
475         $(postprocess-depend)
476
477 endif # GXX
478
479 # Include all the dependency files generated for the current
480 # directory. List /dev/null as dummy because if the wildcard expands
481 # to nothing then make would complain.
482 -include $(wildcard $(DEPDIR)/*.P) /dev/null
483
484 # hook for clean-up
485 clean distclean maintainer-clean: clean-deps
486
487 .PHONY: clean-deps
488 clean-deps:
489         @rm -rf $(DEPDIR) *.d
490
491 endif # autodepend
492
493
494 ##########################################################################
495 #
496 # Native language support
497
498 ifeq ($(enable_nls), yes)
499 ifneq (,$(wildcard $(srcdir)/nls.mk))
500
501 include $(top_srcdir)/src/nls-global.mk
502
503 endif # nls.mk
504 endif # enable_nls