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
10
#    $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.21 2000/03/08 01:58:22 momjian Exp $
11 12 13 14 15 16
#
#-------------------------------------------------------------------------

SRCDIR= ../..
include ../../Makefile.global

B
Bruce Momjian 已提交
17
CFLAGS:= -I$(LIBPQDIR) $(CFLAGS)
18

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

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

all: submake psql

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

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

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

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

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

61 62 63
help.o: sql_help.h

ifneq ($(strip $(PERL)),) 
64
sql_help.h: $(wildcard $(SRCDIR)/../doc/src/sgml/ref/*.sgml) create_help.pl
65 66 67 68 69
	$(PERL) create_help.pl sql_help.h 
else
sql_help.h:
endif

70
.PHONY: submake
71

72 73 74 75
submake:
	$(MAKE) -C $(LIBPQDIR) libpq.a

install: psql
76
	$(INSTALL) $(INSTL_EXE_OPTS) psql$(X) $(BINDIR)/psql$(X)
77 78

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

clean: 
82 83 84 85 86 87
	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)

88
maintainer-clean: clean
89
	rm -f sql_help.h
90 91 92 93

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