Skip to content

Commit

Permalink
Silent build bugfixes.
Browse files Browse the repository at this point in the history
The silent build work had a few cosmetic bugs. Notably,
$(describe-install-target ...), which is run to print a description of things
being installed, wasn't stripping the directory part from filenames being
installed, leading to ridiculous output like

INSTALL: buildroot/usr/include/sys/uts/common/sys/dtrace.h

which should be

INSTALL: buildroot/usr/include/sys/dtrace.h

Finally, when linking static libraries the libraries were always being reported
as something like

AR: lib_TARGET.a

rather than

AR: libport.a

which is clearly wrong.
  • Loading branch information
nickalcock committed May 18, 2012
1 parent bfa26c0 commit 54571c2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Expand Up @@ -64,6 +64,14 @@
(tags): Fix filename.
(realclean): Like clean, only removes tags files too.

* Makefunctions (describe-install-target): Strip the
path from the name.
(lib-template): Expand the TARGET in the description of the built
library.
* libdtrace/Build (install): Strip the path from the installed
object descriptions.
* uts/Build (install): Likewise.

2012-04-17 Nick Alcock <nick.alcock@oracle.com>

* libctf/ctf_create.c (ctf_add_member): Re-express in terms
Expand Down
6 changes: 3 additions & 3 deletions Makefunctions
Expand Up @@ -42,10 +42,10 @@ define describe-target
$(if $(filter-out $(verbose),no),,$(foreach name,$(2),printf '%s: %s\n' '$(1)' '$(name)';))
endef

# Describe an installation target.
# Describe an installation target. All paths on the 'names' are stripped.
# Syntax: $(call describe-install-target,directory,names)
define describe-install-target
$(call describe-target,INSTALL,$(addprefix $(1)/,$(2)))
$(call describe-target,INSTALL,$(addprefix $(1)/,$(notdir $(2))))
endef

# Rule to build a C source file.
Expand All @@ -66,7 +66,7 @@ define build-lib-template
$(objdir)/build-$($(1)_TARGET).a: $(foreach source,$($(1)_SOURCES),$(call obj-name,$(1),$(source))) \
$(foreach dep,$(filter-out %.o,$($(1)_DEPS)),$(addprefix $(objdir)/,$(dep))) \
$(foreach dep,$(filter %.o,$($(1)_DEPS)),$(call obj-name,$(1),$(dep)))
$(call describe-target,BUILD-AR,$(1)_TARGET.a)
$(call describe-target,BUILD-AR,$($(1)_TARGET).a)
ar rc $(objdir)/build-$($(1)_TARGET).a $(foreach source,$($(1)_SOURCES),$(call obj-name,$(1),$(source)))
$(foreach post,$($(1)_POST),$(call $(post),$(objdir)/build-$($(1)_TARGET).a))

Expand Down
6 changes: 3 additions & 3 deletions libdtrace/Build
Expand Up @@ -175,11 +175,11 @@ install::
mkdir -p $(LIBDIR)/dtrace $(INCLUDEDIR)
$(call describe-install-target,$(INCLUDEDIR),dtrace.h)
install -m 644 $(libdtrace-build_DIR)dtrace.h $(INCLUDEDIR)
$(call describe-install-target,$(LIBDIR),$(objdir)/$(libdtrace_TARGET).so.$(libdtrace_VERSION))
$(call describe-install-target,$(LIBDIR),$(libdtrace_TARGET).so.$(libdtrace_VERSION))
install -m 755 -o root -g root $(objdir)/$(libdtrace_TARGET).so.$(libdtrace_VERSION) $(LIBDIR)
$(call describe-install-target,$(LIBDIR),$(objdir)/$(libdtrace_SONAME))
$(call describe-install-target,$(LIBDIR),$(libdtrace_SONAME))
ln -sf libdtrace.so.$(libdtrace_VERSION) $(LIBDIR)/$(libdtrace_SONAME)
$(call describe-install-target,$(LIBDIR),$(objdir)/$(libdtrace_TARGET).so)
$(call describe-install-target,$(LIBDIR),$(libdtrace_TARGET).so)
ln -sf libdtrace.so.$(libdtrace_VERSION) $(LIBDIR)/$(libdtrace_TARGET).so
$(call describe-install-target,$(LIBDIR)/dtrace,$(DRTI_OBJ))
install -m 644 -o root -g root $(DRTI_OBJ) $(LIBDIR)/dtrace
Expand Down
2 changes: 1 addition & 1 deletion uts/Build
Expand Up @@ -29,6 +29,6 @@ HEADERS_INSTALL := common/sys/dtrace.h \

install::
mkdir -p $(INCLUDEDIR)/sys
$(call describe-install-target,$(INCLUDEDIR)/sys,$(HEADERS_INSTALL))
$(call describe-install-target,$(INCLUDEDIR)/sys,$(notdir $(HEADERS_INSTALL)))
cd $(uts_DIR) && install -m 644 -o root -g root $(HEADERS_INSTALL) \
$(INCLUDEDIR)/sys

0 comments on commit 54571c2

Please sign in to comment.