|
7 | 7 | #
|
8 | 8 | #
|
9 | 9 | # IDENTIFICATION
|
10 |
| -# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.7 1996/11/01 01:46:55 momjian Exp $ |
| 10 | +# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.8 1996/11/02 09:53:15 bryanh Exp $ |
11 | 11 | #
|
12 | 12 | #-------------------------------------------------------------------------
|
13 | 13 |
|
14 |
| -PROG= psql |
| 14 | +SRCDIR = ../.. |
| 15 | +LIBPQDIR = $(SRCDIR)/libpq |
| 16 | +include ../../Makefile.global |
15 | 17 |
|
16 |
| -MKDIR= ../../mk |
17 |
| -include $(MKDIR)/postgres.mk |
18 |
| -include ../Makefile.global |
| 18 | +INCLUDE_OPT := \ |
| 19 | + -I$(LIBPQDIR) \ |
| 20 | + -I$(SRCDIR)/include |
19 | 21 |
|
| 22 | +CFLAGS += $(INCLUDE_OPT) |
20 | 23 | #
|
21 | 24 | #USE_READLINE is set in Makefile.global
|
22 | 25 | #
|
23 | 26 |
|
24 | 27 | ifeq ($(USE_READLINE), true)
|
25 | 28 | CFLAGS += $(READLINE_INC) $(HISTORY_INC)
|
26 | 29 |
|
27 |
| -# if you are using an older readline that uses #include "readline.h" instead |
28 |
| -# of #include <readline/readline.h>, |
29 |
| -# uncomment this |
30 |
| -# CFLAGS += -DOLD_READLINE |
31 |
| - |
32 | 30 | LIBCURSES= -lcurses
|
33 | 31 | LD_ADD += $(READLINE_LIB) $(HISTORY_LIB) $(LIBCURSES)
|
34 | 32 |
|
|
59 | 57 | CFLAGS += -DNOREADLINE
|
60 | 58 | endif
|
61 | 59 |
|
62 |
| -SRCS= psql.c stringutils.c |
| 60 | +OBJS= psql.o stringutils.o |
63 | 61 |
|
64 | 62 | ifneq ($(USE_READLINE), true)
|
65 |
| -SRCS+= rlstubs.c |
| 63 | +OBJS+= rlstubs.o |
66 | 64 | endif
|
67 | 65 |
|
68 |
| -include $(MKDIR)/postgres.prog.mk |
| 66 | +all: psql |
| 67 | + |
| 68 | +psql: $(OBJS) $(LIBPQDIR)/libpq.a |
| 69 | + $(CC) $(LDFLAGS) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LD_ADD) |
| 70 | + |
| 71 | +$(srcdir)/libpq/libpq.a: |
| 72 | + $(MAKE) -C $(LIBPQDIR) libpq.a |
| 73 | + |
| 74 | +install: |
| 75 | + $(INSTALL) $(INSTL_EXE_OPTS) psql $(DESTDIR)$(BINDIR)/psql |
69 | 76 |
|
| 77 | +depend dep: |
| 78 | + $(CC) -MM $(INCLUDE_OPT) *.c >depend |
| 79 | + |
| 80 | +clean: |
| 81 | + rm -f psql $(OBJS) |
| 82 | + |
| 83 | +ifeq (depend,$(wildcard depend)) |
| 84 | +include depend |
| 85 | +endif |
70 | 86 |
|
71 | 87 |
|
72 | 88 |
|
0 commit comments