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