OSDN Git Service

Whoops, redo Ultrix patch so the other ports still compile.
[pg-rex/syncrep.git] / src / bin / psql / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile.inc--
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/Makefile,v 1.15 1996/11/26 07:38:24 bryanh Exp $
11 #
12 #-------------------------------------------------------------------------
13
14 SRCDIR= ../..
15 include ../../Makefile.global
16
17 INCLUDE_OPT:= \
18                -I$(LIBPQDIR) \
19                -I../../include 
20
21 CFLAGS+= $(INCLUDE_OPT)
22 #
23 #USE_READLINE is set in Makefile.global
24
25
26 ifeq ($(USE_READLINE), true)
27    CFLAGS+= $(READLINE_INC) $(HISTORY_INC)
28
29    LIBCURSES=   -lcurses 
30    LD_ADD+= $(READLINE_LIB) $(HISTORY_LIB) $(LIBCURSES)
31
32    ifeq ($(PORTNAME), ultrix4)
33    LD_ADD+= -ltermcap
34    else
35    ifeq ($(PORTNAME), sparc)
36    LD_ADD+= -ltermcap
37    else
38    ifeq ($(PORTNAME), linux)
39    LD_ADD+= -ltermcap
40    else
41    ifeq ($(PORTNAME), next)
42    LD_ADD+= -ltermcap
43    else
44    ifeq ($(PORTNAME), bsdi)
45    LD_ADD+= -ltermcap
46    else
47    ifeq ($(PORTNAME), BSD44_derived)
48    LD_ADD+= -ltermcap
49    endif
50    endif
51    endif
52    endif
53    endif
54    endif
55 else
56    CFLAGS+= -DNOREADLINE
57 endif
58
59 OBJS= psql.o stringutils.o 
60
61 ifneq ($(USE_READLINE), true)
62 OBJS+= rlstubs.o
63 endif
64
65 ifeq ($(PORTNAME), ultrix4)
66 OBJS+= ../../utils/strdup.o
67 endif
68
69 all: submake psql
70
71 psql: $(OBJS) $(LIBPQDIR)/libpq.a
72         $(CC) $(LDFLAGS) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LD_ADD)
73
74 ../../utils/strdup.o:
75         $(MAKE) -C ../../utils strdup.o
76
77 .PHONY: submake
78 submake:
79         $(MAKE) -C $(LIBPQDIR) libpq.a
80
81 install: psql
82         $(INSTALL) $(INSTL_EXE_OPTS) psql $(DESTDIR)$(BINDIR)/psql
83
84 depend dep:
85         $(CC) -MM $(INCLUDE_OPT) *.c >depend
86
87 clean: 
88         rm -f psql $(OBJS) 
89
90 ifeq (depend,$(wildcard depend))
91 include depend
92 endif
93
94
95