OSDN Git Service

Add copyright mentions, per Tom Lane.
[pg-rex/syncrep.git] / src / bin / pgtclsh / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for src/bin/pgtclsh
4 # (a tclsh workalike with pgtcl commands installed)
5 #
6 # Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
7 # Portions Copyright (c) 1994, Regents of the University of California
8 #
9 # $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.36 2001/02/18 18:34:01 momjian Exp $
10 #
11 #-------------------------------------------------------------------------
12
13 subdir = src/bin/pgtclsh
14 top_builddir = ../../..
15 include $(top_builddir)/src/Makefile.global
16
17 #
18 # Include definitions from the tclConfig.sh file
19 #
20 -include Makefile.tcldefs
21 ifeq ($(with_tk), yes)
22 -include Makefile.tkdefs
23 endif
24
25 libpgtcl_srcdir = $(top_srcdir)/src/interfaces/libpgtcl
26 libpgtcl_builddir = $(top_builddir)/src/interfaces/libpgtcl
27 libpgtcl = -L$(libpgtcl_builddir) -lpgtcl
28
29 override CPPFLAGS += -I$(libpgtcl_srcdir) $(TK_XINCLUDES)
30
31
32 # If we are here then Tcl is available
33 PROGRAMS = pgtclsh
34
35 # Add Tk targets if Tk is available
36 ifeq ($(with_tk), yes)
37 PROGRAMS += pgtksh
38 endif
39
40 all: submake $(PROGRAMS)
41
42 pgtclsh: pgtclAppInit.o
43         $(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpgtcl) $(libpq) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LIBS) -o $@
44
45 pgtksh: pgtkAppInit.o
46         $(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpgtcl) $(libpq) $(TK_LIB_SPEC) $(TK_LIBS) $(TCL_LIB_SPEC) $(LIBS) -o $@
47
48 .PHONY: submake
49 submake:
50         $(MAKE) -C $(libpgtcl_builddir) all
51
52 install: all installdirs
53         $(INSTALL_PROGRAM) pgtclsh $(DESTDIR)$(bindir)/pgtclsh
54 ifeq ($(with_tk), yes)
55         $(INSTALL_PROGRAM) pgtksh $(DESTDIR)$(bindir)/pgtksh
56 endif
57
58 installdirs:
59         $(mkinstalldirs) $(DESTDIR)$(bindir)
60
61 uninstall:
62         rm -f $(DESTDIR)$(bindir)/pgtclsh $(DESTDIR)$(bindir)/pgtksh
63
64 Makefile.tcldefs: mkMakefile.tcldefs.sh
65         $(SHELL) $< '$(TCL_CONFIG_SH)' '$@'
66
67 Makefile.tkdefs: mkMakefile.tkdefs.sh
68         $(SHELL) $< '$(TK_CONFIG_SH)' '$@'
69
70 clean distclean maintainer-clean:
71         rm -f pgtclAppInit.o pgtkAppInit.o Makefile.tcldefs Makefile.tkdefs pgtclsh pgtksh
72
73 dep depend:
74         $(CC) -MM $(CFLAGS) *.c > depend