Quieten build system.
This commit is contained in:
parent
1eac78b1c8
commit
0d99e22a26
17
Makefile
17
Makefile
|
@ -1,13 +1,18 @@
|
|||
ifneq ($(V), 1)
|
||||
MFLAGS += --no-print-dir
|
||||
Q := @
|
||||
endif
|
||||
|
||||
all:
|
||||
@if [ ! -f libopencm3/Makefile ]; then \
|
||||
$(Q)if [ ! -f libopencm3/Makefile ]; then \
|
||||
echo "Initialising git submodules..." ;\
|
||||
git submodule init ;\
|
||||
git submodule update ;\
|
||||
fi
|
||||
$(MAKE) -C libopencm3 lib
|
||||
$(MAKE) -C src
|
||||
$(Q)$(MAKE) $(MFLAGS) -C libopencm3 lib
|
||||
$(Q)$(MAKE) $(MFLAGS) -C src
|
||||
|
||||
%:
|
||||
$(MAKE) -C libopencm3 $@
|
||||
$(MAKE) -C src $@
|
||||
clean:
|
||||
$(Q)$(MAKE) $(MFLAGS) -C libopencm3 $@
|
||||
$(Q)$(MAKE) $(MFLAGS) -C src $@
|
||||
|
||||
|
|
31
src/Makefile
31
src/Makefile
|
@ -2,6 +2,11 @@ PROBE_HOST ?= native
|
|||
PLATFORM_DIR = platforms/$(PROBE_HOST)
|
||||
VPATH += platforms/common $(PLATFORM_DIR)
|
||||
|
||||
ifneq ($(V), 1)
|
||||
MAKEFLAGS += --no-print-dir
|
||||
Q := @
|
||||
endif
|
||||
|
||||
BUILDDATE := `date +"%Y%m%d"`
|
||||
|
||||
CFLAGS += -Wall -Wextra -Wno-pointer-sign -Wno-char-subscripts\
|
||||
|
@ -45,29 +50,37 @@ include $(PLATFORM_DIR)/Makefile.inc
|
|||
OBJ = $(SRC:.c=.o)
|
||||
|
||||
blackmagic: $(OBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
@echo " LD $@"
|
||||
$(Q)$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
%.o: %.c
|
||||
@echo " CC $<"
|
||||
$(Q)$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
%.bin: %
|
||||
$(OBJCOPY) -O binary $^ $@
|
||||
@echo " OBJCOPY $@"
|
||||
$(Q)$(OBJCOPY) -O binary $^ $@
|
||||
|
||||
%.hex: %
|
||||
$(OBJCOPY) -O ihex $^ $@
|
||||
@echo " OBJCOPY $@"
|
||||
$(Q)$(OBJCOPY) -O ihex $^ $@
|
||||
|
||||
.PHONY: clean host_clean all_platforms
|
||||
|
||||
clean: host_clean
|
||||
-$(RM) *.o *.d *~ blackmagic $(HOSTFILES)
|
||||
-$(RM) platforms/*/*.o platforms/*/*.d mapfile
|
||||
$(Q)echo " CLEAN"
|
||||
-$(Q)$(RM) -f *.o *.d *~ blackmagic $(HOSTFILES)
|
||||
-$(Q)$(RM) -f platforms/*/*.o platforms/*/*.d mapfile
|
||||
|
||||
all_platforms:
|
||||
set -e ;\
|
||||
$(Q)set -e ;\
|
||||
for i in platforms/*/Makefile.inc ; do \
|
||||
export DIRNAME=`dirname $$i` ;\
|
||||
export PROBE_HOST=`basename $$DIRNAME` ;\
|
||||
export CFLAGS=-Werror ;\
|
||||
echo $$PROBE_HOST ;\
|
||||
$(MAKE) clean ;\
|
||||
$(MAKE) ;\
|
||||
echo "Building for hardware platform: $$PROBE_HOST" ;\
|
||||
$(MAKE) $(MAKEFLAGS) clean ;\
|
||||
$(MAKE) $(MAKEFLAGS);\
|
||||
if [ -f blackmagic.bin ]; then \
|
||||
mv blackmagic.bin blackmagic-$$PROBE_HOST.bin ;\
|
||||
fi ;\
|
||||
|
|
|
@ -25,4 +25,4 @@ SRC += cdcacm.c \
|
|||
all: blackmagic.bin
|
||||
|
||||
host_clean:
|
||||
-rm blackmagic.bin
|
||||
-$(Q)$(RM) blackmagic.bin
|
||||
|
|
|
@ -24,9 +24,9 @@ SRC += cdcacm.c \
|
|||
all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex
|
||||
|
||||
blackmagic_dfu: usbdfu.o dfucore.o dfu_f1.o
|
||||
$(CC) $^ -o $@ $(LDFLAGS_BOOT)
|
||||
|
||||
@echo " LD $@"
|
||||
$(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT)
|
||||
|
||||
host_clean:
|
||||
-rm blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex
|
||||
-$(Q)$(RM) -f blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex
|
||||
|
||||
|
|
|
@ -23,11 +23,13 @@ SRC += cdcacm.c \
|
|||
all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex dfu_upgrade.bin dfu_upgrade.hex
|
||||
|
||||
blackmagic_dfu: usbdfu.o dfucore.o dfu_f1.o
|
||||
$(CC) $^ -o $@ $(LDFLAGS_BOOT)
|
||||
@echo " LD $@"
|
||||
$(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT)
|
||||
|
||||
dfu_upgrade: dfu_upgrade.o dfucore.o dfu_f1.o
|
||||
$(CC) $^ -o $@ $(LDFLAGS)
|
||||
@echo " LD $@"
|
||||
$(Q)$(CC) $^ -o $@ $(LDFLAGS)
|
||||
|
||||
host_clean:
|
||||
-rm blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex dfu_upgrade dfu_upgrade.bin dfu_upgrade.hex
|
||||
-$(Q)$(RM) blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex dfu_upgrade dfu_upgrade.bin dfu_upgrade.hex
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@ SRC += cdcacm.c \
|
|||
all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex
|
||||
|
||||
blackmagic_dfu: usbdfu.o dfucore.o dfu_f1.o
|
||||
$(CC) $^ -o $@ $(LDFLAGS_BOOT)
|
||||
@echo " LD $@"
|
||||
$(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT)
|
||||
|
||||
host_clean:
|
||||
-rm blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex
|
||||
-$(Q)$(RM) blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex
|
||||
|
||||
|
|
Loading…
Reference in New Issue