2000-06-27 02:32:06 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile for src/bin/psql
|
|
|
|
#
|
2005-01-01 21:44:34 +01:00
|
|
|
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
2001-02-18 19:34:02 +01:00
|
|
|
# Portions Copyright (c) 1994, Regents of the University of California
|
2000-06-27 02:32:06 +02:00
|
|
|
#
|
2005-12-09 22:19:36 +01:00
|
|
|
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.55 2005/12/09 21:19:35 petere Exp $
|
2000-06-27 02:32:06 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2004-10-05 21:30:25 +02:00
|
|
|
PGFILEDESC = "psql - the PostgreSQL interactive terminal"
|
|
|
|
PGAPPICON=win32
|
2000-06-27 02:32:06 +02:00
|
|
|
subdir = src/bin/psql
|
|
|
|
top_builddir = ../../..
|
2000-08-31 18:12:35 +02:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref
|
|
|
|
|
2005-05-24 18:45:23 +02:00
|
|
|
override CPPFLAGS := -DFRONTEND -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2003-08-08 06:52:22 +02:00
|
|
|
OBJS= command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
|
2002-07-15 23:34:05 +02:00
|
|
|
startup.o prompt.o variables.o large_obj.o print.o describe.o \
|
2004-10-05 21:30:25 +02:00
|
|
|
psqlscan.o tab-complete.o mbprint.o $(WIN32RES)
|
2004-02-19 20:40:09 +01:00
|
|
|
|
|
|
|
FLEXFLAGS = -Cfe
|
|
|
|
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2002-07-27 22:10:05 +02:00
|
|
|
all: submake-libpq submake-libpgport psql
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2000-11-30 21:36:13 +01:00
|
|
|
psql: $(OBJS) $(libpq_builddir)/libpq.a
|
2005-03-25 19:17:14 +01:00
|
|
|
$(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
help.o: $(srcdir)/sql_help.h
|
|
|
|
|
|
|
|
ifdef PERL
|
|
|
|
$(srcdir)/sql_help.h: create_help.pl $(wildcard $(REFDOCDIR)/*.sgml)
|
|
|
|
$(PERL) $< $(REFDOCDIR) $@
|
|
|
|
else
|
|
|
|
$(srcdir)/sql_help.h:
|
|
|
|
@echo "*** Perl is needed to build psql help."
|
|
|
|
endif
|
|
|
|
|
2004-02-19 20:40:09 +01:00
|
|
|
$(srcdir)/psqlscan.c: psqlscan.l
|
|
|
|
ifdef FLEX
|
|
|
|
$(FLEX) $(FLEXFLAGS) -o'$@' $<
|
|
|
|
else
|
|
|
|
@$(missing) flex $< $@
|
|
|
|
endif
|
|
|
|
|
2004-03-09 20:47:05 +01:00
|
|
|
distprep: $(srcdir)/sql_help.h $(srcdir)/psqlscan.c
|
2000-07-19 18:30:27 +02:00
|
|
|
|
2000-06-27 02:32:06 +02:00
|
|
|
install: all installdirs
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_PROGRAM) psql$(X) '$(DESTDIR)$(bindir)/psql$(X)'
|
|
|
|
$(INSTALL_DATA) $(srcdir)/psqlrc.sample '$(DESTDIR)$(datadir)/psqlrc.sample'
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
installdirs:
|
2005-12-09 22:19:36 +01:00
|
|
|
$(mkinstalldirs) '$(DESTDIR)$(bindir)'
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
uninstall:
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -f '$(DESTDIR)$(bindir)/psql$(X)' '$(DESTDIR)$(datadir)/psqlrc.sample'
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2004-02-19 20:40:09 +01:00
|
|
|
# psqlscan.c is in the distribution tarball, so is not cleaned here
|
2000-06-27 02:32:06 +02:00
|
|
|
clean distclean:
|
2004-10-04 15:43:59 +02:00
|
|
|
rm -f psql$(X) $(OBJS)
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
maintainer-clean: distclean
|
2004-02-19 20:40:09 +01:00
|
|
|
rm -f $(srcdir)/sql_help.h $(srcdir)/psqlscan.c
|