Skip to content

Commit

Permalink
muting compiler and binutils optionally
Browse files Browse the repository at this point in the history
Instead of muting all compiler and other binutils output by default,
introduce a variable to make this behaviour configurable.
  • Loading branch information
OlegHahm committed Jan 5, 2014
1 parent 79cff89 commit 9df07f9
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 34 deletions.
12 changes: 6 additions & 6 deletions Makefile.base
Original file line number Diff line number Diff line change
Expand Up @@ -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)

6 changes: 3 additions & 3 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -73,15 +73,15 @@ 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)

$(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
Expand Down
6 changes: 3 additions & 3 deletions boards/chronos/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions boards/mbed_lpc1768/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions boards/msb-430-common/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions boards/msba2-common/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions boards/native/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions boards/redbee-econotag/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 3 additions & 3 deletions boards/telosb/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions boards/wsn430-common/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cpu/native/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions dist/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion sys/shell/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9df07f9

Please sign in to comment.