OSDN Git Service

Add docs for initdb --auth.
[pg-rex/syncrep.git] / src / Makefile.global.in
1 # -*-makefile-*-
2 # $PostgreSQL: pgsql/src/Makefile.global.in,v 1.191 2004/08/01 06:19:19 momjian 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 # docdir can be an empty string to signify --without-docdir
109 ifneq (,$(docdir))
110 ifeq "$(findstring pgsql, $(docdir))" ""
111 ifeq "$(findstring postgres, $(docdir))" ""
112 override docdir := $(docdir)/postgresql
113 endif
114 endif
115 endif
116
117 localedir := @localedir@
118
119 pgxsdir = $(pkglibdir)/pgxs
120
121
122 ##########################################################################
123 #
124 # Features
125 #
126 # Records the choice of the various --enable-xxx and --with-xxx options.
127
128 with_perl       = @with_perl@
129 with_python     = @with_python@
130 with_tcl        = @with_tcl@
131 enable_shared   = @enable_shared@
132 enable_rpath    = @enable_rpath@
133 enable_nls      = @enable_nls@
134 enable_debug    = @enable_debug@
135 enable_thread_safety    = @enable_thread_safety@
136
137 python_includespec      = @python_includespec@
138 python_libspec          = @python_libspec@
139 python_configdir        = @python_configdir@
140
141 krb_srvtab = @krb_srvtab@
142
143 TCLSH                   = @TCLSH@
144 TCL_LIB_FILE            = @TCL_LIB_FILE@
145 TCL_LIBS                = @TCL_LIBS@
146 TCL_LIB_SPEC            = @TCL_LIB_SPEC@
147 TCL_INCLUDE_SPEC        = @TCL_INCLUDE_SPEC@
148 TCL_SHARED_BUILD        = @TCL_SHARED_BUILD@
149 TCL_SHLIB_LD_LIBS       = @TCL_SHLIB_LD_LIBS@
150
151 TK_LIBS                 = @TK_LIBS@
152 TK_LIB_SPEC             = @TK_LIB_SPEC@
153 TK_XINCLUDES            = @TK_XINCLUDES@
154
155 PTHREAD_CFLAGS          = @PTHREAD_CFLAGS@
156 PTHREAD_LIBS            = @PTHREAD_LIBS@
157
158 have_docbook    = @have_docbook@
159 DOCBOOKSTYLE    = @DOCBOOKSTYLE@
160 COLLATEINDEX    = @COLLATEINDEX@
161
162
163 ##########################################################################
164 #
165 # Programs and flags
166
167 # Compilers
168
169 CPP = @CPP@
170 CPPFLAGS = @CPPFLAGS@
171
172 ifdef PGXS
173 override CPPFLAGS := -I$(includedir_server) -I$(includedir_internal) $(CPPFLAGS)
174 else # not PGXS
175 override CPPFLAGS := -I$(top_srcdir)/src/include $(CPPFLAGS)
176 ifdef VPATH
177 override CPPFLAGS := -I$(top_builddir)/src/include $(CPPFLAGS)
178 endif
179 endif # not PGXS
180
181 CC = @CC@
182 GCC = @GCC@
183 CFLAGS = @CFLAGS@
184 ifeq ($(GCC), yes)
185   CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations
186 endif
187
188 # Kind-of compilers
189
190 YACC = @YACC@
191 YFLAGS = @YFLAGS@
192 FLEX = @FLEX@
193 FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS)
194
195 # Linking
196
197 LIBS = @LIBS@
198 LD = @LD@
199 with_gnu_ld = @with_gnu_ld@
200 ld_R_works = @ld_R_works@
201 LDFLAGS = @LDFLAGS@
202 LDREL = -r
203 LDOUT = -o
204 RANLIB = @RANLIB@
205 LORDER = @LORDER@
206 X = @EXEEXT@
207
208 # Perl 
209
210 PERL                    = @PERL@
211 perl_archlibexp         = @perl_archlibexp@
212 perl_privlibexp         = @perl_privlibexp@
213 perl_useshrplib         = @perl_useshrplib@
214 perl_embed_ldflags      = @perl_embed_ldflags@
215
216 # Miscellaneous
217
218 AWK     = @AWK@
219 LN_S    = @LN_S@
220 MSGFMT  = @MSGFMT@
221 MSGMERGE = @MSGMERGE@
222 PYTHON  = @PYTHON@
223 TAR     = @TAR@
224 XGETTEXT = @XGETTEXT@
225
226 GZIP    = gzip
227 BZIP2   = bzip2
228
229 # Installation.
230
231 INSTALL = $(SHELL) $(top_srcdir)/config/install-sh -c
232
233 INSTALL_PROGRAM = $(INSTALL_PROGRAM_ENV) $(INSTALL) $(INSTALL_STRIP_FLAG)
234 INSTALL_SCRIPT  = $(INSTALL) -m 755
235 INSTALL_DATA    = $(INSTALL) -m 644
236 INSTALL_STLIB   = $(INSTALL_STLIB_ENV) $(INSTALL_DATA) $(INSTALL_STRIP_FLAG)
237 INSTALL_SHLIB   = $(INSTALL_SHLIB_ENV) $(INSTALL) $(INSTALL_SHLIB_OPTS) $(INSTALL_STRIP_FLAG)
238 # Override in Makefile.port if necessary
239 INSTALL_SHLIB_OPTS = -m 755
240
241 mkinstalldirs   = $(SHELL) $(top_srcdir)/config/mkinstalldirs
242 missing         = $(SHELL) $(top_srcdir)/config/missing
243
244 STRIP           = @STRIP@
245 STRIP_STATIC_LIB = @STRIP_STATIC_LIB@
246 STRIP_SHARED_LIB = @STRIP_SHARED_LIB@
247
248 # Documentation
249
250 JADE    = @JADE@
251 NSGMLS  = @NSGMLS@
252 SGMLSPL = @SGMLSPL@
253
254 # Feature settings
255
256 DEF_PGPORT = @default_port@
257 WANTED_LANGUAGES = @WANTED_LANGUAGES@
258
259
260 ##########################################################################
261 #
262 # Additional platform-specific settings
263 #
264
265 # Name of the "template"
266 PORTNAME= @PORTNAME@
267
268 host_tuple = @host@
269 host_os = @host_os@
270 host_cpu = @host_cpu@
271
272 # Make HAVE_IPV6 available for initdb script creation
273 HAVE_IPV6= @HAVE_IPV6@
274
275 # The HP-UX port makefile, for one, needs access to this symbol
276 HAVE_POSIX_SIGNALS= @HAVE_POSIX_SIGNALS@
277
278 # This is mainly for use on FreeBSD, where we have both a.out and elf
279 # systems now.  May be applicable to other systems to?
280 ELF_SYSTEM= @ELF_SYS@
281
282 # Pull in platform-specific magic
283 include $(top_builddir)/src/Makefile.port
284
285 ifeq ($(enable_rpath), yes)
286 LDFLAGS += $(rpath)
287 endif
288
289
290 ##########################################################################
291 #
292 # Some variables needed to find some client interfaces
293
294 libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
295 libpq_builddir = $(top_builddir)/src/interfaces/libpq
296 libpq = -L$(libpq_builddir) -lpq
297
298 submake-libpq:
299         $(MAKE) -C $(libpq_builddir) all
300
301 submake-libpgport:
302         $(MAKE) -C $(top_builddir)/src/port all
303
304 .PHONY: submake-libpq submake-libpgport
305
306
307 ##########################################################################
308 #
309 # Customization
310 #
311 # This includes your local customizations if Makefile.custom exists
312 # in the source directory.  This file doesn't exist in the original
313 # distribution so that it doesn't get overwritten when you upgrade.
314 #
315 # NOTE:  Makefile.custom is from the pre-Autoconf days of PostgreSQL.
316 # You are liable to shoot yourself in the foot if you use it without
317 # knowing exactly what you're doing.  The preferred (and more
318 # reliable) method is to communicate what you want to do to the
319 # configure script, and leave the makefiles alone.
320
321 -include $(top_srcdir)/src/Makefile.custom
322
323 ifneq ($(CUSTOM_INSTALL),)
324 INSTALL= $(CUSTOM_INSTALL)
325 endif
326
327 ifneq ($(CUSTOM_CC),)
328   CC= $(CUSTOM_CC)
329 endif
330
331 ifneq ($(CUSTOM_COPT),)
332   COPT= $(CUSTOM_COPT)
333 endif
334
335 ifdef COPT
336    CFLAGS+= $(COPT)
337    LDFLAGS+= $(COPT)
338 endif
339
340 ifdef PROFILE
341    CFLAGS+= $(PROFILE)
342    LDFLAGS+= $(PROFILE)
343 endif
344
345
346 ##########################################################################
347 #
348 # substitute implementations of the C library
349
350 LIBOBJS = @LIBOBJS@ dirmod.o exec.o noblock.o path.o pipe.o pgsleep.o pgstrcasecmp.o sprompt.o thread.o
351
352 ifneq (,$(LIBOBJS))
353 LIBS := -lpgport $(LIBS)
354 LDFLAGS := -L$(top_builddir)/src/port $(LDFLAGS)
355 endif
356
357 # to make ws2_32.lib the last library
358 ifeq ($(PORTNAME),win32)
359 LIBS += -lws2_32
360 endif
361
362 # Not really standard libc functions, used by the backend.
363 TAS         = @TAS@
364
365
366 ##########################################################################
367 #
368 # Global targets and rules
369
370 %.gz: %
371         $(GZIP) -f --best $<
372
373 %.bz2: %
374         $(BZIP2) -f $<
375
376
377 ifndef PGXS
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 endif # not PGXS
407
408
409 install-strip:
410         @$(MAKE) INSTALL_PROGRAM_ENV="STRIPPROG='$(STRIP)'" \
411             INSTALL_STLIB_ENV="STRIPPROG='$(STRIP_STATIC_LIB)'" \
412             INSTALL_SHLIB_ENV="STRIPPROG='$(STRIP_SHARED_LIB)'" \
413             INSTALL_STRIP_FLAG=-s \
414             install
415
416
417 ##########################################################################
418 #
419 # Automatic dependency generation
420 # -------------------------------
421 # When we configure with --enable-depend then we override the default
422 # compilation rule with the magic below. While or after creating the
423 # actual output file we also create a dependency list for the .c file.
424 # Next time we invoke make we will have top-notch information about
425 # whether this file needs to be updated. The dependency files are kept
426 # in the .deps subdirectory of each directory.
427 #
428 # The sed command is necessary to post-process the dependency file:
429 # Each dependency file becomes a target of its own, without
430 # dependencies or commands. This is because if you happen to remove a
431 # file that is a dependency (say, you rename a header file) the
432 # dependency would point to a non-existing file and make would fail.
433 # But if the file is listed as a target of its own, without
434 # prerequisites and commands, and doesn't exist then make will
435 # consider it updated. (That in turn also has the nice side effect
436 # that make will update all files that depended on the now removed
437 # file.)
438
439 autodepend = @autodepend@
440
441 ifeq ($(autodepend), yes)
442
443 ifndef COMPILE.c
444 COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
445 endif
446
447 DEPDIR = .deps
448 df = $(DEPDIR)/$(*F)
449
450 # This converts a .d file in the current directory to a .P file in the .deps
451 # subdirectory, with the dummy targets as explained above.
452 define postprocess-depend
453 @if test ! -d $(DEPDIR); then mkdir $(DEPDIR); fi
454 @cp $*.d $(df).P
455 @sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
456      -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $(df).P
457 @rm -f $*.d
458 endef
459
460 ifeq ($(GCC), yes)
461
462 # GCC allows us to create object and dependency file in one invocation.
463 %.o : %.c
464         $(COMPILE.c) -o $@ $< -MMD
465         $(postprocess-depend)
466
467 endif # GCC
468
469 # Include all the dependency files generated for the current
470 # directory. List /dev/null as dummy because if the wildcard expands
471 # to nothing then make would complain.
472 -include $(wildcard $(DEPDIR)/*.P) /dev/null
473
474 # hook for clean-up
475 clean distclean maintainer-clean: clean-deps
476
477 .PHONY: clean-deps
478 clean-deps:
479         @rm -rf $(DEPDIR) *.d
480
481 endif # autodepend
482
483
484 ##########################################################################
485 #
486 # Native language support
487
488 ifeq ($(enable_nls), yes)
489 ifneq (,$(wildcard $(srcdir)/nls.mk))
490
491 include $(top_srcdir)/src/nls-global.mk
492
493 endif # nls.mk
494 endif # enable_nls