Makefile.in 2.0 KB
Newer Older
1 2
#-------------------------------------------------------------------------
#
3
# Makefile.in--
4 5 6 7 8 9
#    Makefile for bin/psql
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
B
Bruce Momjian 已提交
10
#    $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.24 2000/05/11 17:46:35 momjian Exp $
11 12 13 14
#
#-------------------------------------------------------------------------

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

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

CFLAGS+= -I$(LIBPQDIR)
20

21 22 23 24 25 26 27 28
#
# And where libpq goes, so goes the authentication stuff...
#
ifdef KRBVERS
LDFLAGS+= $(KRBLIBS)
CFLAGS+= $(KRBFLAGS)
endif

29
OBJS=command.o common.o help.o input.o stringutils.o mainloop.o \
30 31
	copy.o startup.o prompt.o variables.o large_obj.o print.o describe.o \
	tab-complete.o
32 33 34

all: submake psql

35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
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

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

54 55
$(SRCDIR)/backend/port/snprintf.o:
	$(MAKE) -C $(SRCDIR)/backend/port snprintf.o
56 57
endif

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

60
psql: $(OBJS) $(LIBPQDIR)/libpq.a
B
Bruce Momjian 已提交
61
	$(CC) $(CFLAGS) -o psql $(OBJS) $(LIBPQ) $(LDFLAGS)
62

63 64 65
help.o: sql_help.h

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

73
.PHONY: submake
74

75 76 77 78
submake:
	$(MAKE) -C $(LIBPQDIR) libpq.a

install: psql
79
	$(INSTALL) $(INSTL_EXE_OPTS) psql$(X) $(BINDIR)/psql$(X)
80 81

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

clean: 
85 86 87 88 89 90
	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)

91
maintainer-clean: clean
92
	rm -f sql_help.h
93 94 95 96

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