summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog31
-rw-r--r--Makeconf69
-rw-r--r--Makefile4
-rw-r--r--TODO1
4 files changed, 93 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 53fda1b3..e2eb1d59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+Wed Oct 23 01:36:35 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
+
+ * Makeconf ($(target)): Repair rule for building of .prof_d
+ files.
+ ($(target), $(target).prof): Refer to generated variables
+ (-CFLAGS, -LFLAGS, -LDLIBS) by the base name ($*) not $@.
+ (_libext): Likewise.
+
+Mon Oct 21 22:22:49 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
+
+ * Makeconf (cleantarg) [makemode == library]: Add $(libname)_p.a.
+ (targets) [makemode == library]: Include $(libname)_p.a in default
+ value.
+ ($(libdir)/$(libname)_p.a) [makemode == library]: New rule.
+ ($(libname)_p.a) [makemode == library]: New rule.
+ (%_p.o): Two new rules (depend on %.c or %.S).
+ (make_deps): Make dependency now specify $*_p.o too.
+ ($(addsuffix .prof,$(target))): New rule to link profiled objects.
+ ($(target)): Surround usual build rule with if prof-depend == nil.
+ ($(addsuffix .prof_d, $(target))): Include this if not a library.
+ Also a new rule to build them.
+ ($(target)) [prof-depend == t]: Kludge to write out its dependencies.
+
+Tue Oct 15 12:29:26 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
+
+ * Makeconf (relink): Remove $(linktarg) always.
+ (linktarg) [makemode == library]: Set variable.
+ (linktarg): And also a default.
+ * Makefile (%-relink): Set no_deps=t here.
+ (relink): Do $(lib-subdirs) too.
+
Tue Oct 8 22:39:12 1996 Miles Bader <miles@gnu.ai.mit.edu>
* Makeconf ($(includedir)/$(installhdrsubdir),
diff --git a/Makeconf b/Makeconf
index 5bfdd38f..5ecf1ead 100644
--- a/Makeconf
+++ b/Makeconf
@@ -117,15 +117,20 @@ endif
ifeq ($(makemode),library)
clean := yes
- cleantarg := $(libname).a $(libname).so
+ cleantarg := $(libname).a $(libname).so $(libname)_p.a
+ linktarg := $(libname).so
ifndef installhdrsubdir
installhdrsubdir = hurd
endif
ifndef targets
- targets = $(libname).a $(libname).so
+ targets = $(libname).a $(libname).so $(libname)_p.a
endif
endif
+ifeq ($(linktarg),)
+ linktarg:=$(cleantarg)
+endif
+
# This is a hack to give all hurd utilities a default bug-reporting
# address (defined in libhurdbugaddr/bugaddr.c).
BUGADDR = $(..)libhurdbugaddr/libhurdbugaddr.a
@@ -175,6 +180,9 @@ $(INSTALLED_LOCAL_HEADERS): $(top_srcdir)/$(installhdrsubdir)/%:
endif
libs: $(INSTALLED_LOCAL_HEADERS)
+$(libdir)/$(libname)_p.a: $(libname)_p.a
+ $(INSTALL_DATA) $(libname)_p.a $(libdir)/$(libname)_p.a
+ $(RANLIB) $(libdir)/$(libname)_p.a
$(libdir)/$(libname).a: $(libname).a
$(INSTALL_DATA) $(libname).a $(libdir)/$(libname).a
$(RANLIB) $(libdir)/$(libname).a
@@ -211,7 +219,7 @@ endif
# is used in LDFLAGS.
__libext=.so
__libext-static=.a
-_libext=$(__libext$(findstring -static,$(LDFLAGS) $($@-LDFLAGS)))
+_libext=$(__libext$(findstring -static,$(LDFLAGS) $($*-LDFLAGS)))
libsubst=$(basename ${lib})$(_libext)
libsubst-override=${$(notdir $(basename ${lib}))-libsubst}
@@ -221,12 +229,28 @@ _libsubst=${libsubst$(patsubst %,-override,${libsubst-override})}
# dependencies of other shared objects it encounters.
rpath := -Wl,-rpath-link=.:$(subst $. ,:,$(dir $(wildcard ../lib*/lib*.so)))
+# Main rule to link executables
+#
+# (prof-depend is a special kind of run not normally used; see the rules
+# below for %.prof_d which uses it.)
+ifeq ($(prof-depend),)
$(target): %$(target-suffix): $(BUGADDR)
- $(CC) $(rpath) $(CFLAGS) $($@-CFLAGS) $(LDFLAGS) $($@-LDFLAGS) $(BUGADDR_REF) \
+ $(CC) $(rpath) $(CFLAGS) $($*-CFLAGS) $(LDFLAGS) $($*-LDFLAGS) $(BUGADDR_REF) \
-o $@ \
'-Wl,-(' $(filter %.o,$^) \
- $(foreach lib,$(filter-out %.o,$+),${_libsubst}) $($@-LDLIBS) $(LDLIBS) \
+ $(foreach lib,$(filter-out %.o,$+),${_libsubst}) $($*-LDLIBS) $(LDLIBS) \
'-Wl,-)'
+endif
+
+# Just like above, but tell how to make .prof versions of programs.
+$(addsuffix .prof,$(target)): %$(target-suffix).prof: $(BUGADDR)
+ $(CC) -pg $(CFLAGS) $($*-CFLAGS) $(LDFLAGS) $($*-LDFLAGS) \
+ $(BUGADDR_REF) -static \
+ -o $@ \
+ '-Wl,-(' $(filter %.o,$^) \
+ $(patsubst %.a,%_p.a,$(filter-out %.o,$+)) \
+ $($*-LDLIBS) $(LDLIBS) \
+ '-Wl,-)'
ifeq ($(makemode),library)
$(libname).a: $(OBJS)
@@ -234,6 +258,11 @@ $(libname).a: $(OBJS)
$(AR) r $@ $^
$(RANLIB) $@
+$(libname)_p.a: $(patsubst %.o,%_p.o,$(OBJS))
+ rm -f $(libname)_p.a
+ $(AR) r $@ $^
+ $(RANLIB) $@
+
$(libname).so: $(patsubst %.o,%_pic.o,$(OBJS)) $(library_deps)
$(CC) -shared -Wl,-soname=$(libname).so -o $(libname).so \
$(rpath) $(CFLAGS) $(LDFLAGS) $($@-LDFLAGS) $^
@@ -273,11 +302,10 @@ endif
ifeq ($(clean),yes)
clean:
rm -f *.d *.*_d *.o *Server.c *User.c *_S.h *_U.h $(cleantarg)
-ifneq ($(makemode),library)
relink:
- rm -f $(cleantarg)
-endif
+ rm -f $(linktarg)
endif
+
clean:
relink:
@@ -319,12 +347,19 @@ relink:
vpath libutil.% $(libdir)/
-# Default rule to build PIC object files.
+# Default rules to build PIC object files.
%_pic.o: %.c
$(COMPILE.c) $< -DPIC -fPIC -o $@
%_pic.o: %.S
$(COMPILE.S) $< -DPIC -o $@
+
+# Default rules to build profiled object files.
+%_p.o: %.c
+ $(COMPILE.c) $< -DPROF -pg -o $@
+
+%_p.o: %.S
+ $(COMPILE.S) $< -DPROF -o $@
# How to build RPC stubs
@@ -387,6 +422,10 @@ ifneq ($(no_deps),t)
-include $(subst Server.o,.migsh_d,$(filter %Server.o,$(OBJS))) /dev/null
-include $(subst User.o,.miguh_d,$(filter %User.o,$(OBJS))) /dev/null
+ifneq ($(makemode),library)
+-include $(addsuffix .prof_d,$(target)) /dev/null
+endif
+
# For each .o file we need a .d file.
-include $(subst .o,.d,$(filter %.o,$(OBJS))) /dev/null
@@ -413,9 +452,18 @@ endif
%.miguh_d: %.migu_d
sed -e 's/User\.c/_U\.h/' -e 's/migu_d/miguh_d/' < $< > $@
+%.prof_d: Makefile
+ $(MAKE) $* prof-depend=t no_deps=t
+
+ifeq ($(prof-depend),t)
+$(target): %: FORCE
+ rm -f $@.prof_d
+ echo $@.prof: $(subst .o,_p.o,$(filter-out FORCE,$+)) > $@.prof_d
+endif
+
define make-deps
set -e; $(CC) $(CFLAGS) $(CPPFLAGS) -M -MG $< | \
-sed > $@.new -e 's/$*\.o:/$*.o $*_pic.o $@:/' \
+sed > $@.new -e 's/$*\.o:/$*.o $*_pic.o $*_p.o $@:/' \
-e 's% [^ ]*/gcc-lib/[^ ]*\.h%%g'
mv -f $@.new $@
endef
@@ -436,3 +484,4 @@ endef
%: %.sh $(top_srcdir)/sh-version.sed
sed -f $(top_srcdir)/sh-version.sed < $< > $@
chmod +x $@
+
diff --git a/Makefile b/Makefile
index fd145b1c..212e63d8 100644
--- a/Makefile
+++ b/Makefile
@@ -80,7 +80,7 @@ dist: $(srcdir)/hurd-snap $(addsuffix -lndist,$(filter-out $(subdirs-nodist), $(
clean: $(addsuffix -clean,$(lib-subdirs)) $(addsuffix -clean,$(working-prog-subdirs)) clean-misc
-relink: $(addsuffix -relink,$(prog-subdirs))
+relink: $(addsuffix -relink,$(lib-subdirs) $(prog-subdirs))
install: $(addsuffix -install,$(lib-subdirs) $(working-prog-subdirs) \
$(other-subdirs))
@@ -104,7 +104,7 @@ FORCE:
$(MAKE) -C $* clean no_deps=t
%-relink:
- $(MAKE) -C $* relink
+ $(MAKE) -C $* relink no_deps=t
%-install:
$(MAKE) -C $* install
diff --git a/TODO b/TODO
index 48470063..1e0e690b 100644
--- a/TODO
+++ b/TODO
@@ -270,3 +270,4 @@ List for version 0.2 binary release
* Arrange GCC not to install assert.h on GNU.
* recompile libraries after libc release
* complete `extern inline' proofing of header files.
+* Change all copyright notices to say "GNU Hurd" instead of "This program". \ No newline at end of file