Debian Codegraph @

src/bin/psql/Makefile

raw
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for src/bin/psql
4 #
5 # Portions Copyright (c) 1996-2025, 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 # make this available to TAP test scripts
20 export with_readline
21
22 REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref
23
24 override CPPFLAGS := -I. -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
25 LDFLAGS_INTERNAL += -L$(top_builddir)/src/fe_utils -lpgfeutils $(libpq_pgport)
26
27 OBJS = \
28 $(WIN32RES) \
29 command.o \
30 common.o \
31 copy.o \
32 crosstabview.o \
33 describe.o \
34 help.o \
35 input.o \
36 large_obj.o \
37 mainloop.o \
38 prompt.o \
39 psqlscanslash.o \
40 sql_help.o \
41 startup.o \
42 stringutils.o \
43 tab-complete.o \
44 variables.o
45
46
47 all: psql
48
49 psql: $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
50 $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
51
52 help.o: sql_help.h
53
54 # See notes in src/backend/parser/Makefile about the following two rules
55 sql_help.c: sql_help.h
56 touch $@
57
58 sql_help.h: create_help.pl $(wildcard $(REFDOCDIR)/*.sgml)
59 $(PERL) $< --docdir $(REFDOCDIR) --basename $*
60
61 psqlscanslash.c: FLEXFLAGS = -Cfe -p -p
62 psqlscanslash.c: FLEX_NO_BACKUP=yes
63
64 tab-complete.c: gen_tabcomplete.pl tab-complete.in.c
65 $(PERL) $^ --outfile $@
66
67 install: all installdirs
68 $(INSTALL_PROGRAM) psql$(X) '$(DESTDIR)$(bindir)/psql$(X)'
69 $(INSTALL_DATA) $(srcdir)/psqlrc.sample '$(DESTDIR)$(datadir)/psqlrc.sample'
70
71 installdirs:
72 $(MKDIR_P) '$(DESTDIR)$(bindir)' '$(DESTDIR)$(datadir)'
73
74 uninstall:
75 rm -f '$(DESTDIR)$(bindir)/psql$(X)' '$(DESTDIR)$(datadir)/psqlrc.sample'
76
77 clean distclean:
78 rm -f psql$(X) $(OBJS) lex.backup
79 rm -rf tmp_check
80 rm -f sql_help.h sql_help.c psqlscanslash.c tab-complete.c
81
82 check:
83 $(prove_check)
84
85 installcheck:
86 $(prove_installcheck)