1 #-------------------------------------------------------------------------
3 # Makefile for src/bin/pgtclsh
4 # (a tclsh workalike with pgtcl commands installed)
6 # Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
7 # Portions Copyright (c) 1994, Regents of the University of California
9 # $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.36 2001/02/18 18:34:01 momjian Exp $
11 #-------------------------------------------------------------------------
13 subdir = src/bin/pgtclsh
14 top_builddir = ../../..
15 include $(top_builddir)/src/Makefile.global
18 # Include definitions from the tclConfig.sh file
20 -include Makefile.tcldefs
21 ifeq ($(with_tk), yes)
22 -include Makefile.tkdefs
25 libpgtcl_srcdir = $(top_srcdir)/src/interfaces/libpgtcl
26 libpgtcl_builddir = $(top_builddir)/src/interfaces/libpgtcl
27 libpgtcl = -L$(libpgtcl_builddir) -lpgtcl
29 override CPPFLAGS += -I$(libpgtcl_srcdir) $(TK_XINCLUDES)
32 # If we are here then Tcl is available
35 # Add Tk targets if Tk is available
36 ifeq ($(with_tk), yes)
40 all: submake $(PROGRAMS)
42 pgtclsh: pgtclAppInit.o
43 $(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpgtcl) $(libpq) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LIBS) -o $@
46 $(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpgtcl) $(libpq) $(TK_LIB_SPEC) $(TK_LIBS) $(TCL_LIB_SPEC) $(LIBS) -o $@
50 $(MAKE) -C $(libpgtcl_builddir) all
52 install: all installdirs
53 $(INSTALL_PROGRAM) pgtclsh $(DESTDIR)$(bindir)/pgtclsh
54 ifeq ($(with_tk), yes)
55 $(INSTALL_PROGRAM) pgtksh $(DESTDIR)$(bindir)/pgtksh
59 $(mkinstalldirs) $(DESTDIR)$(bindir)
62 rm -f $(DESTDIR)$(bindir)/pgtclsh $(DESTDIR)$(bindir)/pgtksh
64 Makefile.tcldefs: mkMakefile.tcldefs.sh
65 $(SHELL) $< '$(TCL_CONFIG_SH)' '$@'
67 Makefile.tkdefs: mkMakefile.tkdefs.sh
68 $(SHELL) $< '$(TK_CONFIG_SH)' '$@'
70 clean distclean maintainer-clean:
71 rm -f pgtclAppInit.o pgtkAppInit.o Makefile.tcldefs Makefile.tkdefs pgtclsh pgtksh
74 $(CC) -MM $(CFLAGS) *.c > depend