|
4 | 4 | # Makefile for the pltcl shared object
|
5 | 5 | #
|
6 | 6 | # IDENTIFICATION
|
7 |
| -# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.7 1998/10/13 16:30:49 momjian Exp $ |
| 7 | +# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.8 1998/10/17 23:33:23 tgl Exp $ |
8 | 8 | #
|
9 | 9 | #-------------------------------------------------------------------------
|
10 | 10 |
|
|
14 | 14 | SRCDIR= ../../../src
|
15 | 15 | include $(SRCDIR)/Makefile.global
|
16 | 16 |
|
17 |
| - |
18 | 17 | #
|
19 | 18 | # Include definitions from the tclConfig.sh file
|
| 19 | +# NOTE: GNU make will make this file automatically if it doesn't exist, |
| 20 | +# using the make rule that appears below. Cute, eh? |
20 | 21 | #
|
21 | 22 | include Makefile.tcldefs
|
22 | 23 |
|
| 24 | +# |
| 25 | +# Find out whether Tcl was built as a shared library --- if not, |
| 26 | +# we can't link a shared library that depends on it, and have to |
| 27 | +# forget about building pltcl. |
| 28 | +# In Tcl 8, tclConfig.sh sets TCL_SHARED_BUILD for us, but in |
| 29 | +# older Tcl releases it doesn't. In that case we guess based on |
| 30 | +# the name of the Tcl library. |
| 31 | +# |
| 32 | +ifndef TCL_SHARED_BUILD |
| 33 | +ifneq (,$(findstring $(DLSUFFIX),$(TCL_LIB_FILE))) |
| 34 | +TCL_SHARED_BUILD=1 |
| 35 | +else |
| 36 | +TCL_SHARED_BUILD=0 |
| 37 | +endif |
| 38 | +endif |
| 39 | + |
| 40 | + |
23 | 41 | # Change following to how shared library that contain
|
24 | 42 | # correct references to libtcl must get built on your system.
|
25 | 43 | # Since these definitions come from the tclConfig.sh script,
|
@@ -62,22 +80,43 @@ ifdef EXPSUFF
|
62 | 80 | INFILES+= $(DLOBJS:.o=$(EXPSUFF))
|
63 | 81 | endif
|
64 | 82 |
|
| 83 | + |
| 84 | +ifeq ($(TCL_SHARED_BUILD),1) |
| 85 | + |
65 | 86 | #
|
66 | 87 | # Build the shared lib
|
67 | 88 | #
|
68 | 89 | all: $(INFILES)
|
69 | 90 |
|
70 |
| -Makefile.tcldefs: |
| 91 | +install: all |
| 92 | + $(INSTALL) $(INSTL_LIB_OPTS) $(DLOBJS) $(LIBDIR)/$(DLOBJS) |
| 93 | + |
| 94 | +else |
| 95 | + |
| 96 | +# |
| 97 | +# Oops, can't build it |
| 98 | +# |
| 99 | +all: |
| 100 | + @echo "Cannot build pltcl because Tcl is not a shared library; skipping it." |
| 101 | + |
| 102 | +install: |
| 103 | + @echo "Cannot build pltcl because Tcl is not a shared library; skipping it." |
| 104 | + |
| 105 | +endif |
| 106 | + |
| 107 | +# |
| 108 | +# Make targets that are still valid when we can't build pltcl |
| 109 | +# should be below here. |
| 110 | +# |
| 111 | + |
| 112 | +Makefile.tcldefs: mkMakefile.tcldefs.sh |
71 | 113 | /bin/sh mkMakefile.tcldefs.sh
|
72 | 114 |
|
73 | 115 | #
|
74 | 116 | # Clean
|
75 | 117 | #
|
76 | 118 | clean:
|
77 |
| - rm -f $(INFILES) |
| 119 | + rm -f $(INFILES) *.o |
78 | 120 | rm -f Makefile.tcldefs
|
79 | 121 |
|
80 |
| -install: all |
81 |
| - $(INSTALL) $(INSTL_LIB_OPTS) $(DLOBJS) $(LIBDIR)/$(DLOBJS) |
82 |
| - |
83 | 122 | dep depend:
|
0 commit comments