]> granicus.if.org Git - postgresql/blob - src/bin/psql/Makefile.in
2768b4ee2759139365e171502029c5403547d97a
[postgresql] / src / bin / psql / Makefile.in
1 #-------------------------------------------------------------------------
2 #
3 # Makefile.in--
4 #    Makefile for bin/psql
5 #
6 # Copyright (c) 1994, Regents of the University of California
7 #
8 #
9 # IDENTIFICATION
10 #    $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.19 1999/11/27 19:43:20 tgl Exp $
11 #
12 #-------------------------------------------------------------------------
13
14 SRCDIR= ../..
15 include ../../Makefile.global
16
17 CFLAGS:= -I$(LIBPQDIR) $(CFLAGS)
18
19 #
20 # And where libpq goes, so goes the authentication stuff...
21 #
22 ifdef KRBVERS
23 LDFLAGS+= $(KRBLIBS)
24 CFLAGS+= $(KRBFLAGS)
25 endif
26
27 ifdef MULTIBYTE
28 CFLAGS+= $(MBFLAGS)
29 endif
30
31 OBJS=command.o common.o help.o input.o stringutils.o mainloop.o \
32         copy.o startup.o prompt.o variables.o large_obj.o print.o describe.o \
33         tab-complete.o
34
35 all: submake psql
36
37 ifneq (@STRDUP@,)
38 OBJS+=$(SRCDIR)/utils/strdup.o
39
40 $(SRCDIR)/utils/strdup.o:
41         $(MAKE) -C $(SRCDIR)/utils strdup.o
42 endif
43
44 # Move these to the utils directory?
45
46 ifneq (@STRERROR@,)
47 OBJS+=$(SRCDIR)/backend/port/strerror.o
48
49 $(SRCDIR)/backend/port/strerror.o:
50         $(MAKE) -C $(SRCDIR)/backend/port strerror.o
51 endif
52
53 ifneq (@SNPRINTF@,)
54 OBJS+=$(SRCDIR)/backend/port/snprintf.o
55
56 $(SRCDIR)/backend/port/snprintf.o:
57         $(MAKE) -C $(SRCDIR)/backend/port snprintf.o
58 endif
59
60 # End of hacks for picking up backend 'port' modules
61
62 psql: $(OBJS) $(LIBPQDIR)/libpq.a
63         $(CC) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LDFLAGS)
64
65 help.o: sql_help.h
66
67 ifneq ($(strip $(PERL)),) 
68 sql_help.h: $(wildcard $(SRCDIR)/../doc/src/sgml/ref/*.sgml) create_help.pl
69         $(PERL) create_help.pl sql_help.h 
70 else
71 sql_help.h:
72 endif
73
74 .PHONY: submake
75
76 submake:
77         $(MAKE) -C $(LIBPQDIR) libpq.a
78
79 install: psql
80         $(INSTALL) $(INSTL_EXE_OPTS) psql$(X) $(BINDIR)/psql$(X)
81
82 depend dep:
83         $(CC) -MM -MG $(CFLAGS) *.c >depend
84
85 clean: 
86         rm -f psql$(X) $(OBJS)
87
88 # Some people might get in trouble if they do a make clean and the
89 # sql_help.h is gone, for it needs the docs in the right place to be
90 # regenerated. -- (pe)
91
92 maintainer-clean: clean
93         rm -f sql_help.h
94
95 ifeq (depend,$(wildcard depend))
96 include depend
97 endif