* Build system tweaks @ 2012-06-13 5:22 Luca Barbato 2012-06-13 5:22 ` [PATCH 1/3] makefile: add silent rules Luca Barbato ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Luca Barbato @ 2012-06-13 5:22 UTC (permalink / raw) To: musl Hi, I'm trying to get musl supported in Gentoo crossdev. Once I'm done Gentoo and Sabayon users will be able to install a working cross-toolchain by just issuing `crossdev x86_64-pc-linux-musl` and similar. I'm quite close to success in getting the toolchain with musl considered a 'bare-metal' libc by gcc, hopefully I'll have more time to figure out how to make gcc behave a little better. (config.site and gnuconfig changes will be posted for discussion later) Last summer I told Dalias I'd try to prepare a Gentoo stage3 once musl would be closer to be more complete thus I'm starting. ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3] makefile: add silent rules 2012-06-13 5:22 Build system tweaks Luca Barbato @ 2012-06-13 5:22 ` Luca Barbato 2012-06-13 6:27 ` Szabolcs Nagy 2012-06-13 7:34 ` John Spencer 2012-06-13 5:22 ` [PATCH 2/3] cosmetic: remove trailing whitespace Luca Barbato 2012-06-13 5:22 ` [PATCH 3/3] makefile: split install target Luca Barbato 2 siblings, 2 replies; 9+ messages in thread From: Luca Barbato @ 2012-06-13 5:22 UTC (permalink / raw) To: musl make V=1 to disable them --- Makefile | 60 ++++++++++++++++++++++++++++++++++++++---------------------- 1 files changed, 38 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 1bdea61..389486e 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,8 @@ CFLAGS_ALL_SHARED = $(CFLAGS_ALL) -fPIC -DSHARED -O3 AR = $(CROSS_COMPILE)ar RANLIB = $(CROSS_COMPILE)ranlib +INSTALL = install +LN = ln -sf ALL_INCLUDES = $(sort $(wildcard include/*.h include/*/*.h) $(GENH)) @@ -47,6 +49,20 @@ TOOL_LIBS = lib/musl-gcc.specs ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS) ALL_TOOLS = tools/musl-gcc +ifndef V +Q = @ +ECHO = printf "$(1)\t%s\n" $(2) +BRIEF = CC AS AR LD HOSTCC SH LN +SILENT = DEPCC RM RANLIB +MSG = $@ +M = @$(call ECHO,$(TAG),$@); +$(foreach VAR,$(BRIEF), \ + $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR)))) +$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR)))) +$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL)) +endif + + LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH).so.1 -include config.mak @@ -56,25 +72,25 @@ all: $(ALL_LIBS) $(ALL_TOOLS) install: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%) $(ALL_TOOLS:tools/%=$(DESTDIR)$(bindir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),) clean: - rm -f crt/*.o - rm -f $(OBJS) - rm -f $(LOBJS) - rm -f $(ALL_LIBS) lib/*.[ao] lib/*.so - rm -f $(ALL_TOOLS) - rm -f $(GENH) - rm -f include/bits + $(RM) crt/*.o + $(RM) $(OBJS) + $(RM) $(LOBJS) + $(RM) $(ALL_LIBS) lib/*.[ao] lib/*.so + $(RM) $(ALL_TOOLS) + $(RM) $(GENH) + $(RM) include/bits distclean: clean - rm -f config.mak + $(RM) config.mak include/bits: @test "$(ARCH)" || { echo "Please set ARCH in config.mak before running make." ; exit 1 ; } - ln -sf ../arch/$(ARCH)/bits $@ + $(Q)ln -sf ../arch/$(ARCH)/bits $@ include/bits/alltypes.h.sh: include/bits include/bits/alltypes.h: include/bits/alltypes.h.sh - sh $< > $@ + $(Q)sh $< > $@ %.o: $(ARCH)/%.s $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $< @@ -94,41 +110,41 @@ lib/libc.so: $(LOBJS) -Wl,-soname=libc.so -o $@ $(LOBJS) -lgcc lib/libc.a: $(OBJS) - rm -f $@ + $(RM) $@ $(AR) rc $@ $(OBJS) $(RANLIB) $@ $(EMPTY_LIBS): - rm -f $@ + $(RM) $@ $(AR) rc $@ lib/%.o: crt/%.o - cp $< $@ + $(Q)cp $< $@ lib/musl-gcc.specs: tools/musl-gcc.specs.sh config.mak - sh $< "$(includedir)" "$(libdir)" "$(LDSO_PATHNAME)" > $@ + $(Q)sh $< "$(includedir)" "$(libdir)" "$(LDSO_PATHNAME)" > $@ tools/musl-gcc: config.mak - printf '#!/bin/sh\nexec gcc "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@ - chmod +x $@ + $(Q)printf '#!/bin/sh\nexec gcc "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@ + $(Q)chmod +x $@ $(DESTDIR)$(bindir)/%: tools/% - install -D $< $@ + $(INSTALL) -D $< $@ $(DESTDIR)$(libdir)/%.so: lib/%.so - install -D -m 755 $< $@ + $(INSTALL) -D -m 755 $< $@ $(DESTDIR)$(libdir)/%: lib/% - install -D -m 644 $< $@ + $(INSTALL) -D -m 644 $< $@ $(DESTDIR)$(includedir)/%: include/% - install -D -m 644 $< $@ + $(INSTALL) -D -m 644 $< $@ $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(syslibdir) - ln -sf $(libdir)/libc.so $@ || true + $(LN) $(libdir)/libc.so $@ || true $(DESTDIR)$(syslibdir): - install -d -m 755 $(DESTDIR)$(syslibdir) + $(INSTALL) -d -m 755 $(DESTDIR)$(syslibdir) .PRECIOUS: $(CRT_LIBS:lib/%=crt/%) -- 1.7.8.rc1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] makefile: add silent rules 2012-06-13 5:22 ` [PATCH 1/3] makefile: add silent rules Luca Barbato @ 2012-06-13 6:27 ` Szabolcs Nagy 2012-06-13 7:46 ` Luca Barbato 2012-06-13 7:34 ` John Spencer 1 sibling, 1 reply; 9+ messages in thread From: Szabolcs Nagy @ 2012-06-13 6:27 UTC (permalink / raw) To: musl * Luca Barbato <lu_zero@gentoo.org> [2012-06-13 07:22:01 +0200]: > make V=1 to disable them we already discussed that silent should not be the default so you may want to add V ?= 1 at the top and instead of > +ifndef V use ifeq ($(strip $(V)),) ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] makefile: add silent rules 2012-06-13 6:27 ` Szabolcs Nagy @ 2012-06-13 7:46 ` Luca Barbato 0 siblings, 0 replies; 9+ messages in thread From: Luca Barbato @ 2012-06-13 7:46 UTC (permalink / raw) To: musl On 06/13/2012 08:27 AM, Szabolcs Nagy wrote: > * Luca Barbato <lu_zero@gentoo.org> [2012-06-13 07:22:01 +0200]: >> make V=1 to disable them > > we already discussed that silent should not be the default Righ ^^; > so you may want to add > V ?= 1 > at the top > > and instead of >> +ifndef V > > use > ifeq ($(strip $(V)),) Yes, sorry for the botched repost. lu -- Luca Barbato Gentoo/linux http://dev.gentoo.org/~lu_zero ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] makefile: add silent rules 2012-06-13 5:22 ` [PATCH 1/3] makefile: add silent rules Luca Barbato 2012-06-13 6:27 ` Szabolcs Nagy @ 2012-06-13 7:34 ` John Spencer 2012-06-13 7:45 ` Luca Barbato 1 sibling, 1 reply; 9+ messages in thread From: John Spencer @ 2012-06-13 7:34 UTC (permalink / raw) To: musl; +Cc: Luca Barbato On 06/13/2012 07:22 AM, Luca Barbato wrote: > make V=1 to disable them are you blind or just stubborn ? you already got your NO last time. On 06/07/2012 10:13 AM, Luca Barbato wrote: > make V=1 to disable them On 06/07/2012 03:12 PM, Igmar Palsenberg wrote: > >> make V=1 to disable them > <snip> > > This was NACK'ed a month ago. I'm with the NACK crew, I hardly find this useful, and I like fast scrolling terminals :) > > > > Igmar > > On 06/07/2012 03:18 PM, Rich Felker wrote: > On Thu, Jun 07, 2012 at 03:12:48PM +0200, Igmar Palsenberg wrote: >> >>> make V=1 to disable them >> <snip> >> >> This was NACK'ed a month ago. I'm with the NACK crew, I hardly find >> this useful, and I like fast scrolling terminals :) > I'm not as adamant on it, but I'm also in the group that doesn't like > this "new style" of makefile output. Most annoyingly, when something > goes wrong, you have to re-run make with V=1 to see what was actually > happening. Oftentimes I find I want to rerun a command with -S instead > of -c (to examine the generated asm) or with different CFLAGS when > dealing with an unexpected ICE or similar. On 06/07/2012 03:19 PM, John Spencer wrote: > On 06/07/2012 10:13 AM, Luca Barbato wrote: >> make V=1 to disable them >> --- >> > please see the mail georgi sent to the list at 13th may and the > followup responses. > > maybe 10% of users want a "quiet" build, so why force your preference > on anybody ? > > if it was the other way around (explicitly enable the "quiet" stuff), > i wouldn't be as opposed to this idea. > but effectively it gains you nothing except "awesome looks" *sigh*, > and adds additional bloat to the Makefile. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] makefile: add silent rules 2012-06-13 7:34 ` John Spencer @ 2012-06-13 7:45 ` Luca Barbato 2012-06-13 9:45 ` John Spencer 0 siblings, 1 reply; 9+ messages in thread From: Luca Barbato @ 2012-06-13 7:45 UTC (permalink / raw) To: John Spencer; +Cc: musl On 06/13/2012 09:34 AM, John Spencer wrote: > On 06/13/2012 07:22 AM, Luca Barbato wrote: >> make V=1 to disable them > > are you blind or just stubborn ? > you already got your NO last time. I forgot to update that part to be disabled by default, sorry. lu -- Luca Barbato Gentoo/linux http://dev.gentoo.org/~lu_zero ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] makefile: add silent rules 2012-06-13 7:45 ` Luca Barbato @ 2012-06-13 9:45 ` John Spencer 0 siblings, 0 replies; 9+ messages in thread From: John Spencer @ 2012-06-13 9:45 UTC (permalink / raw) To: musl; +Cc: Luca Barbato On 06/13/2012 09:45 AM, Luca Barbato wrote: > On 06/13/2012 09:34 AM, John Spencer wrote: >> On 06/13/2012 07:22 AM, Luca Barbato wrote: >>> make V=1 to disable them >> are you blind or just stubborn ? >> you already got your NO last time. > I forgot to update that part to be disabled by default, sorry. > i see. apologies for my impolite wording. hopefully we can focuse more on adding real value to musl, instead of starting bikesheds about cosmetical non-issues. ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/3] cosmetic: remove trailing whitespace 2012-06-13 5:22 Build system tweaks Luca Barbato 2012-06-13 5:22 ` [PATCH 1/3] makefile: add silent rules Luca Barbato @ 2012-06-13 5:22 ` Luca Barbato 2012-06-13 5:22 ` [PATCH 3/3] makefile: split install target Luca Barbato 2 siblings, 0 replies; 9+ messages in thread From: Luca Barbato @ 2012-06-13 5:22 UTC (permalink / raw) To: musl --- Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 389486e..4bc1b63 100644 --- a/Makefile +++ b/Makefile @@ -22,10 +22,10 @@ LOBJS = $(OBJS:.o=.lo) GENH = include/bits/alltypes.h IMPH = src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/libc.h -LDFLAGS = +LDFLAGS = CPPFLAGS = CFLAGS = -Os -pipe -CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc +CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc CFLAGS_ALL = $(CFLAGS_C99FSE) CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I./src/internal -I./include -I./arch/$(ARCH) -- 1.7.8.rc1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/3] makefile: split install target 2012-06-13 5:22 Build system tweaks Luca Barbato 2012-06-13 5:22 ` [PATCH 1/3] makefile: add silent rules Luca Barbato 2012-06-13 5:22 ` [PATCH 2/3] cosmetic: remove trailing whitespace Luca Barbato @ 2012-06-13 5:22 ` Luca Barbato 2 siblings, 0 replies; 9+ messages in thread From: Luca Barbato @ 2012-06-13 5:22 UTC (permalink / raw) To: musl Introduce install-headers, install-libs, install-tools --- Makefile | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4bc1b63..0c2b0d5 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH).so.1 all: $(ALL_LIBS) $(ALL_TOOLS) -install: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%) $(ALL_TOOLS:tools/%=$(DESTDIR)$(bindir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),) +install: install-libs install-headers install-tools clean: $(RM) crt/*.o @@ -146,6 +146,14 @@ $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(syslibdir) $(DESTDIR)$(syslibdir): $(INSTALL) -d -m 755 $(DESTDIR)$(syslibdir) +install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),) + +install-headers: $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%) + +install-tools: $(ALL_TOOLS:tools/%=$(DESTDIR)$(bindir)/%) + + + .PRECIOUS: $(CRT_LIBS:lib/%=crt/%) -.PHONY: all clean install +.PHONY: all clean install install-libs install-headers install-tools -- 1.7.8.rc1 ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-06-13 9:45 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-06-13 5:22 Build system tweaks Luca Barbato 2012-06-13 5:22 ` [PATCH 1/3] makefile: add silent rules Luca Barbato 2012-06-13 6:27 ` Szabolcs Nagy 2012-06-13 7:46 ` Luca Barbato 2012-06-13 7:34 ` John Spencer 2012-06-13 7:45 ` Luca Barbato 2012-06-13 9:45 ` John Spencer 2012-06-13 5:22 ` [PATCH 2/3] cosmetic: remove trailing whitespace Luca Barbato 2012-06-13 5:22 ` [PATCH 3/3] makefile: split install target Luca Barbato
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/musl/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).