]> granicus.if.org Git - postgresql/blob - src/bin/psql/Makefile
Remove cvs keywords from all files.
[postgresql] / src / bin / psql / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for src/bin/psql
4 #
5 # Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
6 # Portions Copyright (c) 1994, Regents of the University of California
7 #
8 # src/bin/psql/Makefile
9 #
10 #-------------------------------------------------------------------------
11
12 PGFILEDESC = "psql - the PostgreSQL interactive terminal"
13 PGAPPICON=win32
14
15 subdir = src/bin/psql
16 top_builddir = ../../..
17 include $(top_builddir)/src/Makefile.global
18
19 REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref
20
21 override CPPFLAGS := -I. -I$(srcdir) -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/pg_dump $(CPPFLAGS)
22
23 OBJS=   command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
24         startup.o prompt.o variables.o large_obj.o print.o describe.o \
25         tab-complete.o mbprint.o dumputils.o keywords.o kwlookup.o \
26         sql_help.o \
27         $(WIN32RES)
28
29 FLEXFLAGS = -Cfe
30
31
32 all: submake-libpq submake-libpgport psql
33
34 psql: $(OBJS) $(libpq_builddir)/libpq.a
35         $(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
36
37 help.o: sql_help.h
38
39 dumputils.c keywords.c: % : $(top_srcdir)/src/bin/pg_dump/%
40         rm -f $@ && $(LN_S) $< .
41
42 kwlookup.c: % : $(top_srcdir)/src/backend/parser/%
43         rm -f $@ && $(LN_S) $< .
44
45 sql_help.c: sql_help.h ;
46 sql_help.h: create_help.pl $(wildcard $(REFDOCDIR)/*.sgml)
47         $(PERL) $< $(REFDOCDIR) $*
48
49 # psqlscan is compiled as part of mainloop
50 mainloop.o: psqlscan.c
51
52 psqlscan.c: psqlscan.l
53 ifdef FLEX
54         $(FLEX) $(FLEXFLAGS) -o'$@' $<
55 else
56         @$(missing) flex $< $@
57 endif
58
59 distprep: sql_help.h psqlscan.c
60
61 install: all installdirs
62         $(INSTALL_PROGRAM) psql$(X) '$(DESTDIR)$(bindir)/psql$(X)'
63         $(INSTALL_DATA) $(srcdir)/psqlrc.sample '$(DESTDIR)$(datadir)/psqlrc.sample'
64
65 installdirs:
66         $(MKDIR_P) '$(DESTDIR)$(bindir)'
67
68 uninstall:
69         rm -f '$(DESTDIR)$(bindir)/psql$(X)' '$(DESTDIR)$(datadir)/psqlrc.sample'
70
71 # psqlscan.c is in the distribution tarball, so is not cleaned here
72 clean distclean:
73         rm -f psql$(X) $(OBJS) dumputils.c keywords.c kwlookup.c
74
75 maintainer-clean: distclean
76         rm -f sql_help.h sql_help.c psqlscan.c