aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/Makefile.in
blob: 4fa6a4f13717cabfb2a170e70a80f24fe1bade7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#-------------------------------------------------------------------------
#
# Makefile.in--
#    Makefile for bin/psql
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
#    $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.24 2000/05/11 17:46:35 momjian Exp $
#
#-------------------------------------------------------------------------

SRCDIR= ../..
include $(SRCDIR)/Makefile.global

DOCDIR= $(SRCDIR)/../doc/src/sgml/ref

CFLAGS+= -I$(LIBPQDIR)

#
# And where libpq goes, so goes the authentication stuff...
#
ifdef KRBVERS
LDFLAGS+= $(KRBLIBS)
CFLAGS+= $(KRBFLAGS)
endif

OBJS=command.o common.o help.o input.o stringutils.o mainloop.o \
	copy.o startup.o prompt.o variables.o large_obj.o print.o describe.o \
	tab-complete.o

all: submake psql

ifneq (@STRDUP@,)
OBJS+=$(SRCDIR)/utils/strdup.o

$(SRCDIR)/utils/strdup.o:
	$(MAKE) -C $(SRCDIR)/utils strdup.o
endif

# Move these to the utils directory?

ifneq (@STRERROR@,)
OBJS+=$(SRCDIR)/backend/port/strerror.o

$(SRCDIR)/backend/port/strerror.o:
	$(MAKE) -C $(SRCDIR)/backend/port strerror.o
endif

ifneq (@SNPRINTF@,)
OBJS+=$(SRCDIR)/backend/port/snprintf.o

$(SRCDIR)/backend/port/snprintf.o:
	$(MAKE) -C $(SRCDIR)/backend/port snprintf.o
endif

# End of hacks for picking up backend 'port' modules

psql: $(OBJS) $(LIBPQDIR)/libpq.a
	$(CC) $(CFLAGS) -o psql $(OBJS) $(LIBPQ) $(LDFLAGS)

help.o: sql_help.h

ifneq ($(strip $(PERL)),) 
sql_help.h: $(wildcard $(DOCDIR)/*.sgml) create_help.pl
	$(PERL) create_help.pl $(DOCDIR) sql_help.h 
else
sql_help.h:
	@echo "*** Perl is needed to build psql help."
endif

.PHONY: submake

submake:
	$(MAKE) -C $(LIBPQDIR) libpq.a

install: psql
	$(INSTALL) $(INSTL_EXE_OPTS) psql$(X) $(BINDIR)/psql$(X)

depend dep:
	$(CC) -MM -MG $(CFLAGS) *.c >depend

clean: 
	rm -f psql$(X) $(OBJS)

# Some people might get in trouble if they do a make clean and the
# sql_help.h is gone, for it needs the docs in the right place to be
# regenerated. -- (pe)

maintainer-clean: clean
	rm -f sql_help.h

ifeq (depend,$(wildcard depend))
include depend
endif