1 #-------------------------------------------------------------------------
3 # Makefile for src/bin/initdb
5 # Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
6 # Portions Copyright (c) 1994, Regents of the University of California
10 #-------------------------------------------------------------------------
12 PGFILEDESC
= "initdb - initialize a new database cluster"
13 subdir
= src
/bin
/initdb
14 top_builddir
= ..
/..
/..
15 include $(top_builddir
)/src
/Makefile.global
17 override CPPFLAGS
:= -DFRONTEND
-I
$(libpq_srcdir
) $(CPPFLAGS
)
19 OBJS
= initdb.o encnames.o pqsignal.o
$(WIN32RES
)
21 all: submake-libpgport initdb
24 $(CC
) $(CFLAGS
) $(OBJS
) $(LDFLAGS
) $(LIBS
) -o
$@
$(X
)
26 # We used to pull in all of libpq to get encnames and pqsignal, but that
27 # exposes us to risks of version skew if we link to a shared library.
28 # Do it the hard way, instead, so that we're statically linked.
30 encnames.c
: % : $(top_srcdir
)/src
/backend
/utils
/mb
/%
31 rm -f
$@
&& $(LN_S
) $< .
33 pqsignal.c
: % : $(top_srcdir
)/src
/interfaces
/libpq
/%
34 rm -f
$@
&& $(LN_S
) $< .
36 install: all installdirs
37 $(INSTALL_PROGRAM
) initdb
$(X
) '$(DESTDIR)$(bindir)/initdb$(X)'
40 $(mkinstalldirs
) '$(DESTDIR)$(bindir)'
43 rm -f
'$(DESTDIR)$(bindir)/initdb$(X)'
45 clean distclean maintainer-clean
:
46 rm -f initdb
$(X
) $(OBJS
) encnames.c pqsignal.c
49 # ensure that changes in datadir propagate into object file
50 initdb.o
: initdb.c
$(top_builddir
)/src
/Makefile.global