Fix obsolete comment regarding FSM truncation.
[PostgreSQL.git] / src / bin / psql / Makefile
blobb2de9eb831963adf5fd138da2a97a185e4906e92
1 #-------------------------------------------------------------------------
3 # Makefile for src/bin/psql
5 # Portions Copyright (c) 1996-2008, 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 $(WIN32RES)
26 EXTRA_OBJS = $(top_builddir)/src/backend/parser/keywords.o
28 FLEXFLAGS = -Cfe
31 all: submake-libpq submake-libpgport submake-backend psql
33 psql: $(OBJS) $(libpq_builddir)/libpq.a
34 $(CC) $(CFLAGS) $(OBJS) $(EXTRA_OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)
36 help.o: $(srcdir)/sql_help.h
38 dumputils.c: % : $(top_srcdir)/src/bin/pg_dump/%
39 rm -f $@ && $(LN_S) $< .
41 ifdef PERL
42 $(srcdir)/sql_help.h: create_help.pl $(wildcard $(REFDOCDIR)/*.sgml)
43 $(PERL) $< $(REFDOCDIR) $@
44 else
45 $(srcdir)/sql_help.h:
46 @echo "*** Perl is needed to build psql help."
47 endif
49 $(srcdir)/psqlscan.c: psqlscan.l
50 ifdef FLEX
51 $(FLEX) $(FLEXFLAGS) -o'$@' $<
52 else
53 @$(missing) flex $< $@
54 endif
56 .PHONY: submake-backend
57 submake-backend:
58 $(MAKE) -C $(top_builddir)/src/backend/parser keywords.o
60 distprep: $(srcdir)/sql_help.h $(srcdir)/psqlscan.c
62 install: all installdirs
63 $(INSTALL_PROGRAM) psql$(X) '$(DESTDIR)$(bindir)/psql$(X)'
64 $(INSTALL_DATA) $(srcdir)/psqlrc.sample '$(DESTDIR)$(datadir)/psqlrc.sample'
66 installdirs:
67 $(mkinstalldirs) '$(DESTDIR)$(bindir)'
69 uninstall:
70 rm -f '$(DESTDIR)$(bindir)/psql$(X)' '$(DESTDIR)$(datadir)/psqlrc.sample'
72 # psqlscan.c is in the distribution tarball, so is not cleaned here
73 clean distclean:
74 rm -f psql$(X) $(OBJS) dumputils.c
76 maintainer-clean: distclean
77 rm -f $(srcdir)/sql_help.h $(srcdir)/psqlscan.c