1 # Copyright (C) 1993, 1995, 1997 Free Software Foundation
3 # This file is part of the GNU IO Library. This library is free
4 # software; you can redistribute it and/or modify it under the
5 # terms of the GNU General Public License as published by the
6 # Free Software Foundation; either version 2, or (at your option)
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with GNU CC; see the file COPYING. If not, write to
16 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 # Significant variables:
20 # Note that TO_TOPDIR does *not* include multilib.
21 test -z "${TO_TOPDIR}" && TO_TOPDIR=${TOLIBGXX}../
22 # Native configurations build target libraries in directories at the same
23 # level as the rest of the tree. Cross configurations build target libraries
24 # one level deeper. TO_REAL_TOPDIR accounts for this.
25 # Obviously, TO_REAL_TOPDIR can only be used in the build tree.
26 if [ "${with_target_subdir}" != "." ] ; then
27 TO_REAL_TOPDIR="${TO_TOPDIR}../"
29 TO_REAL_TOPDIR="${TO_TOPDIR}"
31 DOING_LIBGXX=${DOING_LIBGXX-false}
32 THIS_FILE="${srcdir}/${TOLIBGXX}config.shared"
34 echo "# Start of package fragment generated by ${THIS_FILE}."
39 echo 'MULTIBUILDTOP ='
43 echo 'MULTICLEAN = true'
51 # SUBDIRS [defaults to (configdirs)]
52 # INFO_FILES List of (basenames of) texinfo files
53 # INFO_SUBDIRS [default: empty] sub-directories containing documentation
55 # ??? This doesn't appear to be used by us or any of our callers.
56 # Note that all uses in this file are single-quoted.
57 rootme=${rootme-`pwd`}
59 # libg++ uses the convention that $rootme includes a trailing '/'.
60 # We use that in the definition of TOPDIR. $rootme is either empty
61 # or an absolute pathname to the current directory (with trailing '/').
62 TOPDIR=${TOPDIR-'$${rootme}$(MULTIBUILDTOP)'${TO_REAL_TOPDIR}}
63 echo '#' TOPDIR="${TOPDIR} invsubdir=${invsubdir} subdir=${subdir}"
64 SUBDIRS=${SUBDIRS-${configdirs}}
65 CHECK_SUBDIRS=${CHECK_SUBDIRS-${SUBDIRS}}
67 echo "srcdir = ${srcdir}"
68 echo "SUBDIRS = ${SUBDIRS}"
69 echo "CHECK_SUBDIRS = ${CHECK_SUBDIRS}"
71 echo "prefix = ${prefix-/usr/local}"
72 echo "exec_prefix = ${exec_prefix-'${prefix}'}"
74 echo 'bindir = $(exec_prefix)/bin'
75 echo 'libdir = $(exec_prefix)/lib'
77 echo 'datadir = $(prefix)/lib'
78 echo 'mandir = $(prefix)/man'
79 echo 'man1dir = $(mandir)/man1'
80 echo 'man2dir = $(mandir)/man2'
81 echo 'man3dir = $(mandir)/man3'
82 echo 'man4dir = $(mandir)/man4'
83 echo 'man5dir = $(mandir)/man5'
84 echo 'man6dir = $(mandir)/man6'
85 echo 'man7dir = $(mandir)/man7'
86 echo 'man8dir = $(mandir)/man8'
87 echo 'man9dir = $(mandir)/man9'
89 echo 'infodir = $(prefix)/info'
90 echo 'includedir = $(prefix)/include'
91 echo 'gxx_includedir = $(includedir)/g++'
92 echo 'docdir = $(datadir)/doc'
94 echo 'SHELL = /bin/sh'
97 /*) echo 'INSTALL = $(srcdir)'/"${TO_TOPDIR}install-sh -c" ;;
98 .) echo 'INSTALL = $${rootme}'"${with_multisrctop}${TO_REAL_TOPDIR}install-sh -c" ;;
99 *) echo 'INSTALL = $${rootme}$(srcdir)'/"${TO_TOPDIR}install-sh -c" ;;
101 echo 'INSTALL_PROGRAM = $(INSTALL)'
102 echo 'INSTALL_DATA = $(INSTALL)'
104 echo 'AR = `if [ -f' ${TOPDIR}'binutils/ar ] ; \'
105 echo " then echo ${TOPDIR}binutils/ar ; "'\'
106 echo ' else echo ar ; fi`'
108 echo 'RANLIB = `if [ -f' ${TOPDIR}'binutils/ranlib ] ; \'
109 echo ' then echo '${TOPDIR}'binutils/ranlib ; \'
110 echo ' else echo ranlib ; fi`'
111 echo 'NM = `if [ -f' ${TOPDIR}'binutils/nm.new ] ; \'
112 echo ' then echo '${TOPDIR}'binutils/nm.new ; \'
113 echo ' else echo nm ; fi`'
114 echo 'NLMCONV = `if [ -f' ${TOPDIR}'binutils/nlmconv ] ; \'
115 echo ' then echo '${TOPDIR}'binutils/nlmconv ; \'
116 echo ' else echo nlmconv ; fi`'
117 echo 'LD = `if [ -f' ${TOPDIR}'ld/ld.new ] ; \'
118 echo ' then echo '${TOPDIR}'ld/ld.new ; \'
119 echo ' else echo ld ; fi`'
121 echo 'MAKEINFO = `if [ -f '${TOPDIR}'texinfo/C/makeinfo ] ; \'
122 echo ' then echo '${TOPDIR}'texinfo/C/makeinfo ; \'
123 echo ' else echo makeinfo ; fi`'
125 .) echo 'TEXIDIR = '"${with_multisrctop}${TO_REAL_TOPDIR}texinfo" ;;
126 *) echo 'TEXIDIR = $(srcdir)'/"${TO_TOPDIR}texinfo" ;;
128 echo 'TEXI2DVI = TEXINPUTS=${TEXIDIR}:$$TEXINPUTS texi2dvi'
135 echo 'WRAP_C_INCLUDES ='
137 echo 'WRAP_C_INCLUDES = -I$(srcdir)'/${TOLIBGXX}g++-include
140 echo 'CXXFLAGS = -g -O'
141 echo 'LIBCFLAGS = $(CFLAGS)'
142 echo 'LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates'
143 if [ "${LIBDIR}" = "yes" ]; then
144 echo 'PICDIR = stamp-picdir'
149 if test "${DOING_LIBGXX}" = "true" ; then
150 echo "TOLIBGXX = ${TOLIBGXX}"
151 echo 'PROTODIR = $(srcdir)'/${TOLIBGXX}src/gen
152 echo "LIBS = -L./${TOLIBGXX} -L./${TOLIBGXX}../libstdc++ -lg++ -lstdc++"
154 # You can override iostream (e.g. in a site- or host-Makefile fragment) to:
155 # iostream (Normal iostream library)
156 # old-stream (Old stream library; no longer supported)
157 # no-stream (If you don't want iostream to be part of libg++)
158 echo 'IO_DIR = ../libio'
159 echo '# IO_DIR = no-stream'
160 elif test "${DOING_GPERF}" = "true" ; then
161 echo "IO_DIR = libio"
162 echo "TOLIBGXX = ${TOLIBGXX}"
163 echo "LIBS = -L./${TOLIBGXX} -L./${TOLIBGXX}../libstdc++ -lg++ -lstdc++"
166 if [ -z "${ALL}" ] ; then
167 if [ -n "${TARGETLIB}" ] ; then
169 echo "TARGETLIB = ${TARGETLIB}"
170 elif [ -n "${TARGETPROG}" ] ; then
172 echo "TARGETPROG = ${TARGETPROG}"
174 echo "config error: neither ALL, TARGETLIB or TARGETPROG is defined" 1>&2
178 ALL='$(PICDIR)'" ${ALL}"
180 echo "all: ${ALL} multi-all"
181 if [ "${SUBDIRS}" != "" ] ; then
182 echo ' @rootme=`pwd`/; export rootme; \'
183 echo ' $(MAKE) "DODIRS=$(SUBDIRS)" DO=all $(FLAGS_TO_PASS) subdir_do'
188 echo '.PHONY: multi-all'
190 echo ' @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all'
194 if [ "${SUBDIRS}" != "" ] ; then
195 echo '.PHONY: subdir_do'
196 echo 'subdir_do: force'
197 echo ' @rootme=`pwd`/; export rootme; \'
198 echo ' for i in $(DODIRS); do \'
199 echo ' if [ -f ./$$i/Makefile ] ; then \'
200 echo ' echo "cd $$i; make $(DO) ..." ; \'
201 echo ' (cd $$i ; $(MAKE) $(FLAGS_TO_PASS) $(DO)) || exit 1 ; \'
202 echo ' else true ; fi ; \'
205 echo '# List of variables to pass to sub-makes. This should not be needed'
206 echo '# by GNU make or Sun make (both of which pass command-line variable'
207 echo '# overrides thouh $(MAKE)) but may be needed by older versions.'
209 echo 'FLAGS_TO_PASS= \'
210 echo ' "INSTALL=$(INSTALL)" \'
211 echo ' "INSTALL_DATA=$(INSTALL_DATA)" \'
212 echo ' "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \'
213 echo ' "prefix=$(prefix)" \'
214 echo ' "exec_prefix=$(exec_prefix)" \'
215 echo ' "tooldir=$(tooldir)" \'
217 echo ' "AR_FLAGS=$(AR_FLAGS)" \'
219 echo ' "CXX=$(CXX)" \'
220 echo ' "CFLAGS=$(CFLAGS)" \'
221 echo ' "CXXFLAGS=$(CXXFLAGS)" \'
223 echo ' "RANLIB=$(RANLIB)" \'
224 echo ' "LIBCFLAGS=$(LIBCFLAGS)" \'
225 echo ' "LIBCXXFLAGS=$(LIBCXXFLAGS)" \'
226 echo ' "LOADLIBES=$(LOADLIBES)" \'
227 echo ' "LDFLAGS=$(LDFLAGS)" \'
228 echo ' "MAKEINFO=$(MAKEINFO)" \'
229 echo ' "SHLIB=$(SHLIB)" \'
230 echo ' "SHCURSES=$(SHCURSES)" \'
231 echo ' "PICFLAG=$(PICFLAG)" \'
232 echo ' "RUNTESTFLAGS=$(RUNTESTFLAGS)"'
235 echo 'NOSTDINC = -nostdinc++'
236 if test -n "${XCXXINCLUDES}" ; then
237 echo "CXXINCLUDES = ${XCXXINCLUDES} "'$(NOSTDINC)'
238 elif test "${DOING_LIBGXX}" = "true" ; then
239 echo 'CXXINCLUDES = $(NOSTDINC) -I. -I'"${TO_TOPDIR}libio"' -I$(srcdir) -I$(srcdir)/'"${TOLIBGXX}"'$(IO_DIR) -I$(srcdir)/'"${TOLIBGXX}"'../libstdc++ -I$(srcdir)/'"${TOLIBGXX}src"' $(WRAP_C_INCLUDES)'
241 if test -n "${XCINCLUDES}" ; then
242 echo "CINCLUDES = ${XCINCLUDES}"
243 elif test "${DOING_LIBGXX}" = "true" ; then
247 if [ "${LIBDIR}" = "yes" ]; then
248 echo 'XCFLAGS = $(LIBCFLAGS)'
249 echo 'XCXXFLAGS = $(LIBCXXFLAGS)'
251 echo 'XCFLAGS = $(CFLAGS)'
252 echo 'XCXXFLAGS = $(CXXFLAGS)'
255 echo '.SUFFIXES: .o .C .cc .c'
256 echo 'COMPILE.c = $(CC) -c $(XCFLAGS) $(CINCLUDES) $(MT_CFLAGS)'
258 if [ "${LIBDIR}" = "yes" ]; then
259 echo ' test -z "$(PICFLAG)" ||\'
260 echo ' $(COMPILE.c) $(PICFLAG) $< -o pic/$@'
262 echo ' $(COMPILE.c) $<'
263 [ "${TOUCH_ON_COMPILE}" = "yes" ] && echo ' @touch stamp'
264 echo 'COMPILE.cc = $(CXX) -c $(XCXXFLAGS) $(CXXINCLUDES) $(MT_CFLAGS)'
266 if [ "${LIBDIR}" = "yes" ]; then
267 echo ' test -z "$(PICFLAG)" ||\'
268 echo ' $(COMPILE.cc) $(PICFLAG) $< -o pic/$@'
270 echo ' $(COMPILE.cc) $<'
271 [ "${TOUCH_ON_COMPILE}" = "yes" ] && echo ' @touch stamp'
273 if [ "${LIBDIR}" = "yes" ]; then
274 echo ' test -z "$(PICFLAG)" || \'
275 echo ' $(COMPILE.cc) $(PICFLAG) $< -o pic/$@'
277 echo ' $(COMPILE.cc) $<'
278 [ "${TOUCH_ON_COMPILE}" = "yes" ] && echo ' @touch stamp'
281 if [ -n "${TARGETLIB}" ] ; then
282 echo TARGETLIB = ${TARGETLIB}
284 if [ -n "${TARGETPROG}" ] ; then
285 echo TARGETPROG = ${TARGETPROG}
288 if [ "${LIBDIR}" = "yes" ]; then
291 echo ' if [ -n "$(PICFLAG)" ] && [ ! -d pic ]; then \'
293 echo ' else true; fi'
294 echo ' touch stamp-picdir'
298 echo '.PHONY: install'
301 if [ "${CHECK}" != "check" ] ; then
302 echo "check: ${ALL} ${CHECK}"
303 if [ "${CHECK_SUBDIRS}" != "" ] ; then
304 echo ' rootme=`pwd`/; export rootme; \'
305 echo ' SAVE_LLPATH="$${SAVE_LLPATH-$$LD_LIBRARY_PATH}"; export SAVE_LLPATH; \'
306 echo ' LD_LIBRARY_PATH="$${rootme}${TOLIBGXX}../libstdc++:$${rootme}${TOLIBGXX}../libg++:$$SAVE_LLPATH"; \'
307 echo ' export LD_LIBRARY_PATH; \'
308 echo ' $(MAKE) "DODIRS=$(CHECK_SUBDIRS)" DO=check $(FLAGS_TO_PASS) subdir_do'
312 # Generate rules for documentation (depending on INFO_FILES and INFO_SUBDIRS).
314 echo '.PHONY: info dvi install-info clean-info'
316 # emit the rule for 'info'
317 # (Note that the top-level ../Makefile.in greps for '^info:' when making
318 # a release (in "make taz"), so don't break that!)
319 if [ -z "${INFO_FILES}" ] ; then
322 echo info: `for file in ${INFO_FILES} ; do echo $file.info ; done`
324 if [ "${INFO_SUBDIRS}" != "" ] ; then
325 echo ' @rootme=`pwd`/; export rootme; \
326 $(MAKE) "DODIRS='${INFO_SUBDIRS}'" DO=info $(FLAGS_TO_PASS) subdir_do'
329 # emit the rule for 'dvi'
330 if [ -z "${INFO_FILES}" ] ; then
333 echo dvi: `for file in ${INFO_FILES} ; do echo $file.dvi ; done`
335 if [ "${INFO_SUBDIRS}" != "" ] ; then
336 echo ' @rootme=`pwd`/; export rootme; \
337 $(MAKE) "DODIRS='${INFO_SUBDIRS}'" DO=dvi $(FLAGS_TO_PASS) subdir_do'
340 # Emit rules for each *.info and *.dvi file
341 for file in ${INFO_FILES} ; do
342 echo ${file}.info: '$(srcdir)'/${file}.texi
343 echo ' $(MAKEINFO) -I$(srcdir) -I$(TEXIDIR) $(srcdir)/'${file}.texi -o ${file}.info
344 echo ${file}.dvi: '$(srcdir)'/${file}.texi
345 echo ' $(TEXI2DVI) $(srcdir)'/${file}.texi
346 echo "${file}.ps: ${file}.dvi"
347 echo " dvips ${file} -o"
350 # emit the rule for install-info
352 if [ -n "${INFO_FILES}" ] ; then
353 echo ' -parent=`echo $(infodir)|sed -e' "'"'s@/[^/]*$$@@'"'"'`; \'
354 echo ' if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi'
355 echo ' -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi'
356 echo ' for i in *.info* ; do \'
357 echo ' $(INSTALL_DATA) $$i $(infodir)/$$i ; \'
360 if [ "${INFO_SUBDIRS}" != "" ] ; then
361 echo ' @rootme=`pwd`/; export rootme; \
362 $(MAKE) "DODIRS='${INFO_SUBDIRS}'" DO=install-info $(FLAGS_TO_PASS) subdir_do'
365 # emit clean-info and clean-dvi rules
366 echo '.PHONY: do-clean-info clean-info do-clean-dvi clean-dvi'
368 if [ -n "${INFO_FILES}" ] ; then
369 echo ' rm -f *.info*'
372 if [ -n "${INFO_FILES}" ] ; then
373 echo ' rm -f *.dvi *.aux *.cp *.cps *.fn* *.ky *.log *.pg *.toc *.tp *.vr'
375 for type in info dvi ; do
376 echo clean-${type}: do-clean-${type}
377 if [ "${INFO_SUBDIRS}" != "" ] ; then
378 echo ' @rootme=`pwd`/; export rootme; \
379 $(MAKE) "DODIRS='${NFO_SUBDIRS}'" DO=clean-'${type} '$(FLAGS_TO_PASS) subdir_do'
385 echo '.PHONY: boltcc'
387 echo ' rootme=`pwd`/ ; export rootme ; $(MAKE) $(FLAGS_TO_PASS)'
395 MOSTLYCLEAN="${MOSTLYCLEAN-*.o pic stamp-picdir core ${EXTRA_MOSTLYCLEAN}} `if test -n "${TOUCH_ON_COMPILE}"; then echo stamp; else true; fi`"
396 CLEAN="${CLEAN-${TARGETPROG} ${TARGETLIB}}"
397 DISTCLEAN="${DISTCLEAN-config.status Makefile *~ Make.pack target-mkfrag multilib.out ${EXTRA_DISTCLEAN-}}"
398 REALCLEAN="${REALCLEAN-depend *.info*}"
401 echo '.PHONY: mostlyclean clean distclean maintainer-clean realclean'
402 if test -z "${SUBDIRS}" ; then
403 echo "mostlyclean: clean-dvi"
404 echo " rm -rf ${MOSTLYCLEAN}"
405 echo ' @$(MULTICLEAN) multi-clean DO=mostlyclean'
406 echo "clean: clean-dvi"
407 echo " rm -rf ${MOSTLYCLEAN} ${CLEAN}"
408 echo ' @$(MULTICLEAN) multi-clean DO=clean'
409 echo "distclean: clean"
410 echo ' @$(MULTICLEAN) multi-clean DO=distclean'
411 echo " rm -rf ${DISTCLEAN}"
412 echo "maintainer-clean realclean: clean clean-info"
413 echo ' @$(MULTICLEAN) multi-clean DO=maintainer-clean'
414 echo " rm -rf ${DISTCLEAN} ${REALCLEAN}"
416 echo '.PHONY: do-clean subdir_distclean subdir_maintainer_clean'
417 echo "mostlyclean: do-clean-dvi"
418 echo " rm -rf ${MOSTLYCLEAN}"
419 echo ' @$(MAKE) $(FLAGS_TO_PASS) "DODIRS=$(SUBDIRS)" DO=mostlyclean subdir_do'
420 echo ' @$(MULTICLEAN) multi-clean DO=mostlyclean'
421 echo "do-clean: do-clean-dvi"
422 echo " rm -rf ${MOSTLYCLEAN} ${CLEAN}"
423 echo "clean: do-clean"
424 echo ' @$(MAKE) $(FLAGS_TO_PASS) "DODIRS=$(SUBDIRS)" DO=clean subdir_do'
425 echo ' @$(MULTICLEAN) multi-clean DO=clean'
426 # distclean and maintainer-clean are tricky because they remove the Makefile.
427 echo "subdir_distclean:"
428 echo ' @$(MAKE) $(FLAGS_TO_PASS) "DODIRS=$(SUBDIRS)" DO=distclean subdir_do'
429 echo "distclean: do-clean subdir_distclean"
430 echo ' @$(MULTICLEAN) multi-clean DO=distclean'
431 echo " rm -rf ${DISTCLEAN}"
432 echo "subdir_maintainer_clean:"
433 echo ' @$(MAKE) $(FLAGS_TO_PASS) "DODIRS=$(SUBDIRS)" DO=maintainer-clean subdir_do'
434 echo "maintainer-clean realclean: do-clean subdir_maintainer_clean do-clean-info"
435 echo ' @$(MULTICLEAN) multi-clean DO=maintainer-clean'
436 echo " rm -rf ${DISTCLEAN} ${REALCLEAN}"
443 echo '# with the gnu make, this is done automatically.'
445 echo 'Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)'
446 echo ' $(SHELL) ./config.status'
449 echo 'MAKEOVERRIDES='
452 DEPEND_SOURCES = ${srcdir}/*.cc ${srcdir}/*.c
454 # The sed script below attempts to make the depend output portable.
455 # It cleans up the depenency information generated by cpp.
456 # It replaces instances of $(srcdir)/ by the string '$(srcdir)/'.
457 # It removes remaining absolute files names (such as /usr/include/stdio.h).
458 # It removes lines containing only "\\".
459 # It inserts '$(MULTISRCTOP)' in '$(srcdir)/..'.
460 # In order to support SunOS VPATH, $(srcdir)/[a-z]*.{c,cc} is replaced with
461 # [a-z]*.{c,cc} (the directory part is removed).
462 # The awk script removes a continuation marker that is followed by
463 # a blank line, since that may confuse make.
464 echo "# AUTOMATICALLY GENERATED BY 'make depend' - DO NOT EDIT" \
466 $(CXX) -M $(CXXINCLUDES) $(DEPEND_SOURCES) \
467 | sed -e 's|$(srcdir)/|$$(srcdir)/|g' \
468 -e 's| [^ ]_G_config.h| $$(_G_CONFIG_H)|g \
470 -e '/^[ ]*\\$$/d' -e 's/^[ ]*$$//' \
471 | sed -e 's|$$(srcdir)/[.][.]|$$(srcdir)/$$(MULTISRCTOP)..|g' \
472 -e 's|$$(srcdir)/\([^/]*[.]c\)|\1|' \
473 | awk 'BEGIN { prev = "" } \
474 /^( )*$$/ { if (prev ~ /\\$$/) \
475 { prev = substr(prev,1,length(prev)-1); next } } \
476 { print prev; prev = $$0 } \
477 END { if (prev !~ /^( )*$$/) print prev }' \
479 $(srcdir)/depend: depend.new
480 mv depend.new $(srcdir)/depend
483 if [ -f ${srcdir}/${subdir}/depend ] ; then
484 cat ${srcdir}/${subdir}/depend
487 echo "# End of package fragment generated by ${THIS_FILE}."