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