This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Updated make dist / make TAGS patch
- To: libc-hacker@cygnus.com, drepper@cygnus.com
- Subject: Updated make dist / make TAGS patch
- From: Zack Weinberg <zack@rabi.phys.columbia.edu>
- Date: Sat, 04 Jul 1998 10:03:09 -0400
This patch is an overhaul of make dist and make TAGS. The separate
makefiles for those operations have been removed, the code
streamlined, and various bugs stomped. Highlights:
- Massive speed improvement.
- Generated files that go into the distribution now get regenerated
when you do `make dist' (except libc.pot)
- Automatically handles CVS tags and generates diffs.
- Can generate snapshots too.
- TAGS for the manual are now useful.
- Makes major improvements to the master makefiles possible.
Changes from previous version:
- Updated to latest CVS.
- tarprefix.c has been removed; I found a better way.
- Code simplifications, bug fixes.
Caveats:
- TAGS may be ordered slightly differently.
- I have not tested interactions with CVS.
- You *must* put sysdep files not mentioned in non-sysdep Makefiles in
a Dist file if you want them to get distributed at all.
- Any code that relied on the format of a distinfo file is broken. I
fixed all such places in the common tree except the rpm subdir.
- You can only put one file on a line in a Dist file.
You must have installed all three of my unmerged patches (SCM_CREDS,
Makeconfig cleanup, and Versions fix) for this patch to apply
correctly. (SCM_CREDS is technically separate, but patch may
complain about sysdeps/.../linux/Dist and Makefile if you don't have
it.)
zw
1998-07-04 09:31 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
* Makefile: Strip dead code. Add iterator rules for
subdir_distinfo and subdir_TAGS. Add rules to create
distribution tarfiles. Add rule to make README from
template; adjust rules for INSTALL, NOTES, COPYING.LIB to
new form. Add rule to make libc.pot.
(src-generated): New variable.
(distribute): Add configparms, scripts/gen-distinfo,
scripts/fixpatch, scripts/gen-sysd-distlist. Add
README-alpha if $(release) = experimental. Drop COPYING,
Make-dist, MakeTAGS.
(cvs-commit): New macro.
(format-me): Simplified.
* Makerules: Delete old rules to make distinfo and TAGS. Call
scripts/gen-distinfo to make distinfo. Call $(ETAGS)
directly to make TAGS.
* scripts/gen-distinfo: New file.
* scripts/fixpatch: New file.
* scripts/gen-sysd-distlist: New file.
* Make-dist: Removed.
* MakeTAGS: Removed.
* manual/Makefile: Overhaul generation of chapters list.
Clean up. Change dist target to match new scheme. Change
TAGS target to generate a useful tags table.
* manual/chapters.awk: New file.
* db2/Makefile (distribute): Add mutex/sco.cc.
* mach/Machrules: Don't create .udeps files if no_deps is set.
* sysdeps/unix/Makefile: Don't create sysd-syscalls or
s-proto.d if avoid-generated is set.
* sysdeps/unix/sysv/linux/Makefile [subdir=posix]: Set
sysdep_headers not headers, and do it with +=.
* sysdeps/gnu/Makefile (dist): New target, regenerates
errlist.c.
* sysdeps/sparc/sparc32/Makefile (dist): New target,
regenerates divrem files.
* sysdeps/alpha/Dist: List only one file per line.
* sysdeps/generic/Dist: Likewise.
* sysdeps/m68k/fpu/switch/Dist: Likewise.
* sysdeps/sparc/sparc32/Dist: Likewise.
* sysdeps/unix/Dist: Likewise.
* sysdeps/unix/sysv/irix4/Dist: Likewise.
* sysdeps/unix/sysv/linux/Dist: Add getresuid.c, getresgid.c.
* sysdeps/generic/Dist: Add endutxent.c, getutxent.c,
getutxid.c, getutxline.c, pututxline.c, setutxent.c,
updwtmpx.c, utmpxname.c.
* sysdeps/unix/sysv/linux/sparc/sparc32/Dist: Remove
__sigtrampoline.S.
* sysdeps/mach/hurd/i386/Dist: Add static-start.S. (New file)
============================================================
Index: Makefile
--- Makefile 1998/07/02 21:54:13 1.169
+++ Makefile 1998/07/04 01:43:41
@@ -53,18 +53,13 @@
# These are the targets that are made by making them in each subdirectory.
+subdir_targets := subdir_lib objects objs others subdir_mostlyclean \
subdir_clean subdir_distclean subdir_realclean \
- tests subdir_lint.out \
- subdir_distinfo \
- subdir_echo-headers subdir_echo-distinfo \
- subdir_install \
+ tests subdir_lint.out subdir_install \
$(addprefix install-, no-libc.a bin lib data headers others)
headers := errno.h sys/errno.h bits/errno.h limits.h values.h \
features.h gnu-versions.h bits/libc-lock.h bits/xopen_lim.h \
gnu/libc-version.h
-echo-headers: subdir_echo-headers
-
# The headers are in the include directory.
subdir-dirs = include
vpath %.h $(subdir-dirs)
@@ -77,6 +72,10 @@
install-others += $(inst_includedir)/gnu/lib-names.h
endif
+# These are generated already when distributed. Rules are far below.
+# The list is needed in Makerules, so it has to be up here.
+src-generated := README INSTALL NOTES COPYING.LIB FAQ
+
ifeq ($(versioning),yes)
lib-noranlib: lib-mapfiles
endif
@@ -181,7 +180,21 @@
$(all-subdirs-targets):
$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
+# subdir_distinfo is *almost* the same. It needs to iterate all the dirs,
+# even the ones that aren't configured, and it needs to do it with no_deps
+# and avoid-generated set.
+subdir_distinfo: $(all-subdirs:%=%/distinfo)
+$(all-subdirs:%=%/distinfo):
+ $(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F) avoid-generated=t no_deps=t
+
+# Likewise for subdir_TAGS.
+subdir_TAGS: $(all-subdirs:%=%/TAGS)
+$(all-subdirs:%=%/TAGS):
+ $(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F) avoid-generated=t no_deps=t
+
.PHONY: $(+subdir_targets) $(all-subdirs-targets)
+.PHONY: $(all-subdirs:%=%/distinfo) $(all-subdirs:%=%/TAGS)
+
# Targets to clean things up to various degrees.
@@ -233,56 +246,137 @@
.PHONY: echo_subdirs
echo_subdirs:;@echo '$(subdirs)'
-.PHONY: echo-distinfo parent_echo-distinfo
-echo-distinfo: parent_echo-distinfo subdir_echo-distinfo
-parent_echo-distinfo:
- @echo $(addprefix +header+,$(headers)) \
- $(addprefix +nodist+,$(generated))
-
# Make the distribution tarfile.
+snapshot = $(shell date +%y%m%d)
+dist = $(version)
+last-snapshot = $(shell cat .last-snapshot)
+last-dist = $(shell cat .last-dist)
+
+XX = ud # FIXME: is this correct for the XX in libc-XX-YYMMDD tags?
+
++tarball = glibc-$($@)
++diff = glibc-$(last-$@)-$($@)
++tag = libc-$(XX)-$(subst .,_,$($@))
++last-tag = libc-$(XX)-$(subst .,_,$(last-$@))
+
+ifeq ($(have-tar-nameprefix),yes)
+tar-cmd = $(TAR) -c -T $< --name-prefix $(+tarball)/ | gzip > $@.T
+else
+define tar-cmd
+$(LN_S) . $(+tarball)
+sed 's!^!$(+tarball)/!' $< | $(TAR) -c -T - | gzip > $@.T
+rm -f $(+tarball)
+endef
+endif
+
+.PHONY: snapshot release dist distlist
+release: dist
+distlist: $(common-objpfx)distlist
+
+snapshot dist: $(common-objpfx)distlist
+ $(tar-cmd)
+ mv -f $@.T $(+tarball).tar.gz
+ifeq ($(with-cvs),yes)
+ cvs $(CVSOPTS) tag $(+tag)
+ cvs $(CVSOPTS) diff -u -r$(+last-tag) |./scripts/fixpatch |gzip >$@.D
+ mv -f $@.D $(+diff).diff.gz
+endif
+ echo $($@) > .last-$@
+
+$(common-objpfx)distlist: $(objpfx)distinfo $(objpfx)sysd-distlist \
+ subdir_distinfo
+ sort -u $(objpfx)distinfo $(objpfx)sysd-distlist \
+ $(all-subdirs:%=$(common-objpfx)%/distinfo) > $@.T
+ mv -f $@.T $@
+
+# No meaningful deplist is possible for these targets.
+.PHONY: $(objpfx)sysd-distlist $(objpfx)sysd-dist.mk
+$(objpfx)sysd-distlist: $(objpfx)sysd-dist.mk
+ $(MAKE) -f $< dist no_deps=t avoid-generated=t
+ ./scripts/gen-sysd-distlist > $@.T
+ mv -f $@.T $@
+
+# Like sysd-Makefile except that it includes all the sysdep Makefiles.
+$(objpfx)sysd-dist.mk: $(wildcard $(all-sysd-dirs:%=%/Makefile))
+ (echo 'dist:'; echo; echo 'include Makeconfig'; \
+ for M in $^; do echo "include $$M"; done) > $@T
+ mv -f $@T $@
+
distribute := README README.libm INSTALL FAQ FAQ.in NOTES NEWS BUGS \
- PROJECTS COPYING.LIB COPYING ChangeLog ChangeLog.[0-9] \
- Makefile Makeconfig Makerules Rules Make-dist MakeTAGS \
- extra-lib.mk o-iterator.mk configure configure.in \
- aclocal.m4 config.h.in config.make.in config-name.in \
- Makefile.in sysdep.h set-hooks.h libc-symbols.h \
- version.h shlib-versions rpm/Makefile rpm/template \
- rpm/rpmrc glibcbug.in abi-tags stub-tag.h \
- test-skeleton.c include/des.h Versions.def versions.awk \
+ PROJECTS COPYING.LIB ChangeLog ChangeLog.[0-9] \
+ Makefile Makeconfig Makerules Rules \
+ extra-lib.mk o-iterator.mk configure configparms \
+ configure.in aclocal.m4 config.h.in config.make.in \
+ config-name.in Makefile.in sysdep.h set-hooks.h \
+ libc-symbols.h version.h shlib-versions rpm/Makefile \
+ rpm/template rpm/rpmrc glibcbug.in abi-tags stub-tag.h \
+ test-skeleton.c include/des.h Versions.def versions.awk \
$(addprefix scripts/, \
rellns-sh config.sub config.guess \
mkinstalldirs move-if-change install-sh \
- test-installation.pl gen-FAQ.pl)
+ test-installation.pl gen-FAQ.pl subdir-dist \
+ fixpatch gen-distinfo gen-sysd-distlist)
+ifeq ($(release), experimental)
+distribute += README-alpha
+endif
distribute := $(strip $(distribute))
generated := $(generated) stubs.h
-README: README.template version.h ; # Make-dist should update README.
+ifeq ($(with-cvs),yes)
+define cvs-commit
+chmod 444 $@
+test ! -d CVS || cvs $(CVSOPTS) commit -m'Remade for $(release)-$(version)' $@
+endef
+else
+define cvs-commit
+chmod 444 $@
+endef
+endif
define format-me
-@rm -f $@
-makeinfo --no-validate --no-warn --no-headers $< -o $@
--chmod a-w $@
+makeinfo --no-validate --no-warn --no-headers $< -o $@.new
+mv -f $@.new $@
endef
-INSTALL: manual/install.texi; $(format-me)
-NOTES: manual/creature.texi; $(format-me)
-manual/dir-add.texi manual/dir-add.info: FORCE
- $(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
+
+README: README.template version.h
+ -rm -f $@
+ sed -e 's/RELEASE/$(release)/' -e 's/VERSION/$(version)/' < $< > $@
+ $(cvs-commit)
+INSTALL: manual/install.texi; $(format-me); $(cvs-commit)
+NOTES: manual/creature.texi; $(format-me); $(cvs-commit)
+COPYING.LIB: manual/lgpl.texinfo; $(format-me); $(cvs-commit)
+
FAQ: scripts/gen-FAQ.pl FAQ.in
- $(PERL) $^ > $@.new && rm -f $@ && mv $@.new $@ && chmod a-w $@
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs $(CVSOPTS) commit -m'Regenerated: $(PERL) $^' $@
-endif
-FORCE:
+ $(PERL) $^ > $@.new && rm -f $@ && mv $@.new $@
+ $(cvs-commit)
-rpm/%: subdir_distinfo
- $(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
+#rpm/%: subdir_distinfo
+# $(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
iconvdata/%:
$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
+# The message translation template.
+.PHONY: libc.pot
+libc.pot: po/libc.pot
+
+# You need a recent gettext, and a date that knows %z.
+# Arguably this should be in $(src-generated), except it needs
+# the entire distlist file, and distributing out-of-date versions
+# isn't the end of the world.
+po/libc.pot: $(common-objpfx)distlist po/header.pot
+ @rm -f $@.new
+ sed -e 's/VERSION/$(version)/' \
+ -e "s/DATE/`date +'%Y-%m-%d %H:%M%z'`/" \
+ po/header.pot > $@.new
+ $(XGETTEXT) --keyword=_ --keyword=N_ --add-comments=TRANS \
+ --sort-output --omit-header -n -d - \
+ >> $@.new `grep '\\.[ch]$$' $<`
+ mv -f $@.new $@
+
# This is a special goal for people making binary distributions. Normally
# everybody uses the DES based crypt library but for the distribution we
# need the only-MD5 based one as well.
============================================================
Index: Makerules
--- Makerules 1998/07/02 21:55:11 1.300
+++ Makerules 1998/07/04 01:43:41
@@ -832,15 +832,6 @@
.PHONY: check
check: tests
-.PHONY: TAGS
-TAGS: $(objpfx)distinfo $(..)MakeTAGS
- $(MAKE) $(addprefix -f ,$^) $@
-
-$(..)po/%.pot: $(objpfx)distinfo $(..)MakeTAGS FORCE
- $(MAKE) $(addprefix -f ,$(filter-out FORCE,$^)) $@
-FORCE:
-
-
.PHONY: echo-headers
echo-headers:
@echo $(headers)
@@ -900,40 +891,30 @@
/dev/null) > $@T
mv -f $@T $@
-# Make the distribution tar file.
+.PHONY: distinfo
+distinfo: $(objpfx)distinfo
-.PHONY: dist
-dist: $(objpfx)distinfo $(..)Make-dist
- $(MAKE) -f $< -f $(word 2,$^) $(Make-dist-args)
-
-# Avoid depending on source files found in sysdeps dirs,
-# because the references affect implicit rule selection.
-dist: $(filter-out %.c %.S %.s,$(distribute))
-
-# We used to simply export all these variables, but that frequently made the
-# environment get too large. Instead, we write all the information into
-# a generated makefile fragment `distinfo', and then include it with -f in
-# the sub-make that makes the distribution (above).
-$(objpfx)distinfo: Makefile $(..)Makerules \
- $(wildcard $(foreach dir,$(sysdirs),$(dir)/Makefile))
+$(objpfx)distinfo: Makefile $(src-generated)
$(make-target-directory)
- $(distinfo-vars)
+ $(..)scripts/gen-distinfo '$(subdir)' '$(subdir-dirs)' \
+ '$(sort $(routines:=.c) $(aux:=.c) $(others:=.c) \
+ $(foreach l, $(extra-libs), $($l-routines:=.c) $l.map) \
+ $(distribute) $(headers) $(test-srcs:=.c) $(tests:=.c) \
+ $(tests-static:=.c) $(tests:=.input) $(tests:=.args))' \
+ > $@.new
mv -f $@.new $@
-.PHONY: subdir_distinfo
-subdir_distinfo: $(objpfx)distinfo
-define distinfo-vars
-rm -f $@.new
-echo > $@.new 'subdir := $(subdir)'
-$(foreach var,subdir-dirs sources elided-routines sysdep_routines \
- headers sysdep_headers distribute dont_distribute generated \
- others tests test-srcs extra-libs $(extra-libs:%=%-routines) \
- tests-static $(extra-libs:%=%-map) versioned \
- $(addprefix install-,lib lib.so data bin sbin others),
-echo >> $@.new '$(subdir)-$(var) := $($(var))'
-echo >> $@.new '$(var) = $$($(subdir)-$(var))')
-endef
-
+# Tag tables.
+tag-these = $(sort $(shell grep '\.c$$' $<)) $(sort $(shell grep '\.h$$' $<))
+ifdef subdir
+TAGS: $(objpfx)distinfo $(common-objpfx)empty.c
+ cd $(..) && $(ETAGS) -o $(subdir)/$@ $(tag-these) $(common-objpfx)empty.c
+else
+TAGS: $(objpfx)distinfo subdir_TAGS $(common-objpfx)empty.c
+ $(ETAGS) -o $@ $(tag-these) $(common-objpfx)empty.c $(all-subdirs:%=-i %/TAGS)
+endif
+
+# zw: is this still used?
ifneq (,$(strip $(gpl2lgpl)))
ifneq (,$(wildcard $(..)gpl2lgpl.sed))
# Snarf from the master source and frob the copying notice.
============================================================
Index: db2/Makefile
--- db2/Makefile 1998/06/09 14:57:35 1.14
+++ db2/Makefile 1998/07/04 01:43:41
@@ -47,7 +47,7 @@
os_func.h) \
$(addprefix mutex/,x86.gcc uts4.cc.s sparc.gcc parisc.hp \
parisc.gcc alpha.gcc alpha.dec README \
- 68020.gcc tsl_parisc.s)
+ 68020.gcc tsl_parisc.s sco.cc)
vpath %.c $(subdir-dirs)
============================================================
Index: mach/Machrules
--- mach/Machrules 1998/06/22 17:04:23 1.64
+++ mach/Machrules 1998/07/04 01:43:41
@@ -104,6 +104,7 @@
echo '#include <$(firstword $($*.defs) $*.defs)>'
endef
+ifndef no_deps
# Not an implicit rule so the stamps are never removed as intermediates!
$(patsubst %,$(objpfx)%.ustamp,$(user-interfaces)): $(objpfx)%.ustamp:
rm -f $@
@@ -128,6 +129,7 @@
$(@:.udeps=_server.c) $(@:.udeps=_server.h):,' \
$(sed-remove-objpfx) > $@.new
mv -f $@.new $@
+endif
# Look for the server stub files where they will be written.
vpath %_server.c $(addprefix $(objpfx),$(sort $(dir $(server-interfaces))))
============================================================
Index: manual/Makefile
--- manual/Makefile 1998/06/05 20:41:57 1.76
+++ manual/Makefile 1998/07/04 01:43:41
@@ -41,31 +41,12 @@
info: libc.info dir-add.info
endif
-# Set chapters and chapters-incl[12].
-include chapters
-chapters: libc.texinfo
- $(find-includes)
-ifdef chapters
-# @includes in chapter files
--include chapters-incl1
-chapters-incl1: $(chapters)
- $(find-includes)
-chapters-incl1 := $(filter-out summary.texi,$(chapters-incl1))
-endif
-ifdef chapters-incl1
-# @includes in files included by chapter files, if any
--include chapters-incl2
-chapters-incl2: $(chapters-incl1)
- $(find-includes)
-endif
-
-chapters-incl := $(chapters-incl1) $(chapters-incl2)
-
-define find-includes
-(echo '$(@F) :=' \\ ;\
- $(AWK) '$$1 == "@include" { print $$2 " \\" }' $^) > $@.new
-mv -f $@.new $@
-endef
+chapters: libc.texinfo $(filter-out %.c.texi, $(chapters))
+ -$(AWK) -f chapters.awk $< > $@.new 2> /dev/null
+ mv -f $@.new $@
+chapters = $(filter-out %.c.texi, $(texis))
+examples = $(filter %.c.texi, $(texis))
# scripts we use
ifndef move-if-change
@@ -73,7 +54,7 @@
endif
mkinstalldirs = $(..)scripts/mkinstalldirs
-libc.dvi libc.info: $(chapters) summary.texi $(chapters-incl)
+libc.dvi libc.info: $(chapters) $(examples)
libc.dvi: texinfo.tex
%.info: %.texinfo
@@ -84,7 +65,7 @@
# Generate the summary from the Texinfo source files for each chapter.
summary.texi: stamp-summary ;
-stamp-summary: summary.awk $(chapters) $(chapters-incl)
+stamp-summary: summary.awk $(filter-out summary.texi, $(chapters))
$(AWK) -f $^ \
| sort -df +1 -2 | tr '\014' '\012' > summary-tmp
$(move-if-change) summary-tmp summary.texi
@@ -110,18 +91,14 @@
mv -f $@.new $@
-minimal-dist = summary.awk libc.texinfo $(chapters) \
- $(patsubst %.c.texi,examples/%.c, \
- $(filter-out summary.texi,$(chapters-incl)))
+minimal-dist = summary.awk libc.texinfo $(examples:%.c.texi=examples/%.c) \
+ $(filter-out summary.texi, $(chapters))
doc-only-dist = Makefile COPYING.LIB
-distribute = $(minimal-dist) \
- $(patsubst examples/%.c,%.c.texi,$(filter examples/%.c, \
- $(minimal-dist))) \
- libc.info* libc.?? libc.??s texinfo.tex summary.texi \
- stamp-summary chapters chapters-incl1 chapters-incl2 \
+
+distribute = $(minimal-dist) $(examples) libc.info* texinfo.tex \
+ summary.texi stamp-summary chapters chapters.awk \
xtract-typefun.awk dir-add.texinfo dir-add.info dir \
stdio-fp.c
-export distribute := $(distribute)
tar-it = tar chovf $@ $^
@@ -149,7 +126,7 @@
.PHONY: mostlyclean distclean realclean clean
mostlyclean:
- -rm -f libc.dvi libc.info* dir-add.info stubs
+ -rm -f libc.dvi libc.info* dir-add.info stubs TAGS
-rm -f $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
clean: mostlyclean
distclean: clean
@@ -157,7 +134,7 @@
realclean: distclean
-rm -f chapters chapters-incl* summary.texi stamp-summary *.c.texi
-rm -f $(foreach index,$(indices),libc.$(index) libc.$(index)s)
- -rm -f libc.log libc.aux libc.toc dir-add.texi
+ -rm -f libc.log libc.aux libc.toc dir-add.texinfo
.PHONY: install subdir_install installdirs install-data
install-data subdir_install: install
@@ -182,19 +159,25 @@
installdirs:
$(mkinstalldirs) $(inst_infodir)
-.PHONY: dist
-dist: # glibc-doc-$(edition).tar.gz
-
-ifneq (,$(wildcard ../Make-dist))
-dist: ../Make-dist
- $(MAKE) -f $< $(Make-dist-args)
-endif
+.PHONY: distinfo
+distinfo: $(objpfx)distinfo
+$(objpfx)distinfo: Makefile info
+ $(make-target-directory)
+ $(..)scripts/gen-distinfo manual '' '$(distribute)' > $@.new
+ mv -f $@.new $@
ifndef ETAGS
ETAGS = etags -T
endif
-TAGS: $(minimal-dist)
- $(ETAGS) -o $@ $^
+# This mess makes etags tag all @deftypefoo lines in the texi files.
+define tags-texi
+--language=none \
+--regex='/^@deftype\(fnx?\|vrx?\) +\([^ ]+\|{[^}]+}\) +\([^ ]+\|{[^}]+}\) +\([a-zA-Z0-9_]+\)/\4/' \
+--regex='/^@deftype\(funx?\|varx?\) +\([^ ]+\|{[^}]+}\) +\([a-zA-Z0-9_]+\)/\3/'
+endef
+
+TAGS: $(filter %.texi, $(minimal-dist))
+ $(ETAGS) -o $@ $(tags-texi) $^
# The parent makefile sometimes invokes us with targets `subdir_REAL-TARGET'.
subdir_%: % ;
@@ -218,7 +201,7 @@
.PHONY: stubs
stubs: $(objpfx)stubs
endif
-$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
+$(objpfx)stubs $(objpfx)stamp%:
$(make-target-directory)
touch $@
@@ -228,6 +211,10 @@
$(addprefix $(mkinstalldirs) ,\
$(filter-out $(wildcard $(@D:%/=%)),$(@D:%/=%)))
endef
+
+# This is needed by the doc-dist.
+COPYING.LIB: lgpl.texinfo
+ $(MAKEINFO) --no-validate --no-headers --no-warn $< -o $@
# The top-level glibc Makefile expects subdir_install to update the stubs file.
subdir_install: stubs
============================================================
Index: sysdeps/alpha/Dist
--- sysdeps/alpha/Dist 1997/11/18 02:39:11 1.8
+++ sysdeps/alpha/Dist 1998/07/04 01:43:41
@@ -1,5 +1,8 @@
divrem.h
-divl.S divq.S reml.S remq.S
+divl.S
+divq.S
+reml.S
+remq.S
_mcount.S
stxcpy.S
stxncpy.S
============================================================
Index: sysdeps/generic/Dist
--- sysdeps/generic/Dist 1998/06/22 09:30:19 1.9
+++ sysdeps/generic/Dist 1998/07/04 01:43:41
@@ -1,6 +1,16 @@
-make_siglist.c signame.c signame.h
+make_siglist.c
+signame.c
+signame.h
det_endian.c
entry.h
errno-loc.c
getresgid.c
getresuid.c
+endutxent.c
+getutxent.c
+getutxid.c
+getutxline.c
+pututxline.c
+setutxent.c
+updwtmpx.c
+utmpxname.c
============================================================
Index: sysdeps/gnu/Makefile
--- sysdeps/gnu/Makefile 1998/04/21 18:00:19 1.5
+++ sysdeps/gnu/Makefile 1998/07/04 01:43:41
@@ -29,6 +29,9 @@
test ! -d CVS || cvs commit -m'Regenerated from $^' $@
endif
+# This file goes in the distribution.
+dist: $(..)sysdeps/gnu/errlist.c
+
ifeq ($(subdir),login)
sysdep_routines += setutxent getutxent endutxent getutxid getutxline \
pututxline utmpxname updwtmpx
============================================================
Index: sysdeps/m68k/fpu/switch/Dist
--- sysdeps/m68k/fpu/switch/Dist 1992/02/12 19:49:28 1.2
+++ sysdeps/m68k/fpu/switch/Dist 1998/07/04 01:43:41
@@ -1 +1,2 @@
-68881-sw.h switch.c
+68881-sw.h
+switch.c
============================================================
Index: sysdeps/sparc/sparc32/Dist
--- sysdeps/sparc/sparc32/Dist 1997/08/29 20:38:37 1.2
+++ sysdeps/sparc/sparc32/Dist 1998/07/04 01:43:41
@@ -1,3 +1,8 @@
-dotmul.S umul.S
-divrem.m4 sdiv.S udiv.S rem.S urem.S
+dotmul.S
+umul.S
+divrem.m4
+sdiv.S
+udiv.S
+rem.S
+urem.S
alloca.S
============================================================
Index: sysdeps/sparc/sparc32/Makefile
--- sysdeps/sparc/sparc32/Makefile 1998/02/16 17:42:25 1.3
+++ sysdeps/sparc/sparc32/Makefile 1998/07/04 01:43:41
@@ -37,7 +37,10 @@
+divrem-S-rem := true
+divrem-S-udiv := false
+divrem-S-urem := false
-$(divrem:%=$(sysdep_dir)/sparc/sparc32/%.S): $(sysdep_dir)/sparc/sparc32/divrem.m4
+
++divrem-targets := $(divrem:%=$(sysdep_dir)/sparc/sparc32/%.S)
+
+$(+divrem-targets): $(sysdep_dir)/sparc/sparc32/divrem.m4
(echo "define(NAME,\`.$(+divrem-NAME)')\
define(OP,\`$(+divrem-OP-$(+divrem-NAME))')\
define(S,\`$(+divrem-S-$(+divrem-NAME))')\
@@ -49,5 +52,7 @@
ifeq ($(with-cvs),yes)
test ! -d CVS || cvs commit -m'Regenerated from $<' $@
endif
+
+dist: $(+divrem-targets)
-sysdep-realclean := $(sysdep-realclean) $(divrem:%=sysdeps/sparc/sparc32/%.S)
+sysdep-realclean := $(sysdep-realclean) $(+divrem-targets)
============================================================
Index: sysdeps/unix/Dist
--- sysdeps/unix/Dist 1996/06/12 21:55:43 1.5
+++ sysdeps/unix/Dist 1998/07/04 01:43:41
@@ -1,5 +1,8 @@
-errnos-tmpl.c errnos.awk
-ioctls-tmpl.c ioctls.awk snarf-ioctls
+errnos-tmpl.c
+errnos.awk
+ioctls-tmpl.c
+ioctls.awk
+snarf-ioctls
make_errlist.c
mk-local_lim.c
s-proto.S
============================================================
Index: sysdeps/unix/Makefile
--- sysdeps/unix/Makefile 1998/04/21 18:00:27 1.79
+++ sysdeps/unix/Makefile 1998/07/04 01:43:41
@@ -270,6 +270,7 @@
endif
+ifndef avoid-generated
ifndef inhibit-unix-syscalls
# Sysdep dirs unix/... can contain a file syscalls.list,
@@ -311,4 +312,5 @@
common-generated += s-proto.d
postclean-generated += sysd-syscalls
+endif
endif
============================================================
Index: sysdeps/unix/sysv/irix4/Dist
--- sysdeps/unix/sysv/irix4/Dist 1996/06/05 19:04:27 1.3
+++ sysdeps/unix/sysv/irix4/Dist 1998/07/04 01:43:41
@@ -1 +1,2 @@
-__handler.S sigtramp.c
+__handler.S
+sigtramp.c
============================================================
Index: sysdeps/unix/sysv/linux/Dist
--- sysdeps/unix/sysv/linux/Dist 1998/05/08 15:01:39 1.50
+++ sysdeps/unix/sysv/linux/Dist 1998/07/04 01:43:42
@@ -76,3 +76,5 @@
getdents64.c
__sendmsg.S
__recvmsg.S
+getresuid.c
+getresgid.c
============================================================
Index: sysdeps/unix/sysv/linux/Makefile
--- sysdeps/unix/sysv/linux/Makefile 1998/06/30 12:18:07 1.79
+++ sysdeps/unix/sysv/linux/Makefile 1998/07/04 01:43:42
@@ -75,7 +75,7 @@
endif
ifeq ($(subdir),posix)
-headers := bits/pthreadtypes.h
+sysdep_headers += bits/pthreadtypes.h
endif
ifeq ($(subdir),inet)
============================================================
Index: sysdeps/unix/sysv/linux/sparc/sparc32/Dist
--- sysdeps/unix/sysv/linux/sparc/sparc32/Dist 1997/08/29 20:40:27 1.2
+++ sysdeps/unix/sysv/linux/sparc/sparc32/Dist 1998/07/04 01:43:42
@@ -1,4 +1,3 @@
-__sigtrampoline.S
bits/mman.h
clone.S
pipe.S
============================================================
Index: manual/chapters.awk
--- manual/chapters.awk Wed Dec 31 19:00:00 1969
+++ manual/chapters.awk Sat May 30 15:54:11 1998 1.1
@@ -0,0 +1,17 @@
+BEGIN {
+ print "texis = \\"
+ input[0] = ARGV[1]
+ for (s = 0; s >= 0; s--)
+ {
+ while ((getline < input[s]) > 0)
+ {
+ if ($1 == "@include")
+ {
+ input[++s] = $2
+ print $2 " \\"
+ }
+ }
+ close(input[stackptr])
+ }
+ print ""
+}
============================================================
Index: scripts/gen-distinfo
--- scripts/gen-distinfo Wed Dec 31 19:00:00 1969
+++ scripts/gen-distinfo Fri Jul 3 21:00:59 1998 1.1
@@ -0,0 +1,79 @@
+#! /bin/sh
+
+# SYSDIRS=$(all-sysd-dirs) gen_distinfo $(subdir) $(subdir-dirs) $(distribute)
+# (see Makerules)
+
+[ -n "$1" ] && { subdir=$1/; dd=../; }
+
+subdir_dirs="$2"
+list="$3"
+
+csysd=
+hsysd=
+for f in $list
+do
+ case $f in
+ ../../*)
+ echo "gen-distinfo: ${subdir-TOP}: File outside source tree: $f" >&2
+ exit 1;;
+ ../*)
+ if [ -z "$dd" ]; then
+ echo "gen-distinfo: TOP: File outside source tree: $f" >&2
+ exit 1
+ fi
+ [ -f $f ] && echo "${f#../}";;
+ *.c)
+ # If it's in . or subdir_dirs it's not system dependent.
+ if [ -f $f ]; then
+ echo "$subdir$f"
+ else
+ found=
+ for d in $subdir_dirs
+ do
+ if [ -f $d/$f ]; then
+ echo "$subdir$d/$f"
+ found=t
+ fi
+ done
+ [ -n "$found" ] || csysd="$csysd $f"
+ fi;;
+ *.h|*.def)
+ if [ -f $f ]; then
+ echo "$subdir$f"
+ else
+ found=
+ for d in $subdir_dirs
+ do
+ if [ -f $d/$f ]; then
+ echo "$l$subdir$d/$f"
+ found=t
+ fi
+ done
+ [ -n "$found" ] || hsysd="$hsysd $f"
+ fi
+ [ -f ${dd}include/$f ] && echo "include/$f";;
+ *)
+ # Might be a glob.
+ for ff in $f; do
+ [ -f $ff ] && echo "$subdir$ff"
+ done;;
+ esac
+done
+
+for s in $SYSDIRS; do
+ for f in $csysd; do
+ if [ -f $s/$f ]; then echo "${s#$dd}/$f"
+ elif [ -f $s/${f%.c}.S ]; then echo "${s#$dd}/${f%.c}.S"
+ elif [ -f $s/${f%.c}.s ]; then echo "${s#$dd}/${f%.c}.s"
+ fi
+ done
+ for f in $hsysd; do
+ [ -f $s/$f ] && echo "${s#$dd}/$f"
+ done
+done
+
+# Always distribute subdir/Makefile and subdir/Versions.
+[ -f Makefile ] && echo ${subdir}Makefile
+[ -f Versions ] && echo ${subdir}Versions
+
+exit 0
============================================================
Index: scripts/fixpatch
--- scripts/fixpatch Wed Dec 31 19:00:00 1969
+++ scripts/fixpatch Mon Jun 15 12:31:57 1998 1.1
@@ -0,0 +1,18 @@
+#! /usr/bin/awk -f
+
+/^Ind/ {
+ small = full = $2;
+ sub(/.*\//, "", small);
+ print "============================================================";
+}
+
+/^===/ || /^RCS/ || /^ret/ || /^dif/ { next }
+
+/^---/ || /^\+\+\+/ {
+ sub(/\.orig/, "");
+ sub(/\([[:alnum:][:space:]\/._-]+\)/, "");
+ if(small) { sub("[[:space:]]+" small, " " full) }
+ sub(full "[[:space:]]+", full "\t");
+}
+
+{ print }
============================================================
Index: scripts/gen-sysd-distlist
--- scripts/gen-sysd-distlist Wed Dec 31 19:00:00 1969
+++ scripts/gen-sysd-distlist Fri Jul 3 21:24:53 1998 1.1
@@ -0,0 +1,26 @@
+#! /bin/sh
+
+# SYSDIRS='$(all-sysd-dirs)' gen-sysd-distlist
+
+for dir in $SYSDIRS
+do
+ [ -f $dir/Implies ] && echo $dir/Implies
+ [ -f $dir/Subdirs ] && echo $dir/Subdirs
+ [ -f $dir/Versions ] && echo $dir/Versions
+ [ -f $dir/Makefile ] && echo $dir/Makefile
+ [ -f $dir/configure ] && echo $dir/configure
+ [ -f $dir/configure.in ] && echo $dir/configure.in
+ [ -f $dir/syscalls.list ] && echo $dir/syscalls.list
+ [ -f $dir/Dist ] && {
+ echo $dir/Dist
+ while read file; do
+ if [ ! -f $dir/$file ]; then
+ echo Nonexistent Dist entry $dir/$file >&2
+ exit 1
+ fi
+ echo $dir/$file
+ done <$dir/Dist
+ }
+done
+
+exit 0
============================================================
Index: sysdeps/mach/hurd/i386/Dist
--- sysdeps/mach/hurd/i386/Dist Wed Dec 31 19:00:00 1969
+++ sysdeps/mach/hurd/i386/Dist Fri Jul 3 21:29:54 1998 1.1
@@ -0,0 +1 @@
+static-start.S
============================================================
Index: Make-dist
--- Make-dist Sat May 30 16:12:00 1998 1.81
+++ Make-dist Wed Dec 31 19:00:00 1969
@@ -1,248 +0,0 @@
-# Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-
-# You should have received a copy of the GNU Library General Public
-# License along with the GNU C Library; see the file COPYING.LIB. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-dist:
-
-# Make the value empty so ifdef fails if it's $(-subdir).
-subdir := $(subdir)
-ifdef subdir
-.. := ../
-else
-.. :=
-endif
-
-include $(..)Makeconfig
-
-foo:=$(shell echo 'distribute=$(distribute)'>&2)
-foo:=$(shell echo 'dont_distribute=$(dont_distribute)'>&2)
-foo:=$(shell echo 'foobar=$(filter %.c %.S %.s %.h,$(distribute))'>&2)
-
-ifndef sysdep_dirs
-# Find all sysdep directories.
-export sysdep_dirs := $(shell find $(..)sysdeps -type d ! -name bits \
- ! -name CVS ! -name RCS -print)
-else
-# Defined by the parent.
-sysdep_dirs := $(addprefix $(..),$(sysdep_dirs))
-endif
-
-# Don't distribute add-on subdirs.
-subdirs := $(filter-out $(add-ons),$(subdirs))
-
-# Make sure both stdio and libio get in, whichever is in use.
-subdirs += stdio libio
-
-# Make sure both aout and elf get in, whichever is in use.
-subdirs += aout elf
-
-sysdep-Subdir-files := $(wildcard $(addsuffix /Subdirs,$(sysdep_dirs)))
-ifdef sysdep-Subdir-files
-subdirs := $(sort $(subdirs) \
- $(shell sed -e 's/\#.*$$//' $(sysdep-Subdir-files)))
-endif
-
-
-# Makefiles can define `source_dirs' to list nonstandard directories
-# where source files might be found.
-
-ifdef subdir
-all-headers = $(filter-out $(sysdep_headers),$(headers))
-else
-+distinfo := $(shell MAKEFLAGS= MFLAGS= $(MAKE) -s no_deps=t \
- inhibit_interface_rules=t inhibit_mach_syscalls=t \
- subdirs='$(subdirs)' echo-distinfo | grep -v '^make')
-foo:=$(shell echo>&2 '+distinfo=$(+distinfo)')
-all-headers := $(patsubst +header+%,%,$(filter +header+%,$(+distinfo)))
-# Ignore subdir headers without top-level indirections.
-all-headers := $(sort $(headers) \
- $(patsubst include/%,%,\
- $(wildcard $(addprefix include/,\
- $(all-headers)))))
-# Filter out names like ../conf/portability.h that would point outside
-# the source directory.
-all-headers := $(filter-out ../%,$(all-headers))
-+subdir-nodist := $(patsubst +nodist+%,%,$(filter +nodist+%,$(+distinfo)))
-+subdir-headers := $(filter-out $(headers),$(all-headers))
-endif
-foo:=$(shell echo 'IS THIS WORKING??? all-headers=$(all-headers)' >&2)
-
-sources += $(addsuffix .c,$(elided-routines) \
- $(foreach l,$(extra-libs),$($l-routines)))
-
-# Find all sysdep sources and headers.
-+maybe-sysdeps := $(sources) $(sources:.c=.s) $(sources:.c=.S) $(all-headers) \
- $(filter %.c %.S %.s %.h %.sub,$(distribute))
-foo:=$(shell echo '+maybe-sysdeps=$(+maybe-sysdeps)'>&2)
-# Find all the files that have a generic version.
-try-sysdeps := $(foreach dir,$(..)sysdeps/generic $(..)sysdeps/libm-ieee754,\
- $(addprefix $(dir)/,$(+maybe-sysdeps)))
-foo:=$(shell echo 'try-sysdeps=$(try-sysdeps)'>&2)
-+sysdeps := $(wildcard $(try-sysdeps))
-foo:=$(shell echo 'generic +sysdeps=$(+sysdeps)'>&2)
-+sysdep-names := $(sort $(patsubst $(..)sysdeps/generic/%,%,\
- $(patsubst $(..)sysdeps/libm-ieee754/%,%,\
- $(+sysdeps))))
-foo:=$(shell echo '+sysdep-names=$(+sysdep-names)' >&2)
-
-ifdef subdir-dirs
-vpath % $(subdir-dirs)
-endif
-
-# Now find all the sysdep versions of those files.
-+sysdeps := $(foreach dir,$(sysdep_dirs) $(source_dirs),\
- $(wildcard $(addprefix $(dir)/, \
- $(+sysdep-names) \
- $(+sysdep-names:.c=.s) \
- $(+sysdep-names:.c=.S) \
- )))
-
-
-# Source and header files to go in the distribution tar file.
-
-.S.s := $(wildcard $(sources:.c=.S) $(sources:.c=.s))
-sources := $(filter-out $(addsuffix .c,$(basename $(.S.s))),$(sources)) $(.S.s)
-
-+out := $(patsubst %.S,%.c,$(+sysdep-names:.s=.c)) \
- $(addsuffix .c,$(sysdep_routines)) \
- $(+subdir-nodist) $(dont_distribute)
-foo:=$(shell echo '+out=$(+out)' >&2; echo foofoo >&2)
-+tsrcs := $(filter-out $(+out), $(sources) $(all-headers) $(distribute)) \
- $(foreach l,$(extra-libs),$($l-map)) \
- $(wildcard $(addsuffix .map,$(extra-libs))) $(+sysdeps)
-foo:=$(shell echo 'made +tsrcs=$(+tsrcs)'>&2)
-foo:=$(shell echo generated='$(generated)' >&2)
-#generated := $(sort $(generated) $(generated:.S=.c) $(generated:.s=.c))
-#foo:=$(shell echo now generated='$(generated)' >&2)
-+tsrcs := $(sort $(filter-out $(generated),$(+tsrcs)))
-foo:=$(shell echo '+tsrcs=$(+tsrcs)'>&2)
-foo:=$(shell echo foobie, dammit! >&2)
-
-ifndef tardir
-export tardir := glibc-$(version)
-endif
-
-$(..)glibc-$(version):
- ln -s . $@
-
-#+tsrcs := $(+tsrcs) \
-# TAGS
-.PHONY: TAGS
-TAGS: $(..)MakeTAGS
- $(MAKE) -f $< $@ -o subdir_TAGS
-
-ifdef subdir
-
-foo:=$(shell echo subdir foo >&2)
-
-+tsrcs := Makefile $(+tsrcs) \
- $(addsuffix .c,$(others) $(tests) $(tests-static) $(test-srcs)) \
- $(wildcard $(addsuffix .input,$(tests) (tests-static) $(test-srcs)) \
- $(addsuffix .args,$(tests) $(tests-static) $(test-srcs)))
-+tardeps := $(strip $(+tsrcs))
-
-verbose = v
-
-.PHONY: dist
-dist: $(..)$(tardir) $(+tardeps)
- @cd ..; if test -f dist.tar; then c=u; else c=c; fi; \
- $(+cmdecho) "cd ..; tar $${c}h$(verbose)f dist.tar ..."; \
- tar $${c}h$(verbose)f dist.tar \
- $(addprefix $(tardir)/$(subdir)/,$(filter-out $<,$^))
-
-else # Parent makefile.
-
-# Find what other things sysdep directories want to distribute.
-
-foo:=$(shell echo parent foobie>&2)
-+sysdep-distfiles := $(wildcard $(addsuffix /Dist,$(sysdep_dirs)))
-foo:=$(shell echo +sysdep-distfiles='$(+sysdep-distfiles)'>&2)
-+sysdep-dist := $(foreach file,$(+sysdep-distfiles),\
- $(addprefix $(dir $(file)), \
- $(shell sed -e 's/\#.*$$//' $(file)))) \
- $(+sysdep-distfiles) \
- $(sysdep-Subdir-files)
-foo:=$(shell echo '+sysdep-dist=$(+sysdep-dist)' >&2)
-
-+sysdep-tsrcs := $(wildcard $(foreach file,Makefile Implies syscalls.list\
- configure configure.in,\
- $(addsuffix /$(file),$(sysdep_dirs)))) \
- $(+sysdep-dist)
-
-+tsrcs := $(+tsrcs) $(+sysdep-tsrcs)
-
-ifeq ($(with-cvs),yes)
-define autoconf-it
-autoconf $(ACFLAGS) $< > $@.new
-mv -f $@.new $@
-test ! -d CVS || cvs $(CVSOPTS) commit -m'Regenerated: autoconf $(ACFLAGS) $<' $@
-endef
-else
-define autoconf-it
-autoconf $(ACFLAGS) $< > $@.new
-mv -f $@.new $@
-endef
-endif
-
-configure: configure.in aclocal.m4; $(autoconf-it)
-%/configure: %/configure.in aclocal.m4; $(autoconf-it)
-
-dist: $(tardir).tar.gz
-
-subdir_dist: dist.tar
-dist.tar: README $(tardir) $(+tsrcs)
- tar chvf $@ $(addprefix $(tardir)/,$(filter-out $(tardir),$^))
-
-$(tardir).tar: dist.tar subdir_dist
- @echo Files listed here have names exceeding 14 chars.
- tar xfv $< -C $${TMPDIR-/tmp} | sed -n '/[^/]\{15,\}/p'
- tar covf $@ -C $${TMPDIR-/tmp} $(tardir)
- -rm -fr $${TMPDIR-/tmp}/$(tardir) dist.tar &
-
-%.Z: %
- compress -c $< > $@
-
-%.gz: %
- gzip -9 -v -c $< > $@
-
-foo:=$(shell echo subdirs=$(subdirs) >&2)
-dist-subdirs := $(addprefix dist-,$(subdirs)) # dist-manual
-.PHONY: subdir_dist $(dist-subdirs)
-subdir_dist: $(dist-subdirs)
-$(dist-subdirs):
- $(MAKE) -C $(patsubst dist-%,%,$@) dist
-
-# This is here instead of in Makefile so it can use $(release) and $(version).
-README: README.template version.h
- -rm -f $@
- sed -e 's/RELEASE/$(release)/' -e 's/VERSION/$(version)/' < $< > $@
-# Make it unwritable so I won't change it by mistake.
- chmod 444 $@
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs $(CVSOPTS) commit -m'Remade for $(release)-$(version)' $@
-endif
-
-
-endif # Subdirectory vs. parent makefile
-
-# Get these things out of the environment because they take up lots of space.
-unexport distribute generated
-
-# Fnord.
-export inhibit_mach_syscalls=t
-export no_deps=t
-export inhibit_interface_rules=t
============================================================
Index: MakeTAGS
--- MakeTAGS Thu May 14 23:51:13 1998 1.40
+++ MakeTAGS Wed Dec 31 19:00:00 1969
@@ -1,183 +0,0 @@
-# Make the TAGS files.
-
-# Copyright (C) 1992, 1994, 1995, 1996, 1998 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public License
-# as published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-
-# You should have received a copy of the GNU Library General Public
-# License along with the GNU C Library; see the file COPYING.LIB. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# Make this the default goal.
-TAGS:
-
-ifdef subdir
-.. := ../
-endif
-
-include $(..)Makeconfig
-
-ifndef tags_sources
-ifeq ($(subdir),ctype)
-# In most cases, we want the C source files to come before
-# the header files so tags for optimizing #define's in the
-# headers won't be put in the tags files, but for ctype,
-# the functions are just backup for the #define's in the header.
-tags_sources = $(all-headers) $(all-sources) $(all-dist)
-else # Not ctype.
-tags_sources = $(all-sources) $(all-headers) $(all-dist)
-endif # ctype
-endif # No tags_sources
-
-sysdep-dirs := $(full-config-sysdirs)
-
-ifndef sysdep_dirs
-# Find all sysdep directories.
-sysdep_dirs := $(shell find $(..)sysdeps \
- $(wildcard \
- $(patsubst %,$(..)%/sysdeps,$(add-ons))) \
- -type d ! -name RCS ! -name CVS -print)
-endif
-
-# Find all sysdep dirs there are, but putting the ones
-# we are configured to use first and preserving their order.
-all-dirs := $(subdir-dirs) \
- $(objdir) \
- $(sysdep-dirs) \
- $(source_dirs) \
- $(filter-out $(sysdep-dirs),$(sysdep_dirs))
-
-# Find all the subdirs there are, but putting the ones
-# we are configured to use first and preserving their order.
-ifndef subdir
-subdirs := $(subdirs) \
- $(filter-out $(subdirs),\
- $(shell sed -e 's/\#.*$$//' \
- $(wildcard $(addsuffix /Subdirs,\
- $(all-dirs)))\
- /dev/null))
-all-dist = $(foreach Dist,$(wildcard $(all-dirs:%=%/Dist)),\
- $(addprefix $(Dist:%/Dist=%)/,\
- $(filter %.c %.h %.S %.s,\
- $(shell cat $(Dist)))))
-tags_sources = $(all-sources) $(all-headers) $(all-dist)
-else
-all-dist = $(distribute)
-endif
-
-# sources and headers must be simply expanded variables
-sources := $(sources) $(filter %.c %.s %.S,$(all-dist))
-headers := $(headers) $(filter %.h,$(all-dist))
-all-dist := $(filter-out %.h %.c %.s %.S,$(all-dist))
-
-sources += $(foreach lib,$(extra-libs),$($(lib)-routines:=.c))
-
-# All different versions of $(sources), preserving the configured sysdep
-# directory order.
-# Files that are found in the current directory cannot occur in
-# sysdep directories, so don't bother searching them.
-sysdep-sources := $(filter-out $(wildcard $(sources)), $(sources))
-all-sources = $(wildcard $(sort $(sources) $(sources:.c=.S) $(sources:.c=.s) \
- $(others:=.c) $(tests:=.c) $(test-srcs:=.c))) \
- $(foreach dir,$(all-dirs),\
- $(wildcard \
- $(addprefix $(dir)/,\
- $(sort $(sysdep-sources) \
- $(sysdep-sources:.c=.S) \
- $(sysdep-sources:.c=.s)))))
-
-sysdep-headers := $(filter-out $(wildcard $(headers)), $(headers))
-all-headers = $(wildcard $(headers)) \
- $(foreach dir,$(all-dirs),\
- $(wildcard $(addprefix $(dir)/,$(sysdep-headers))))
-
-tags_sources := $(strip $(tags_sources))
-
-TAGS: $(tags_sources)
-ifdef subdir
-ifdef tags_sources
- $(ETAGS) -o $@ $^
-else
-# No sources. Create a dummy file.
- touch $@
-endif # tags_sources
-else # parent
-TAGS: subdir_TAGS
-# Note that this uses the -i switch, and thus requires v19 etags.
- $(ETAGS) -o $@ \
- $(subdirs:%=-i %/TAGS) \
- $(filter-out subdir_TAGS,$^)
-
-.PHONY: subdir_TAGS $(subdirs:%=%/TAGS)
-subdir_TAGS: $(subdirs:%=%/TAGS)
-$(subdirs:%=%/TAGS):
- $(MAKE) -C $(@D) no_deps=t $(@F)
-
-endif # subdir
-
-ifndef XGETTEXT
-XGETTEXT = xgettext
-endif
-
-P = $(..)po
-
-ifdef subdir
-domain = $(subdir)
-else
-domain = libc-top
-endif
-
-define extract
-@rm -f $@.new
-$(XGETTEXT) --keyword=_ --keyword=N_ --add-comments=TRANS --sort-output \
- --omit-header -n -d - $(XGETTEXTFLAGS-$(@F)) > $@.new $^
-mv -f $@.new $@
-endef
-
-text-srcs := $(filter %.c %.h %.cc %.C,$(tags_sources))
-$P/$(domain).pot: $(text-srcs)
-ifeq (,$(text-srcs))
- cp /dev/null $@
-else
- $(extract)
-endif
-
-all-pot = $P/libc-top.pot $P/subdirs.pot
-
-ifndef subdir
-# Collect all the subdir messages, massaging the file names in comments
-# to include the subdir name.
-$P/subdirs.pot: $(subdirs:%=$P/%.pot)
- @rm -f $@.new
- (for d in $(subdirs); \
- do sed "/^#:/s% % $$d/%g" $P/$$d.pot; done) > $@.new
- mv -f $@.new $@
-
-# Combine all the messages into the final sorted template translation file.
-# The following code requires GNU date.
-$P/libc.pot: $(all-pot)
- @rm -f $@.new
- set `date -R`; disp="$$6"; \
- sed -e 's/VERSION/$(version)/' \
- -e "s/DATE/`date +'%Y-%m-%d %H:%M'$$disp`/" \
- po/header.pot > $@.new
- $(XGETTEXT) -d - --omit-header -n -s $^ >> $@.new
- mv -f $@.new $@
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs $(CVSOPTS) ci -m'Regenerated from source files' $@
-endif
-
-$(subdirs:%=$P/%.pot): $P/%.pot: FORCE
- $(MAKE) -C $* no_deps=t ../$@
-FORCE:
-endif