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