1# $Id: Makefile.in 294 2011-09-19 00:54:29Z lbayuk $
2# Makefile for Pgtcl-ng
3# Customized from the Sample TEA (Tcl Extension Architecture) Makefile
4#========================================================================
5# Add additional lines to handle any additional AC_SUBST cases that
6# have been added in a customized configure script.
7#========================================================================
8
9LIBPG = @LIBPG@
10PG_INCLUDES = @PG_INCLUDES@
11PG_LIBS = @PG_LIBS@
12LIB_PGTCL_RUNTIME_DIR = @PG_LIB_DIR@
13LIB_RUNTIME_DIR     = $(libdir)
14DL_LIBS = @DL_LIBS@
15MATH_LIBS = @MATH_LIBS@
16
17#========================================================================
18# Nothing of the variables below this line should need to be changed.
19# Please check the TARGETS section below to make sure the make targets
20# are correct.
21#========================================================================
22
23#========================================================================
24# The names of the source files is defined in the configure script.
25# The object files are used for linking into the final library.
26# This will be used when a dist target is added to the Makefile.
27# It is not important to specify the directory, as long as it is the
28# $(srcdir) or in the generic, win or unix subdirectory.
29#========================================================================
30
31PKG_SOURCES	= @PKG_SOURCES@
32PKG_OBJECTS	= @PKG_OBJECTS@
33
34PKG_STUB_SOURCES = @PKG_STUB_SOURCES@
35PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@
36
37#========================================================================
38# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
39# this package that need to be installed, if any.
40#========================================================================
41
42PKG_TCL_SOURCES = @PKG_TCL_SOURCES@
43
44#========================================================================
45# This is a list of public header files to be installed, if any.
46#========================================================================
47
48PKG_HEADERS	= @PKG_HEADERS@
49
50#========================================================================
51# "PKG_LIB_FILE" refers to the library (dynamic or static as per
52# configuration options) composed of the named objects.
53#========================================================================
54
55PKG_LIB_FILE	= @PKG_LIB_FILE@
56PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@
57
58lib_BINARIES	= $(PKG_LIB_FILE)
59BINARIES	= $(lib_BINARIES)
60
61SHELL		= @SHELL@
62
63srcdir		= @srcdir@
64prefix		= @prefix@
65exec_prefix	= @exec_prefix@
66
67datarootdir = @datarootdir@
68bindir		= @bindir@
69libdir		= @libdir@
70datadir		= @datadir@
71mandir		= @mandir@
72includedir	= @includedir@
73
74DESTDIR		=
75
76PKG_DIR		= $(PACKAGE_NAME)$(PACKAGE_VERSION)
77pkgdatadir	= $(datadir)/$(PKG_DIR)
78pkglibdir	= $(libdir)/$(PKG_DIR)
79pkgincludedir	= $(includedir)/$(PKG_DIR)
80
81top_builddir	= .
82
83INSTALL		= @INSTALL@
84INSTALL_PROGRAM	= @INSTALL_PROGRAM@
85INSTALL_DATA	= @INSTALL_DATA@
86INSTALL_SCRIPT	= @INSTALL_SCRIPT@
87
88PACKAGE_NAME	= @PACKAGE_NAME@
89PACKAGE_VERSION	= @PACKAGE_VERSION@
90CC		= @CC@
91CFLAGS_DEFAULT	= @CFLAGS_DEFAULT@
92CFLAGS_WARNING	= @CFLAGS_WARNING@
93CLEANFILES	= @CLEANFILES@
94EXEEXT		= @EXEEXT@
95LDFLAGS_DEFAULT	= @LDFLAGS_DEFAULT@
96MAKE_LIB	= @MAKE_LIB@ @LD_SEARCH_FLAGS@
97MAKE_SHARED_LIB	= @MAKE_SHARED_LIB@
98MAKE_STATIC_LIB	= @MAKE_STATIC_LIB@
99MAKE_STUB_LIB	= @MAKE_STUB_LIB@
100OBJEXT		= @OBJEXT@
101RANLIB		= @RANLIB@
102RANLIB_STUB	= @RANLIB_STUB@
103SHLIB_CFLAGS	= @SHLIB_CFLAGS@
104SHLIB_LD	= @SHLIB_LD@
105SHLIB_LD_LIBS   = @SHLIB_LD_LIBS@ $(PG_LIBS) $(TCL_LIBS)
106STLIB_LD	= @STLIB_LD@
107#TCL_DEFS	= @TCL_DEFS@
108TCL_BIN_DIR	= @TCL_BIN_DIR@
109TCL_SRC_DIR	= @TCL_SRC_DIR@
110#TK_BIN_DIR	= @TK_BIN_DIR@
111#TK_SRC_DIR	= @TK_SRC_DIR@
112
113TCL_LIBS	= @TCL_LIBS@
114
115
116#========================================================================
117# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
118# package without installing.  The other environment variables allow us
119# to test against an uninstalled Tcl.  Add special env vars that you
120# require for testing here (like TCLX_LIBRARY).
121#========================================================================
122
123EXTRA_PATH	= $(top_builddir):$(TCL_BIN_DIR)
124TCLLIBPATH	= $(top_builddir)
125TCLSH_ENV	= TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \
126		  @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
127		  PATH="$(EXTRA_PATH):$(PATH)" \
128		  TCLLIBPATH="$(TCLLIBPATH)"
129
130TCLSH_PROG	= @TCLSH_PROG@
131TCLSH	= $(TCLSH_ENV) $(TCLSH_PROG)
132SHARED_BUILD	= @SHARED_BUILD@
133
134INCLUDES	= @PKG_INCLUDES@ $(PG_INCLUDES) @TCL_INCLUDES@
135
136PKG_CFLAGS	= @PKG_CFLAGS@
137
138# TCL_DEFS is not strictly need here, but if you remove it, then you
139# must make sure that configure.in checks for the necessary components
140# that your library may use.  TCL_DEFS can actually be a problem if
141# you do not compile with a similar machine setup as the Tcl core was
142# compiled with.
143#DEFS		= $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS)
144DEFS		= @DEFS@ $(PKG_CFLAGS)
145
146CONFIG_CLEAN_FILES = Makefile
147
148CPPFLAGS	= @CPPFLAGS@
149LIBS		= @PKG_LIBS@ @LIBS@
150AR		= @AR@
151CFLAGS		= @CFLAGS@
152COMPILE		= $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
153
154#========================================================================
155# Start of user-definable TARGETS section
156#========================================================================
157
158#========================================================================
159# TEA TARGETS.  Please note that the "libraries:" target refers to platform
160# independent files, and the "binaries:" target inclues executable programs and
161# platform-dependent libraries.  Modify these targets so that they install
162# the various pieces of your package.  The make and install rules
163# for the BINARIES that you specified above have already been done.
164#========================================================================
165
166all: binaries
167
168#========================================================================
169# The binaries target builds executable programs, Windows .dll's, unix
170# shared/static libraries, and any other platform-dependent files.
171# The list of targets to build for "binaries:" is specified at the top
172# of the Makefile, in the "BINARIES" variable.
173#========================================================================
174
175binaries: $(BINARIES)
176
177libraries:
178
179
180#========================================================================
181# Your doc target should differentiate from doc builds (by the developer)
182# and doc installs (see install-doc), which just install the docs on the
183# end user machine when building from source.
184#========================================================================
185
186doc:
187	@echo "If you have documentation to create, place the commands to"
188	@echo "build the docs in the 'doc:' target.  For example:"
189	@echo "        xml2nroff sample.xml > sample.n"
190	@echo "        xml2html sample.xml > sample.html"
191
192install: all install-binaries install-libraries
193
194install-binaries: binaries install-lib-binaries install-bin-binaries
195
196#========================================================================
197# This rule installs platform-independent files, such as header files.
198# The list=...; for p in $$list handles the empty list case x-platform.
199#========================================================================
200
201install-libraries: libraries
202	@mkdir -p $(DESTDIR)$(includedir)
203	@echo "Installing header files in $(DESTDIR)$(includedir)"
204	@list='$(PKG_HEADERS)'; for i in $$list; do \
205	    echo "Installing $(srcdir)/$$i" ; \
206	    $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \
207	done;
208
209#========================================================================
210# Install documentation.  Unix manpages should go in the $(mandir)
211# directory.
212#========================================================================
213
214install-doc: doc
215	@mkdir -p $(DESTDIR)$(mandir)/mann
216	@echo "Installing documentation in $(DESTDIR)$(mandir)"
217	@list='$(srcdir)/doc/*.n'; for i in $$list; do \
218	    echo "Installing $$i"; \
219	    rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \
220	    $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \
221	done
222
223test: binaries libraries
224	$(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS)
225
226shell: binaries libraries
227	@$(TCLSH) $(SCRIPT)
228
229gdb:
230	$(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT)
231
232depend:
233
234#========================================================================
235# $(PKG_LIB_FILE) should be listed as part of the BINARIES variable
236# mentioned above.  That will ensure that this target is built when you
237# run "make binaries".
238#
239# The $(PKG_OBJECTS) objects are created and linked into the final
240# library.  In most cases these object files will correspond to the
241# source files above.
242#========================================================================
243
244$(PKG_LIB_FILE): $(PKG_OBJECTS)
245	-rm -f $(PKG_LIB_FILE)
246	${MAKE_LIB}
247	$(RANLIB) $(PKG_LIB_FILE)
248
249$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
250	-rm -f $(PKG_STUB_LIB_FILE)
251	${MAKE_STUB_LIB}
252	$(RANLIB_STUB) $(PKG_STUB_LIB_FILE)
253
254#========================================================================
255# We need to enumerate the list of .c to .o lines here.
256#
257# In the following lines, $(srcdir) refers to the toplevel directory
258# containing your extension.  If your sources are in a subdirectory,
259# you will have to modify the paths to reflect this:
260#
261# sample.$(OBJEXT): $(srcdir)/generic/sample.c
262# 	$(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@
263#
264# Setting the VPATH variable to a list of paths will cause the makefile
265# to look into these paths when resolving .c to .obj dependencies.
266# As necessary, add $(srcdir):$(srcdir)/compat:....
267#========================================================================
268
269VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win
270
271.c.@OBJEXT@:
272	$(COMPILE) -c `@CYGPATH@ $<` -o $@
273
274#========================================================================
275# Distribution creation
276# You may need to tweak this target to make it work correctly.
277#========================================================================
278
279COMPRESS	= tar -cvzf $(PKG_DIR).tar.gz $(PKG_DIR)
280DIST_ROOT	= /tmp/dist
281DIST_DIR	= $(DIST_ROOT)/$(PKG_DIR)
282
283dist-clean:
284	rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*
285
286dist: dist-clean
287	mkdir -p $(DIST_DIR)
288	cp -p $(srcdir)/ChangeLog* $(srcdir)/README* $(srcdir)/COPYRIGHT* \
289		$(srcdir)/INSTALL $(srcdir)/NEWS \
290		$(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \
291		$(srcdir)/*.mak \
292		$(DIST_DIR)/
293	chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4
294	chmod 664 $(DIST_DIR)/*.mak
295	chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in
296
297	for i in $(srcdir)/*.[ch] $(srcdir)/*.rc; do \
298	    if [ -f $$i ]; then \
299		cp -p $$i $(DIST_DIR)/ ; \
300	    fi; \
301	done;
302
303	mkdir $(DIST_DIR)/tclconfig
304	cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \
305		$(srcdir)/tclconfig/ChangeLog $(srcdir)/tclconfig/README* \
306		$(DIST_DIR)/tclconfig/
307	chmod 664 $(DIST_DIR)/tclconfig/tcl.m4
308	chmod +x $(DIST_DIR)/tclconfig/install-sh
309
310	mkdir $(DIST_DIR)/patches
311	cp $(srcdir)/patches/README $(srcdir)/patches/*.txt \
312		$(DIST_DIR)/patches/
313	chmod 664 $(DIST_DIR)/patches/*
314
315	list='demos doc extra generic library mac tests unix win'; \
316	for p in $$list; do \
317	    if test -d $(srcdir)/$$p ; then \
318		mkdir $(DIST_DIR)/$$p; \
319		cp -p $(srcdir)/$$p/Makefile $(srcdir)/$$p/README* \
320			$(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \
321	    fi; \
322	done
323
324	(cd $(DIST_ROOT); $(COMPRESS);)
325
326#========================================================================
327# End of user-definable section
328#========================================================================
329
330#========================================================================
331# Don't modify the file to clean here.  Instead, set the "CLEANFILES"
332# variable in configure.in
333#========================================================================
334
335clean:
336	-test -z "$(BINARIES)" || rm -f $(BINARIES)
337	-rm -f *.$(OBJEXT) core *.core
338	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
339
340distclean: clean
341	-rm -f *.tab.c
342	-rm -f $(CONFIG_CLEAN_FILES)
343	-rm -f config.cache config.log config.status
344
345#========================================================================
346# Install binary object libraries.  On Windows this includes both .dll and
347# .lib files.  Because the .lib files are not explicitly listed anywhere,
348# we need to deduce their existence from the .dll file of the same name.
349# Library files go into the lib directory.
350# In addition, this will generate the pkgIndex.tcl
351# file in the install location (assuming it can find a usable tclsh shell)
352#
353# You should not have to modify this target.
354#========================================================================
355
356install-lib-binaries: binaries
357	@mkdir -p $(DESTDIR)$(pkglibdir)
358	@list='$(lib_BINARIES)'; for p in $$list; do \
359	  if test -f $$p; then \
360	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
361	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \
362	    stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \
363	    if test "x$$stub" = "xstub"; then \
364		echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \
365		$(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \
366	    else \
367		echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \
368		$(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \
369	    fi; \
370	    ext=`echo $$p|sed -e "s/.*\.//"`; \
371	    if test "x$$ext" = "xdll"; then \
372		lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
373		if test -f $$lib; then \
374		    echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \
375	            $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \
376		fi; \
377	    fi; \
378	  fi; \
379	done
380	@list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
381	  if test -f $(srcdir)/$$p; then \
382	    destp=`basename $$p`; \
383	    echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \
384	    $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \
385	  fi; \
386	done
387	@if test "x$(SHARED_BUILD)" = "x1"; then \
388	    echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \
389	    $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \
390	fi
391
392#========================================================================
393# Install binary executables (e.g. .exe files and dependent .dll files)
394# This is for files that must go in the bin directory (located next to
395# wish and tclsh), like dependent .dll files on Windows.
396#
397# You should not have to modify this target, except to define bin_BINARIES
398# above if necessary.
399#========================================================================
400
401install-bin-binaries: binaries
402	@mkdir -p $(DESTDIR)$(bindir)
403	@list='$(bin_BINARIES)'; for p in $$list; do \
404	  if test -f $$p; then \
405	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
406	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
407	  fi; \
408	done
409
410.SUFFIXES: .c .$(OBJEXT)
411
412Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
413	cd $(top_builddir) \
414	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
415
416uninstall-binaries:
417	list='$(lib_BINARIES)'; for p in $$list; do \
418	  rm -f $(DESTDIR)$(pkglibdir)/$$p; \
419	done
420	list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
421	  p=`basename $$p`; \
422	  rm -f $(DESTDIR)$(pkglibdir)/$$p; \
423	done
424	list='$(bin_BINARIES)'; for p in $$list; do \
425	  rm -f $(DESTDIR)$(bindir)/$$p; \
426	done
427
428.PHONY: all binaries clean depend distclean doc install libraries test
429
430# Tell versions [3.59,3.63) of GNU make to not export all variables.
431# Otherwise a system limit (for SysV at least) may be exceeded.
432.NOEXPORT:
433