From 9df07f9238080eef0c24f3281c8ebd026a6c1b97 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Fri, 3 Jan 2014 19:00:41 +0100 Subject: [PATCH] muting compiler and binutils optionally Instead of muting all compiler and other binutils output by default, introduce a variable to make this behaviour configurable. --- Makefile.base | 12 ++++++------ Makefile.include | 6 +++--- boards/chronos/Makefile.include | 6 +++--- boards/mbed_lpc1768/Makefile.include | 4 ++-- boards/msb-430-common/Makefile.include | 6 +++--- boards/msba2-common/Makefile.include | 8 ++++---- boards/native/Makefile.include | 4 ++-- boards/redbee-econotag/Makefile.include | 6 +++--- boards/telosb/Makefile.include | 6 +++--- boards/wsn430-common/Makefile.include | 6 +++--- cpu/native/Makefile | 2 +- dist/Makefile | 8 ++++++++ sys/shell/Makefile | 2 +- 13 files changed, 42 insertions(+), 34 deletions(-) diff --git a/Makefile.base b/Makefile.base index dbc33f8811..5ea0a15657 100644 --- a/Makefile.base +++ b/Makefile.base @@ -24,24 +24,24 @@ export CFLAGS += -DVERSION=\"$(GIT_VERSION)\" .PHONY: clean $(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ) - @$(AR) -rc $(BINDIR)$(MODULE).a $(OBJ) $(ASMOBJ) + $(AD)$(AR) -rc $(BINDIR)$(MODULE).a $(OBJ) $(ASMOBJ) # pull in dependency info for *existing* .o files -include $(OBJ:.o=.d) # compile and generate dependency info $(BINDIR)%.o: %.c - @$(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o - @$(CC) $(CFLAGS) $(INCLUDES) -MM $*.c > $(BINDIR)$*.d + $(AD)$(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o + $(AD)$(CC) $(CFLAGS) $(INCLUDES) -MM $*.c > $(BINDIR)$*.d @printf "$(BINDIR)"|cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d $(BINDIR)%.o: %.s - @$(AS) $(ASFLAGS) $*.s -o $(BINDIR)$*.o + $(AD)$(AS) $(ASFLAGS) $*.s -o $(BINDIR)$*.o $(BINDIR)%.o: %.S - @$(CC) -c $(CFLAGS) $*.S -o $(BINDIR)$*.o + $(AD)$(CC) -c $(CFLAGS) $*.S -o $(BINDIR)$*.o # remove compilation products clean:: - @rm -f $(BINDIR)$(MODULE).a $(OBJ) $(DEP) $(ASMOBJ) + $(AD)rm -f $(BINDIR)$(MODULE).a $(OBJ) $(DEP) $(ASMOBJ) diff --git a/Makefile.include b/Makefile.include index 346b3cdcca..ab1ae07558 100644 --- a/Makefile.include +++ b/Makefile.include @@ -54,7 +54,7 @@ all: $(BINDIR)$(PROJECT).a "$(MAKE)" -C $(RIOTBASE) @for i in $(EXTERNAL_MODULES) ; do "$(MAKE)" -C $$i ; done ; ifeq ($(BUILDOSXNATIVE),1) - @$(LINK) $(UNDEF) -o $(BINDIR)$(PROJECT).elf $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie + $(LINK) $(UNDEF) -o $(BINDIR)$(PROJECT).elf $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie else @$(LINK) $(UNDEF) -o $(BINDIR)$(PROJECT).elf -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=$(BINDIR)$(PROJECT).map $(LINKFLAGS) @$(SIZE) $(BINDIR)$(PROJECT).elf @@ -73,7 +73,7 @@ SRC = $(wildcard *.c) OBJ = $(SRC:%.c=${BINDIR}%.o) $(BINDIR)$(PROJECT).a: $(OBJ) - $(AR) -rc $(BINDIR)$(PROJECT).a $(OBJ) + $(AD)$(AR) -rc $(BINDIR)$(PROJECT).a $(OBJ) # pull in dependency info for *existing* .o files -include $(OBJ:.o=.d) @@ -81,7 +81,7 @@ $(BINDIR)$(PROJECT).a: $(OBJ) $(BINDIR)%.o: %.c $(PROJDEPS) @echo; echo "Compiling.... $*.c"; echo @test -d $(BINDIR) || mkdir -p $(BINDIR) - $(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o + $(AD)$(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o clean: "$(MAKE)" -C $(RIOTBOARD)/$(BOARD) clean diff --git a/boards/chronos/Makefile.include b/boards/chronos/Makefile.include index bf2869c5f7..f3c9891a3f 100644 --- a/boards/chronos/Makefile.include +++ b/boards/chronos/Makefile.include @@ -5,9 +5,9 @@ export CPU = cc430 export MCU = cc430f6137 # toolchain config -export PREFIX = @msp430- -export CC = @$(PREFIX)gcc -export AR = @$(PREFIX)ar +export PREFIX = msp430- +export CC = $(PREFIX)gcc +export AR = $(PREFIX)ar export CFLAGS += -std=gnu99 -Wstrict-prototypes -gdwarf-2 -Os -Wall -mmcu=$(MCU) -D CC430 export ASFLAGS += -mmcu=$(MCU) --defsym $(MCU)=1 --gdwarf-2 export AS = $(PREFIX)as diff --git a/boards/mbed_lpc1768/Makefile.include b/boards/mbed_lpc1768/Makefile.include index d750209409..fa2ff2de70 100644 --- a/boards/mbed_lpc1768/Makefile.include +++ b/boards/mbed_lpc1768/Makefile.include @@ -3,8 +3,8 @@ export CPU = lpc1768 # toolchain config export PREFIX = arm-none-eabi- -export CC = @$(PREFIX)gcc -export AR = @$(PREFIX)ar +export CC = $(PREFIX)gcc +export AR = $(PREFIX)ar export CFLAGS += -DUSE_STDPERIPH_DRIVER -ggdb -g3 -std=gnu99 -O0 -Wall -Wstrict-prototypes -mcpu=cortex-m3 $(FPU_USAGE) -mlittle-endian -mthumb -mthumb-interwork -nostartfiles export ASFLAGS = -ggdb -g3 -mcpu=cortex-m3 $(FPU_USAGE) -mlittle-endian export AS = $(PREFIX)as diff --git a/boards/msb-430-common/Makefile.include b/boards/msb-430-common/Makefile.include index 57b5e6e053..d25fd8efee 100644 --- a/boards/msb-430-common/Makefile.include +++ b/boards/msb-430-common/Makefile.include @@ -3,9 +3,9 @@ export CPU = msp430x16x export MCU = msp430f1612 # toolchain config -export PREFIX = @msp430- -export CC = @$(PREFIX)gcc -export AR = @$(PREFIX)ar +export PREFIX = msp430- +export CC = $(PREFIX)gcc +export AR = $(PREFIX)ar export CFLAGS += -std=gnu99 -Wstrict-prototypes -gdwarf-2 -Os -Wall -mmcu=$(MCU) export ASFLAGS += -mmcu=$(MCU) --defsym $(MCU)=1 --gdwarf-2 export AS = $(PREFIX)as diff --git a/boards/msba2-common/Makefile.include b/boards/msba2-common/Makefile.include index a0a4937c91..85589d8162 100644 --- a/boards/msba2-common/Makefile.include +++ b/boards/msba2-common/Makefile.include @@ -2,10 +2,10 @@ export CPU = lpc2387 # toolchain config -export PREFIX = @arm-none-eabi- -#export PREFIX = @arm-elf- -export CC = @$(PREFIX)gcc -export AR = @$(PREFIX)ar +export PREFIX = arm-none-eabi- +#export PREFIX = arm-elf- +export CC = $(PREFIX)gcc +export AR = $(PREFIX)ar export CFLAGS += -std=gnu99 -O2 -Wall -Wstrict-prototypes -mcpu=arm7tdmi-s -gdwarf-2 export ASFLAGS = -gdwarf-2 -mcpu=arm7tdmi-s export AS = $(PREFIX)as diff --git a/boards/native/Makefile.include b/boards/native/Makefile.include index 46231f89dc..06798698a2 100644 --- a/boards/native/Makefile.include +++ b/boards/native/Makefile.include @@ -3,8 +3,8 @@ export CPU = native # toolchain config export PREFIX = -#export CC = @$(PREFIX)gcc -export AR = @$(PREFIX)ar +#export CC = $(PREFIX)gcc +export AR = $(PREFIX)ar export CFLAGS += -std=gnu99 -Wall -Wextra -pedantic -m32 export ASFLAGS = export AS = $(PREFIX)as diff --git a/boards/redbee-econotag/Makefile.include b/boards/redbee-econotag/Makefile.include index e21f45ba00..f513dbd888 100644 --- a/boards/redbee-econotag/Makefile.include +++ b/boards/redbee-econotag/Makefile.include @@ -2,9 +2,9 @@ export CPU = mc1322x # toolchain config -export PREFIX = @arm-none-eabi- -export CC = @$(PREFIX)gcc -export AR = @$(PREFIX)ar +export PREFIX = arm-none-eabi- +export CC = $(PREFIX)gcc +export AR = $(PREFIX)ar export CFLAGS += -std=gnu99 -march=armv4t -mtune=arm7tdmi-s -mlong-calls \ -msoft-float -mthumb-interwork -fno-strict-aliasing -fno-common \ -ffixed-r8 -ffunction-sections -ffreestanding -fno-builtin \ diff --git a/boards/telosb/Makefile.include b/boards/telosb/Makefile.include index 343d741408..8d72d2ffc4 100644 --- a/boards/telosb/Makefile.include +++ b/boards/telosb/Makefile.include @@ -4,9 +4,9 @@ export CPU = msp430x16x export MCU = msp430f1611 # toolchain config -export PREFIX = @msp430- -export CC = @$(PREFIX)gcc -export AR = @$(PREFIX)ar +export PREFIX = msp430- +export CC = $(PREFIX)gcc +export AR = $(PREFIX)ar export CFLAGS += -std=gnu99 -Wstrict-prototypes -gdwarf-2 -Os -Wall -mmcu=$(MCU) export ASFLAGS += -mmcu=$(MCU) --defsym $(MCU)=1 --gdwarf-2 export AS = $(PREFIX)as diff --git a/boards/wsn430-common/Makefile.include b/boards/wsn430-common/Makefile.include index dadc60bc65..4ecffabafa 100644 --- a/boards/wsn430-common/Makefile.include +++ b/boards/wsn430-common/Makefile.include @@ -3,9 +3,9 @@ export CPU = msp430x16x export MCU = msp430f1611 # toolchain config -export PREFIX = @msp430- -export CC = @$(PREFIX)gcc -export AR = @$(PREFIX)ar +export PREFIX = msp430- +export CC = $(PREFIX)gcc +export AR = $(PREFIX)ar export CFLAGS += -std=gnu99 -Wstrict-prototypes -gdwarf-2 -Os -Wall -mmcu=$(MCU) export ASFLAGS += -mmcu=$(MCU) --defsym $(MCU)=1 --gdwarf-2 export AS = $(PREFIX)as diff --git a/cpu/native/Makefile b/cpu/native/Makefile index d8e6b930b1..a6f241ddce 100644 --- a/cpu/native/Makefile +++ b/cpu/native/Makefile @@ -16,7 +16,7 @@ all: $(BINDIR)$(MODULE).a include $(RIOTBASE)/Makefile.base $(BINDIR)%.o: %.c - $(CC) $(CFLAGS) $(filter-out $(EXCLUDES),$(INCLUDES)) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o + $(AD)$(CC) $(CFLAGS) $(filter-out $(EXCLUDES),$(INCLUDES)) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o @$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -MM $*.c > $(BINDIR)$*.d @printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d diff --git a/dist/Makefile b/dist/Makefile index 22423602cb..36e93b9795 100644 --- a/dist/Makefile +++ b/dist/Makefile @@ -35,4 +35,12 @@ export RIOTBASE =$(CURDIR)/../../RIOT export INCLUDES = -I$(RIOTBOARD)/$(BOARD)/include -I$(RIOTBASE)/core/include -I$(RIOTCPU)/$(CPU)/include -I$(RIOTBASE)/sys/lib -I$(RIOTBASE)/sys/include/ -I$(RIOTBASE)/drivers/include/ +QUITE := 1 +ifeq($(QUITE),1) + AD=@ +else + AD= +endif +export AD + include $(RIOTBASE)/Makefile.include diff --git a/sys/shell/Makefile b/sys/shell/Makefile index 0b5b6d05e1..9dbd84c1b9 100644 --- a/sys/shell/Makefile +++ b/sys/shell/Makefile @@ -12,7 +12,7 @@ $(BINDIR)$(MODULE).a: $(OBJ) # compile and generate dependency info $(BINDIR)%.o: %.c - @$(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o + $(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o @$(CC) $(CFLAGS) $(INCLUDES) -MM $*.c > $(BINDIR)$*.d @printf "$(BINDIR)"|cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d