Makefile.in 1.6 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.17 1999/11/08 15:59:59 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 33
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 \
@STRDUP@ @STRERROR2@
34 35 36 37

all: submake psql

psql: $(OBJS) $(LIBPQDIR)/libpq.a
38
	$(CC) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LDFLAGS)
39 40 41 42

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

43 44 45 46 47 48
OBJS:
	$(CC) $(CFLAGS) -c $< -o $@

help.o: sql_help.h

ifneq ($(strip $(PERL)),) 
B
Bruce Momjian 已提交
49
sql_help.h: $(wildcard ../../../doc/src/sgml/ref/*.sgml) create_help.pl
50 51 52 53 54
	$(PERL) create_help.pl sql_help.h 
else
sql_help.h:
endif

55 56 57 58 59
.PHONY: submake
submake:
	$(MAKE) -C $(LIBPQDIR) libpq.a

install: psql
60
	$(INSTALL) $(INSTL_EXE_OPTS) psql$(X) $(BINDIR)/psql$(X)
61 62

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

clean: 
66 67 68 69 70 71 72 73
	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)

distclean: clean
	rm -f sql_help.h
74 75 76 77

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