1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

muting compiler and binutils optionally

Instead of muting all compiler and other binutils output by default,
introduce a variable to make this behaviour configurable.
This commit is contained in:
Oleg Hahm 2014-01-03 19:00:41 +01:00
parent 79cff89bb0
commit 9df07f9238
13 changed files with 42 additions and 34 deletions

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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

8
dist/Makefile vendored
View File

@ -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

View File

@ -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