OSDN Git Service

Fix filename mention in psqlrc.sample file.
[pg-rex/syncrep.git] / src / bin / psql / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for src/bin/psql
4 #
5 # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
6 # Portions Copyright (c) 1994, Regents of the University of California
7 #
8 # $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.42 2004/04/22 14:33:45 momjian Exp $
9 #
10 #-------------------------------------------------------------------------
11
12 subdir = src/bin/psql
13 top_builddir = ../../..
14 include $(top_builddir)/src/Makefile.global
15
16 REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref
17
18 override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"'
19
20 OBJS=   command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
21         startup.o prompt.o variables.o large_obj.o print.o describe.o \
22         psqlscan.o tab-complete.o mbprint.o
23
24 FLEXFLAGS = -Cfe
25
26
27 all: submake-libpq submake-libpgport psql
28
29 psql: $(OBJS) $(libpq_builddir)/libpq.a
30         $(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@
31
32 help.o: $(srcdir)/sql_help.h
33
34 ifdef PERL
35 $(srcdir)/sql_help.h: create_help.pl $(wildcard $(REFDOCDIR)/*.sgml)
36         $(PERL) $< $(REFDOCDIR) $@
37 else
38 $(srcdir)/sql_help.h:
39         @echo "*** Perl is needed to build psql help."
40 endif
41
42 $(srcdir)/psqlscan.c: psqlscan.l
43 ifdef FLEX
44         $(FLEX) $(FLEXFLAGS) -o'$@' $<
45 else
46         @$(missing) flex $< $@
47 endif
48
49 distprep: $(srcdir)/sql_help.h $(srcdir)/psqlscan.c
50
51 install: all installdirs
52         $(INSTALL_PROGRAM) psql$(X) $(DESTDIR)$(bindir)/psql$(X)
53         $(INSTALL_DATA) $(srcdir)/psqlrc.sample $(DESTDIR)$(datadir)/psqlrc.sample
54
55 installdirs:
56         $(mkinstalldirs) $(DESTDIR)$(bindir)
57
58 uninstall:
59         rm -f $(DESTDIR)$(bindir)/psql$(X)
60
61 # psqlscan.c is in the distribution tarball, so is not cleaned here
62 clean distclean:
63         rm -f psql$(X) $(OBJS)
64
65 maintainer-clean: distclean
66         rm -f $(srcdir)/sql_help.h $(srcdir)/psqlscan.c