This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
two small cleanups
- To: libc-hacker@cygnus.com
- Subject: two small cleanups
- From: Zack Weinberg <zack@rabi.phys.columbia.edu>
- Date: Fri, 01 May 1998 22:30:37 -0400
This patch contains two independent changes. First, it redoes
{shared,static}-only-routines in terms of elide-routines.o? which
removes some unnecessary hair. (The empty.o rules are still around
but not used.) Second, it moves the stub-foo files into their
respective subdirectories, which I think is tidier.
Successfully completes make, make check, make install.
zw
Fri May 1 21:54:10 1998 Zack Weinberg <zack@rabi.phys.columbia.edu>
* Makerules (static-only-routines): Reimplement in terms of
elide-routines.os.
(shared-only-routines): Reimplement in terms of
elide-routines.X [where X is all object-suffixes except .os].
(stubs): Create stubs file inside the subdir.
(common-mostlyclean): Remove stubs file from inside the subdir.
* Makefile (subdir-stubs): Look for stubs files inside the
subdirs.
* manual/Makefile (stubs): Create dummy stubs file inside the
subdir.
--- Makerules.old Fri May 1 17:01:26 1998
+++ Makerules Fri May 1 22:08:02 1998
@@ -373,20 +373,14 @@
$(routines) $(aux) $(sysdep_routines))
ifdef static-only-routines
-# These routines are to be omitted from the shared library object,
-# so we replace the PIC objects for them with the empty object file.
-$(static-only-routines:%=$(objpfx)%.os): %.os: $(common-objpfx)empty.os
- rm -f $@
- ln $< $@
+elide-routines.os += $(static-only-routines)
endif
ifdef shared-only-routines
# If we have versioned code we don't need the old versions in any of the
# static libraries.
define o-iterator-doit
-$(shared-only-routines:%=$(objpfx)%$o): %$o: $(common-objpfx)empty$o;
- rm -f $$@
- ln $$< $$@
+elide-routines.$o := $(shared-only-routines)
endef
object-suffixes-left := $(filter-out .os,$(object-suffixes))
include $(o-iterator)
@@ -920,7 +914,7 @@
# Remove the object files.
common-mostlyclean:
-rm -f $(addprefix $(objpfx),$(tests) $(test-srcs) $(others) \
- $(tests-static) \
+ $(tests-static) stubs \
$(addsuffix .o,$(tests) $(test-srcs) \
$(tests-static) \
$(others)) \
@@ -929,7 +923,7 @@
-rm -f $(addprefix $(objpfx),$(extra-objs) $(install-lib) \
$(install-lib.so) \
$(install-lib.so:%.so=%_pic.a))
- -rm -f core $(common-objpfx)stub-$(subdir)
+ -rm -f core
$(rmobjs)
define rmobjs
$(foreach o,$(object-suffixes-for-libc),
@@ -943,15 +937,15 @@
-rm -f $(addprefix $(common-objpfx),$(common-generated))
-rm -f $(objpfx)distinfo
-# Produce a file `stub-$(subdir)' which contains `#define __stub_FUNCTION'
+# Produce a file `stubs' which contains `#define __stub_FUNCTION'
# for each function which is a stub. We grovel over all the .d files
# looking for references to <stub-tag.h>. Then we grovel over each
# referenced source file to see what stub function it defines.
.PHONY: stubs # The parent Makefile calls this target.
-stubs: $(common-objpfx)stub-$(subdir)
+stubs: $(objpfx)stubs
s = $(sysdep_dir)/generic
-$(common-objpfx)stub-$(subdir): $(+depfiles)
+$(objpfx)stubs: $(+depfiles)
# Use /dev/null since `...` might expand to empty.
(s=`cd $s && /bin/pwd`; \
$(patsubst %/,cd % &&,$(objpfx)) \
--- Makefile.old Thu Apr 30 16:41:33 1998
+++ Makefile Thu Apr 30 16:44:24 1998
@@ -195,11 +195,12 @@
version.c-objects := $(addprefix $(objpfx)version,$(object-suffixes))
$(version.c-objects): $(objpfx)version-info.h
-# Makerules creates a file `stub-$(subdir)' for each subdirectory, which
-# contains `#define __stub_FUNCTION' for each function which is a stub.
+# Makerules creates a file `stubs' in each subdirectory, which
+# contains `#define __stub_FUNCTION' for each function defined in that
+# directory which is a stub.
# Here we paste all of these together into <gnu/stubs.h>.
-subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)stub-$(dir))
+subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs)
# Since stubs.h is never needed when building the library, we simplify the
# hairy installation process by producing it in place only as the last part
--- manual/Makefile 1998/04/21 18:00:16 1.71
+++ manual/Makefile 1998/05/02 02:28:31
@@ -141,7 +141,7 @@
.PHONY: mostlyclean distclean realclean clean
mostlyclean:
- -rm -f libc.dvi libc.info* dir-add.info $(common-objpfx)stub-manual
+ -rm -f libc.dvi libc.info* dir-add.info stubs
-rm -f $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
clean: mostlyclean
distclean: clean
@@ -206,8 +206,8 @@
# updating the library archives are happy with us, and never think we have
# changed the library.
lib: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
-stubs: $(common-objpfx)stub-manual
-$(common-objpfx)stub-manual ../po/manual.pot $(objpfx)stamp%:
+stubs: $(objpfx)stubs
+$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
$(make-target-directory)
cp /dev/null $@