OSDN Git Service

Put path configuration information into a .h file instead of cluttering
[pg-rex/syncrep.git] / src / Makefile.global.in
1 # -*-makefile-*-
2 # $PostgreSQL: pgsql/src/Makefile.global.in,v 1.186 2004/05/21 20:56:48 tgl 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 prefix := @prefix@
56 exec_prefix := @exec_prefix@
57
58 bindir := @bindir@
59 sbindir := @sbindir@
60 libexecdir := @libexecdir@
61
62 datadir := @datadir@
63 sysconfdir := @sysconfdir@
64
65 libdir := @libdir@
66 pkglibdir := @pkglibdir@
67
68 includedir := @includedir@
69 pkgincludedir := @pkgincludedir@
70 includedir_server = $(pkgincludedir)/server
71 includedir_internal = $(pkgincludedir)/internal
72
73 mandir := @mandir@
74 sqlmansect_dummy = l
75
76 docdir := @docdir@
77
78 localedir := @localedir@
79
80
81 ##########################################################################
82 #
83 # Features
84 #
85 # Records the choice of the various --enable-xxx and --with-xxx options.
86
87 with_perl       = @with_perl@
88 with_python     = @with_python@
89 with_tcl        = @with_tcl@
90 enable_shared   = @enable_shared@
91 enable_rpath    = @enable_rpath@
92 enable_nls      = @enable_nls@
93 enable_debug    = @enable_debug@
94 enable_thread_safety    = @enable_thread_safety@
95
96 python_includespec      = @python_includespec@
97 python_libspec          = @python_libspec@
98 python_configdir        = @python_configdir@
99
100 krb_srvtab = @krb_srvtab@
101
102 TCLSH                   = @TCLSH@
103 TCL_LIB_FILE            = @TCL_LIB_FILE@
104 TCL_LIBS                = @TCL_LIBS@
105 TCL_LIB_SPEC            = @TCL_LIB_SPEC@
106 TCL_INCLUDE_SPEC        = @TCL_INCLUDE_SPEC@
107 TCL_SHARED_BUILD        = @TCL_SHARED_BUILD@
108 TCL_SHLIB_LD_LIBS       = @TCL_SHLIB_LD_LIBS@
109
110 TK_LIBS                 = @TK_LIBS@
111 TK_LIB_SPEC             = @TK_LIB_SPEC@
112 TK_XINCLUDES            = @TK_XINCLUDES@
113
114 PTHREAD_CFLAGS          = @PTHREAD_CFLAGS@
115 PTHREAD_LIBS            = @PTHREAD_LIBS@
116
117 have_docbook    = @have_docbook@
118 DOCBOOKSTYLE    = @DOCBOOKSTYLE@
119 COLLATEINDEX    = @COLLATEINDEX@
120
121
122 ##########################################################################
123 #
124 # Programs and flags
125
126 # Compilers
127
128 CPP = @CPP@
129 CPPFLAGS = @CPPFLAGS@
130 override CPPFLAGS := -I$(top_srcdir)/src/include $(CPPFLAGS)
131 ifdef VPATH
132 override CPPFLAGS := -I$(top_builddir)/src/include $(CPPFLAGS)
133 endif
134
135 CC = @CC@
136 GCC = @GCC@
137 CFLAGS = @CFLAGS@
138 ifeq ($(GCC), yes)
139   CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations
140 endif
141
142 # Kind-of compilers
143
144 YACC = @YACC@
145 YFLAGS = @YFLAGS@
146 FLEX = @FLEX@
147 FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS)
148
149 # Linking
150
151 LIBS = @LIBS@
152 LD = @LD@
153 with_gnu_ld = @with_gnu_ld@
154 ld_R_works = @ld_R_works@
155 LDFLAGS = @LDFLAGS@
156 LDREL = -r
157 LDOUT = -o
158 RANLIB = @RANLIB@
159 LORDER = @LORDER@
160 X = @EXEEXT@
161
162 # Perl 
163
164 PERL                    = @PERL@
165 perl_archlibexp         = @perl_archlibexp@
166 perl_privlibexp         = @perl_privlibexp@
167 perl_useshrplib         = @perl_useshrplib@
168 perl_embed_ldflags      = @perl_embed_ldflags@
169
170 # Miscellaneous
171
172 AWK     = @AWK@
173 LN_S    = @LN_S@
174 MSGFMT  = @MSGFMT@
175 MSGMERGE = @MSGMERGE@
176 PYTHON  = @PYTHON@
177 TAR     = @TAR@
178 XGETTEXT = @XGETTEXT@
179
180 GZIP    = gzip
181 BZIP2   = bzip2
182
183 # Installation.
184
185 INSTALL = $(SHELL) $(top_srcdir)/config/install-sh -c
186
187 INSTALL_PROGRAM = $(INSTALL_PROGRAM_ENV) $(INSTALL) $(INSTALL_STRIP_FLAG)
188 INSTALL_SCRIPT  = $(INSTALL) -m 755
189 INSTALL_DATA    = $(INSTALL) -m 644
190 INSTALL_STLIB   = $(INSTALL_STLIB_ENV) $(INSTALL_DATA) $(INSTALL_STRIP_FLAG)
191 INSTALL_SHLIB   = $(INSTALL_SHLIB_ENV) $(INSTALL) $(INSTALL_SHLIB_OPTS) $(INSTALL_STRIP_FLAG)
192 # Override in Makefile.port if necessary
193 INSTALL_SHLIB_OPTS = -m 755
194
195 mkinstalldirs   = $(SHELL) $(top_srcdir)/config/mkinstalldirs
196 missing         = $(SHELL) $(top_srcdir)/config/missing
197
198 STRIP           = @STRIP@
199 STRIP_STATIC_LIB = @STRIP_STATIC_LIB@
200 STRIP_SHARED_LIB = @STRIP_SHARED_LIB@
201
202 # Documentation
203
204 JADE    = @JADE@
205 NSGMLS  = @NSGMLS@
206 SGMLSPL = @SGMLSPL@
207
208 # Feature settings
209
210 DEF_PGPORT = @default_port@
211 WANTED_LANGUAGES = @WANTED_LANGUAGES@
212
213
214 ##########################################################################
215 #
216 # Additional platform-specific settings
217 #
218
219 # Name of the "template"
220 PORTNAME= @PORTNAME@
221
222 host_tuple = @host@
223 host_os = @host_os@
224 host_cpu = @host_cpu@
225
226 # Make HAVE_IPV6 available for initdb script creation
227 HAVE_IPV6= @HAVE_IPV6@
228
229 # The HP-UX port makefile, for one, needs access to this symbol
230 HAVE_POSIX_SIGNALS= @HAVE_POSIX_SIGNALS@
231
232 # This is mainly for use on FreeBSD, where we have both a.out and elf
233 # systems now.  May be applicable to other systems to?
234 ELF_SYSTEM= @ELF_SYS@
235
236 # Pull in platform-specific magic
237 include $(top_builddir)/src/Makefile.port
238
239 ifeq ($(enable_rpath), yes)
240 LDFLAGS += $(rpath)
241 endif
242
243
244 ##########################################################################
245 #
246 # Some variables needed to find some client interfaces
247
248 libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
249 libpq_builddir = $(top_builddir)/src/interfaces/libpq
250 libpq = -L$(libpq_builddir) -lpq
251
252 submake-libpq:
253         $(MAKE) -C $(libpq_builddir) all
254
255 submake-libpgport:
256         $(MAKE) -C $(top_builddir)/src/port all
257
258 .PHONY: submake-libpq submake-libpgport
259
260
261 ##########################################################################
262 #
263 # Customization
264 #
265 # This includes your local customizations if Makefile.custom exists
266 # in the source directory.  This file doesn't exist in the original
267 # distribution so that it doesn't get overwritten when you upgrade.
268 #
269 # NOTE:  Makefile.custom is from the pre-Autoconf days of PostgreSQL.
270 # You are liable to shoot yourself in the foot if you use it without
271 # knowing exactly what you're doing.  The preferred (and more
272 # reliable) method is to communicate what you want to do to the
273 # configure script, and leave the makefiles alone.
274
275 -include $(top_srcdir)/src/Makefile.custom
276
277 ifneq ($(CUSTOM_INSTALL),)
278 INSTALL= $(CUSTOM_INSTALL)
279 endif
280
281 ifneq ($(CUSTOM_CC),)
282   CC= $(CUSTOM_CC)
283 endif
284
285 ifneq ($(CUSTOM_COPT),)
286   COPT= $(CUSTOM_COPT)
287 endif
288
289 ifdef COPT
290    CFLAGS+= $(COPT)
291    LDFLAGS+= $(COPT)
292 endif
293
294 ifdef PROFILE
295    CFLAGS+= $(PROFILE)
296    LDFLAGS+= $(PROFILE)
297 endif
298
299
300 ##########################################################################
301 #
302 # substitute implementations of the C library
303
304 LIBOBJS = @LIBOBJS@ exec.o noblock.o path.o pipe.o pgsleep.o pgstrcasecmp.o sprompt.o thread.o
305
306 ifneq (,$(LIBOBJS))
307 LIBS += -lpgport
308 LDFLAGS := -L$(top_builddir)/src/port $(LDFLAGS)
309 endif
310
311 # to make ws2_32.lib the last library
312 ifeq ($(PORTNAME),win32)
313 LIBS += -lws2_32
314 endif
315
316 # Not really standard libc functions, used by the backend.
317 TAS         = @TAS@
318
319
320 ##########################################################################
321 #
322 # Global targets and rules
323
324 %.gz: %
325         $(GZIP) -f --best $<
326
327 %.bz2: %
328         $(BZIP2) -f $<
329
330 # Remake Makefile.global from Makefile.global.in if the latter
331 # changed. In order to trigger this rule, the including file must
332 # write `include $(top_builddir)/src/Makefile.global', not some
333 # shortcut thereof.
334 $(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_builddir)/config.status
335         cd $(top_builddir) && ./config.status src/Makefile.global
336
337 # Remake pg_config.h from pg_config.h.in if the latter changed.
338 # config.status will not change the timestamp on pg_config.h if it
339 # doesn't change, so as to avoid recompiling the entire tree
340 # unnecessarily. Therefore we make config.status update a timestamp file
341 # stamp-h everytime it runs, so that we don't trigger this rule everytime.
342 # (We do trigger the null rule for stamp-h to pg_config.h everytime; so it's
343 # important for that rule to be null!)
344 #
345 # Of course you need to turn on dependency tracking to get any
346 # dependencies on pg_config.h.
347 $(top_builddir)/src/include/pg_config.h: $(top_builddir)/src/include/stamp-h
348
349 $(top_builddir)/src/include/stamp-h: $(top_srcdir)/src/include/pg_config.h.in $(top_builddir)/config.status
350         cd $(top_builddir) && ./config.status src/include/pg_config.h
351
352 # When configure changes, rerun configure with the same options as
353 # last time. To change configure, you need to run autoconf manually.
354 $(top_builddir)/config.status: $(top_srcdir)/configure
355         cd $(top_builddir) && ./config.status --recheck
356
357
358 install-strip:
359         @$(MAKE) INSTALL_PROGRAM_ENV="STRIPPROG='$(STRIP)'" \
360             INSTALL_STLIB_ENV="STRIPPROG='$(STRIP_STATIC_LIB)'" \
361             INSTALL_SHLIB_ENV="STRIPPROG='$(STRIP_SHARED_LIB)'" \
362             INSTALL_STRIP_FLAG=-s \
363             install
364
365
366 ##########################################################################
367 #
368 # Automatic dependency generation
369 # -------------------------------
370 # When we configure with --enable-depend then we override the default
371 # compilation rule with the magic below. While or after creating the
372 # actual output file we also create a dependency list for the .c file.
373 # Next time we invoke make we will have top-notch information about
374 # whether this file needs to be updated. The dependency files are kept
375 # in the .deps subdirectory of each directory.
376 #
377 # The sed command is necessary to post-process the dependency file:
378 # Each dependency file becomes a target of its own, without
379 # dependencies or commands. This is because if you happen to remove a
380 # file that is a dependency (say, you rename a header file) the
381 # dependency would point to a non-existing file and make would fail.
382 # But if the file is listed as a target of its own, without
383 # prerequisites and commands, and doesn't exist then make will
384 # consider it updated. (That in turn also has the nice side effect
385 # that make will update all files that depended on the now removed
386 # file.)
387
388 autodepend = @autodepend@
389
390 ifeq ($(autodepend), yes)
391
392 ifndef COMPILE.c
393 COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
394 endif
395
396 DEPDIR = .deps
397 df = $(DEPDIR)/$(*F)
398
399 # This converts a .d file in the current directory to a .P file in the .deps
400 # subdirectory, with the dummy targets as explained above.
401 define postprocess-depend
402 @if test ! -d $(DEPDIR); then mkdir $(DEPDIR); fi
403 @cp $*.d $(df).P
404 @sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
405      -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $(df).P
406 @rm -f $*.d
407 endef
408
409 ifeq ($(GCC), yes)
410
411 # GCC allows us to create object and dependency file in one invocation.
412 %.o : %.c
413         $(COMPILE.c) -o $@ $< -MMD
414         $(postprocess-depend)
415
416 endif # GCC
417
418 # Include all the dependency files generated for the current
419 # directory. List /dev/null as dummy because if the wildcard expands
420 # to nothing then make would complain.
421 -include $(wildcard $(DEPDIR)/*.P) /dev/null
422
423 # hook for clean-up
424 clean distclean maintainer-clean: clean-deps
425
426 .PHONY: clean-deps
427 clean-deps:
428         @rm -rf $(DEPDIR) *.d
429
430 endif # autodepend
431
432
433 ##########################################################################
434 #
435 # Native language support
436
437 ifeq ($(enable_nls), yes)
438 ifneq (,$(wildcard $(srcdir)/nls.mk))
439
440 include $(top_srcdir)/src/nls-global.mk
441
442 endif # nls.mk
443 endif # enable_nls