Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / src / bin / psql / Makefile
blob1d82caf8d09b01592b563d3621741f94b634aab3
1 #-------------------------------------------------------------------------
3 # Makefile for src/bin/psql
5 # Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
6 # Portions Copyright (c) 1994, Regents of the University of California
8 # $PostgreSQL$
10 #-------------------------------------------------------------------------
12 PGFILEDESC = "psql - the PostgreSQL interactive terminal"
13 PGAPPICON=win32
14 subdir = src/bin/psql
15 top_builddir = ../../..
16 include $(top_builddir)/src/Makefile.global
18 REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref
20 override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/pg_dump $(CPPFLAGS)
22 OBJS= command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
23 startup.o prompt.o variables.o large_obj.o print.o describe.o \
24 psqlscan.o tab-complete.o mbprint.o dumputils.o keywords.o kwlookup.o \
25 $(WIN32RES)
27 FLEXFLAGS = -Cfe
30 all: submake-libpq submake-libpgport psql
32 psql: $(OBJS) $(libpq_builddir)/libpq.a
33 $(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)
35 help.o: $(srcdir)/sql_help.h
37 dumputils.c keywords.c: % : $(top_srcdir)/src/bin/pg_dump/%
38 rm -f $@ && $(LN_S) $< .
40 kwlookup.c: % : $(top_srcdir)/src/backend/parser/%
41 rm -f $@ && $(LN_S) $< .
43 $(srcdir)/sql_help.h: create_help.pl $(wildcard $(REFDOCDIR)/*.sgml)
44 $(PERL) $< $(REFDOCDIR) $@
46 $(srcdir)/psqlscan.c: psqlscan.l
47 ifdef FLEX
48 $(FLEX) $(FLEXFLAGS) -o'$@' $<
49 else
50 @$(missing) flex $< $@
51 endif
53 distprep: $(srcdir)/sql_help.h $(srcdir)/psqlscan.c
55 install: all installdirs
56 $(INSTALL_PROGRAM) psql$(X) '$(DESTDIR)$(bindir)/psql$(X)'
57 $(INSTALL_DATA) $(srcdir)/psqlrc.sample '$(DESTDIR)$(datadir)/psqlrc.sample'
59 installdirs:
60 $(mkinstalldirs) '$(DESTDIR)$(bindir)'
62 uninstall:
63 rm -f '$(DESTDIR)$(bindir)/psql$(X)' '$(DESTDIR)$(datadir)/psqlrc.sample'
65 # psqlscan.c is in the distribution tarball, so is not cleaned here
66 clean distclean:
67 rm -f psql$(X) $(OBJS) dumputils.c keywords.c kwlookup.c
69 maintainer-clean: distclean
70 rm -f $(srcdir)/sql_help.h $(srcdir)/psqlscan.c