Makefile.in 1.8 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.18 1999/11/26 04:24:16 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

M
 
Marc G. Fournier 已提交
27 28
ifdef MULTIBYTE
CFLAGS+= $(MBFLAGS)
29 30
endif

31 32
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 \
33
tab-complete.o @STRDUP@ @STRERROR2@ @SNPRINTF@
34 35 36

all: submake psql

37 38 39 40 41 42 43 44
# Move this to the utils directory
ifneq (@SNPRINTF@,)
OBJS+=../../backend/port/snprintf.o

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

45
psql: $(OBJS) $(LIBPQDIR)/libpq.a
46
	$(CC) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LDFLAGS)
47 48 49 50

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

51 52 53 54 55 56
OBJS:
	$(CC) $(CFLAGS) -c $< -o $@

help.o: sql_help.h

ifneq ($(strip $(PERL)),) 
B
Bruce Momjian 已提交
57
sql_help.h: $(wildcard ../../../doc/src/sgml/ref/*.sgml) create_help.pl
58 59 60 61 62
	$(PERL) create_help.pl sql_help.h 
else
sql_help.h:
endif

63 64 65 66 67
.PHONY: submake
submake:
	$(MAKE) -C $(LIBPQDIR) libpq.a

install: psql
68
	$(INSTALL) $(INSTL_EXE_OPTS) psql$(X) $(BINDIR)/psql$(X)
69 70

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

clean: 
74 75 76 77 78 79
	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)

80
maintainer-clean: clean
81
	rm -f sql_help.h
82 83 84 85

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