From 3f3ff9e8681ef9a26f602a5ee00cf54374eeb730 Mon Sep 17 00:00:00 2001 From: Nathan Ramanathan Date: Thu, 23 Apr 2020 02:38:24 -0500 Subject: [PATCH 1/2] Port tags to know which system we are making when dealing with external makefiles in big projects. --- example/Makefile.inc | 12 ++++++++- port/ez430-rf2560/Makefile | 17 +++++++------ port/libusb-intel/Makefile | 2 +- port/libusb/Makefile | 2 +- port/msp-exp430f5438-cc2564b/Makefile | 29 +++++++++++----------- port/msp430f5229lp-cc2564b/Makefile | 14 +++++------ port/mtk/Makefile | 9 ++++--- port/nrf5x/pca10028/armgcc/Makefile | 0 port/posix-h4-atwilc3000/Makefile | 1 + port/posix-h4-da14581/Makefile | 2 +- port/posix-h4-da14585/Makefile | 2 +- port/posix-h4-zephyr/Makefile | 4 +-- port/posix-h4/Makefile | 4 +-- port/posix-h5-bcm/Makefile | 3 ++- port/posix-h5/Makefile | 1 + port/raspi/Makefile | 3 ++- port/stm32-f103rb-nucleo/Makefile | 6 ++--- port/stm32-f4discovery-cc256x/Makefile | 21 ++++++++-------- port/stm32-l073rz-nucleo-em9304/Makefile | 27 ++++++++++---------- port/stm32-wb55xx-nucleo-freertos/Makefile | 27 ++++++++++---------- port/windows-h4-zephyr/Makefile | 1 + port/windows-h4/Makefile | 1 + port/windows-winusb-intel/Makefile | 1 + port/windows-winusb/Makefile | 1 + 24 files changed, 107 insertions(+), 83 deletions(-) mode change 100755 => 100644 port/nrf5x/pca10028/armgcc/Makefile diff --git a/example/Makefile.inc b/example/Makefile.inc index 0513406196..d92587728b 100644 --- a/example/Makefile.inc +++ b/example/Makefile.inc @@ -428,9 +428,19 @@ ublox_spp_le_counter: ublox_spp_le_counter.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ mesh_node_demo: mesh_node_demo.h ${CORE_OBJ} ${COMMON_OBJ} ${MESH_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} mesh_node_demo.o ${CC} $(filter-out mesh_node_demo.h,$^) ${CFLAGS} ${LDFLAGS} -o $@ +ifdef BTSTACK_SYSTEM +ifeq ($(BTSTACK_SYSTEM),LIBUSB) +$(info Making for linux...) +endif +ifeq ($(BTSTACK_SYSTEM),RASPI) +$(info Making for raspberry pi...) +endif +else +$(warning BTSTACK_SYSTEM not defined!) +endif + clean: rm -f ${EXAMPLES} ${EXAMPLES_GATT_H_FILES} - rm -f *.o *.out *.hex *.exe *.wav *.sbc rm -rf *.dSYM rm -rf ${BTSTACK_ROOT}/src/*.o rm -rf ${BTSTACK_ROOT}/src/ble/*.o diff --git a/port/ez430-rf2560/Makefile b/port/ez430-rf2560/Makefile index 0781f5dcbc..76cd94ec1e 100644 --- a/port/ez430-rf2560/Makefile +++ b/port/ez430-rf2560/Makefile @@ -9,6 +9,7 @@ CC2564B = bluetooth_init_cc2564B_1.6_BT_Spec_4.1.o CC2567 = CC256x_BT_Service_Pack_2.8_ANT_1.16.o BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= EZ430_RF2560 VPATH += example VPATH += firmware VPATH += src @@ -83,7 +84,7 @@ BLE = \ LCD = hal_lcd.c hal_lcd_fonts.c - + CORE_OBJ = $(CORE:.c=.o) COMMON_OBJ = $(COMMON:.c=.o) SPP_OBJ = $(SPP:.c=.o) @@ -92,7 +93,7 @@ LCD_OBJ = $(LCD:.c=.o) # create .hex file from .out %.hex: %.out - msp430-objcopy -O ihex $< $@ + msp430-objcopy -O ihex $< $@ # create firmware image from common objects and example source file @@ -103,18 +104,18 @@ include ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc # compiling requires a 20-bit mspgcc version # spp_and_gatt_counter.hex spp_accel.hex spp_flowcontrol.hex spp_counter.hex -# sdp_rfcomm_query.hex sdp_general_query.hex -# gap_inquiry.hex +# sdp_rfcomm_query.hex sdp_general_query.hex +# gap_inquiry.hex # compiling ant-test requires special ant init script # ant-test.hex # compile GATT database %.h: %.gatt - python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ + python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ -led_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${CC2560B} led_counter.o +led_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${CC2560B} led_counter.o ${CC} $^ ${LDFLAGS} -o $@ ant-test.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} profile.h sdp_server.o ant_cmds.o ${CC2567} ant-test.o @@ -123,7 +124,7 @@ ant-test.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} profile.h sdp_server.o ant_cm ble_server.out: ${CORE_OBJ} ${COMMON_OBJ} ${BLE_OBJ} ${LCD_OBJ} profile.h ble_server.o ${CC} $^ ${LDFLAGS} -o $@ -hid_demo.out: ${CORE_OBJ} ${COMMON_OBJ} ${LCD_OBJ} ${SPP_OBJ} ${CC2560B} hid_demo.o +hid_demo.out: ${CORE_OBJ} ${COMMON_OBJ} ${LCD_OBJ} ${SPP_OBJ} ${CC2560B} hid_demo.o ${CC} $^ ${LDFLAGS} -o $@ spp_accel.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} spp_accel.o sdp_server.o hal_adc.o @@ -152,4 +153,4 @@ clean: size: all msp430-size *.o - msp430-size *.out + msp430-size *.out diff --git a/port/libusb-intel/Makefile b/port/libusb-intel/Makefile index 9bad15352b..eb738c7f19 100644 --- a/port/libusb-intel/Makefile +++ b/port/libusb-intel/Makefile @@ -1,5 +1,6 @@ # Makefile for libusb based examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= LIBUSB_INTEL CORE += main.c btstack_stdin_posix.c btstack_tlv_posix.c @@ -54,4 +55,3 @@ clean_src: rm -rf * ${BTSTACK_ROOT}/platform/embedded/*.o all: all-intel ${EXAMPLES} - diff --git a/port/libusb/Makefile b/port/libusb/Makefile index b23cc5c98c..9d7937961c 100644 --- a/port/libusb/Makefile +++ b/port/libusb/Makefile @@ -1,5 +1,6 @@ # Makefile for libusb based examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= LIBUSB CORE += main.c btstack_stdin_posix.c btstack_tlv_posix.c @@ -57,4 +58,3 @@ clean_src: rm -rf * ${BTSTACK_ROOT}/platform/embedded/*.o all: ${EXAMPLES} - diff --git a/port/msp-exp430f5438-cc2564b/Makefile b/port/msp-exp430f5438-cc2564b/Makefile index 218d48d048..b744a0c332 100644 --- a/port/msp-exp430f5438-cc2564b/Makefile +++ b/port/msp-exp430f5438-cc2564b/Makefile @@ -9,6 +9,7 @@ CC2564B = bluetooth_init_cc2564B_1.8_BT_Spec_4.1.o CC2567 = CC256x_BT_Service_Pack_2.8_ANT_1.16.o BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= MSP_EXP430F5438_CC2564B VPATH += example VPATH += firmware VPATH += src @@ -83,7 +84,7 @@ BLE = \ LCD = hal_lcd.c hal_lcd_fonts.c - + CORE_OBJ = $(CORE:.c=.o) COMMON_OBJ = $(COMMON:.c=.o) SPP_OBJ = $(SPP:.c=.o) @@ -92,7 +93,7 @@ LCD_OBJ = $(LCD:.c=.o) # create .hex file from .out %.hex: %.out - msp430-objcopy -O ihex $< $@ + msp430-objcopy -O ihex $< $@ # create firmware image from common objects and example source file @@ -102,14 +103,14 @@ all: led_counter.hex include ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc # compiling requires a 20-bit mspgcc version -# hid_demo.hex +# hid_demo.hex # spp_and_gatt_counter.hex # spp_accel.hex # ble_server.hex # spp_counter.hex -# spp_flowcontrol.hex +# spp_flowcontrol.hex # sdp_rfcomm_query.hex -# sdp_general_query.hex +# sdp_general_query.hex # gap_inquiry.hex # compiling ant-test requires special ant init script @@ -117,10 +118,10 @@ include ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc # compile GATT database %.h: %.gatt - python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ + python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ -led_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${CC2560B} led_counter.o +led_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${CC2560B} led_counter.o ${CC} $^ ${LDFLAGS} -o $@ ant-test.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} profile.h sdp_server.o ant_cmds.o ${CC2567} ant-test.o @@ -129,25 +130,25 @@ ant-test.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} profile.h sdp_server.o ant_cm ble_server.out: ${CORE_OBJ} ${COMMON_OBJ} ${BLE_OBJ} ${LCD_OBJ} profile.h ble_server.o ${CC} $^ ${LDFLAGS} -o $@ -hid_demo.out: ${CORE_OBJ} ${COMMON_OBJ} ${LCD_OBJ} ${SPP_OBJ} ${CC2560B} hid_demo.o +hid_demo.out: ${CORE_OBJ} ${COMMON_OBJ} ${LCD_OBJ} ${SPP_OBJ} ${CC2560B} hid_demo.o ${CC} $^ ${LDFLAGS} -o $@ spp_accel.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} spp_accel.o sdp_server.o hal_adc.o ${CC} $^ ${LDFLAGS} -o $@ -spp_and_gatt_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${BLE_OBJ} spp_and_gatt_counter.h spp_and_gatt_counter.o sdp_server.o +spp_and_gatt_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${BLE_OBJ} spp_and_gatt_counter.h spp_and_gatt_counter.o sdp_server.o ${CC} $^ ${LDFLAGS} -o $@ -spp_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} spp_counter.o sdp_server.o +spp_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} spp_counter.o sdp_server.o ${CC} $^ ${LDFLAGS} -o $@ -spp_flowcontrol.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} spp_flowcontrol.o sdp_server.o +spp_flowcontrol.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} spp_flowcontrol.o sdp_server.o ${CC} $^ ${LDFLAGS} -o $@ -gap_inquiry.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} ad_parser.o gap_inquiry.o +gap_inquiry.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} ad_parser.o gap_inquiry.o ${CC} $^ ${LDFLAGS} -o $@ -sdp_rfcomm_query.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${SDP_CLIENT} ${CC2560B} sdp_rfcomm_query.o +sdp_rfcomm_query.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${SDP_CLIENT} ${CC2560B} sdp_rfcomm_query.o ${CC} $^ ${LDFLAGS} -o $@ sdp_general_query.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${SDP_CLIENT} ${CC2560B} sdp_general_query.o @@ -158,4 +159,4 @@ clean: size: all msp430-size *.o - msp430-size *.out + msp430-size *.out diff --git a/port/msp430f5229lp-cc2564b/Makefile b/port/msp430f5229lp-cc2564b/Makefile index 0b02305262..5cab537099 100644 --- a/port/msp430f5229lp-cc2564b/Makefile +++ b/port/msp430f5229lp-cc2564b/Makefile @@ -9,6 +9,7 @@ CC2564B = bluetooth_init_cc2564B_1.8_BT_Spec_4.1.o CC2567 = CC256x_BT_Service_Pack_2.8_ANT_1.16.o BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= MSP430F5229LP_CC2564B VPATH += example VPATH += firmware VPATH += src @@ -86,7 +87,7 @@ BLE = \ LCD = hal_lcd.c hal_lcd_fonts.c - + CORE_OBJ = $(CORE:.c=.o) COMMON_OBJ = $(COMMON:.c=.o) SPP_OBJ = $(SPP:.c=.o) @@ -94,12 +95,12 @@ BLE_OBJ = $(BLE:.c=.o) # create .hex file from .out %.hex: %.out - msp430-objcopy -O ihex $< $@ + msp430-objcopy -O ihex $< $@ # create firmware image from common objects and example source file all: led_counter.hex spp_counter.hex gap_inquiry.hex spp_flowcontrol.hex \ - sdp_rfcomm_query.hex sdp_general_query.hex + sdp_rfcomm_query.hex sdp_general_query.hex # ble_server.hex # fetch and convert init scripts @@ -113,10 +114,10 @@ include ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc # compile GATT database %.h: %.gatt - python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ + python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ -led_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${CC2560B} led_counter.o +led_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${CC2560B} led_counter.o ${CC} $^ ${LDFLAGS} -o $@ ant-test.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} profile.h ant_cmds.o ${CC2567} ant-test.o @@ -148,8 +149,7 @@ clean: size: all msp430-size *.o - msp430-size *.out + msp430-size *.out %.flash: %.hex mspdebug tilib --force-reset "prog $^" - diff --git a/port/mtk/Makefile b/port/mtk/Makefile index 9e3a728b3e..cd9b6d9d2c 100644 --- a/port/mtk/Makefile +++ b/port/mtk/Makefile @@ -9,6 +9,7 @@ CFLAGS = -march=armv7-a -mfloat-abi=softfp -I$(SYSROOT)/usr/include -fpie -fpic LDFLAGS = -Wl,--fix-cortex-a8 -L$(SYSROOT)/usr/lib -fpie -fpic -fPIE -pie BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= MTK CFLAGS += -I$(BTSTACK_ROOT)/include CFLAGS += -I$(BTSTACK_ROOT)/src/ @@ -87,10 +88,10 @@ libbluetoothdrv.so: bluetoothdrv_stub.o install: ./installer.sh -run: +run: $(ADB) shell le_scan -shell: +shell: $(ADB) shell version: @@ -119,10 +120,10 @@ le_scan: le_scan.o # minimal_peripheral: minimal_peripheral.o # $(GCC) $(LDFLAGS) libs/libbluetoothdrv.so -o $@ minimal_peripheral.o -hci_dump: +hci_dump: killall PacketLogger $(ADB) shell su root chmod 666 /data/btstack/hci_dump.pklg $(ADB) pull /data/btstack/hci_dump.pklg 2> /dev/null open hci_dump.pklg - + log: hci_dump diff --git a/port/nrf5x/pca10028/armgcc/Makefile b/port/nrf5x/pca10028/armgcc/Makefile old mode 100755 new mode 100644 diff --git a/port/posix-h4-atwilc3000/Makefile b/port/posix-h4-atwilc3000/Makefile index 4b0b17025c..0357929476 100644 --- a/port/posix-h4-atwilc3000/Makefile +++ b/port/posix-h4-atwilc3000/Makefile @@ -1,5 +1,6 @@ # Makefile for libusb based examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= POSIX_H4_ATWILC3000 CORE += \ btstack_chipset_atwilc3000.c \ diff --git a/port/posix-h4-da14581/Makefile b/port/posix-h4-da14581/Makefile index 5d27896b2f..84ab243e70 100644 --- a/port/posix-h4-da14581/Makefile +++ b/port/posix-h4-da14581/Makefile @@ -1,5 +1,6 @@ # Makefile for libusb based examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= POSIX_H4_DA14581 CORE += \ btstack_chipset_da14581.c \ @@ -28,4 +29,3 @@ VPATH += ${BTSTACK_ROOT}/chipset/da14581 EXAMPLES = ${EXAMPLES_GENERAL} ${EXAMPLES_LE_ONLY} all: ${EXAMPLES} - diff --git a/port/posix-h4-da14585/Makefile b/port/posix-h4-da14585/Makefile index 5f62c610b6..e01abe59d1 100644 --- a/port/posix-h4-da14585/Makefile +++ b/port/posix-h4-da14585/Makefile @@ -1,5 +1,6 @@ # Makefile for libusb based examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= POSIX_H4_DA14585 CORE += \ btstack_chipset_da14581.c \ @@ -28,4 +29,3 @@ VPATH += ${BTSTACK_ROOT}/chipset/da14581 EXAMPLES = ${EXAMPLES_GENERAL} ${EXAMPLES_LE_ONLY} all: ${EXAMPLES} - diff --git a/port/posix-h4-zephyr/Makefile b/port/posix-h4-zephyr/Makefile index 925858c79e..4676c36cb1 100644 --- a/port/posix-h4-zephyr/Makefile +++ b/port/posix-h4-zephyr/Makefile @@ -1,5 +1,6 @@ # Makefile for posix-h4 based examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= POSIX_H4_ZEPHYR CORE += \ btstack_run_loop_posix.c \ @@ -19,10 +20,9 @@ CFLAGS += -g -Wall -Werror \ -I$(BTSTACK_ROOT)/platform/posix \ -I$(BTSTACK_ROOT)/chipset/zephyr \ -I${BTSTACK_ROOT}/3rd-party/tinydir - + VPATH += ${BTSTACK_ROOT}/platform/posix VPATH += ${BTSTACK_ROOT}/platform/embedded VPATH += ${BTSTACK_ROOT}/chipset/zephyr all: ${EXAMPLES_LE_ONLY} - diff --git a/port/posix-h4/Makefile b/port/posix-h4/Makefile index 8624b80f1b..08619fbb93 100644 --- a/port/posix-h4/Makefile +++ b/port/posix-h4/Makefile @@ -1,5 +1,6 @@ # Makefile for libusb based examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= POSIX_H4 CORE += \ bluetooth_init_cc2564B_1.8_BT_Spec_4.1.c \ @@ -51,7 +52,7 @@ VPATH += ${BTSTACK_ROOT}/3rd-party/rijndael VPATH += ${BTSTACK_ROOT}/platform/posix VPATH += ${BTSTACK_ROOT}/platform/embedded -VPATH += ${BTSTACK_ROOT}/chipset/bcm +VPATH += ${BTSTACK_ROOT}/chipset/bcm VPATH += ${BTSTACK_ROOT}/chipset/cc256x VPATH += ${BTSTACK_ROOT}/chipset/csr VPATH += ${BTSTACK_ROOT}/chipset/em9301 @@ -69,4 +70,3 @@ EXAMPLES += pan_lwip_http_server # LDFLAGS += -L/sw/lib -lportaudio -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,Carbon all: BCM43430A1.hcd ${EXAMPLES} - diff --git a/port/posix-h5-bcm/Makefile b/port/posix-h5-bcm/Makefile index 14e297686d..456e734f49 100644 --- a/port/posix-h5-bcm/Makefile +++ b/port/posix-h5-bcm/Makefile @@ -1,5 +1,6 @@ # Makefile for libusb based examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= POSIX_H5_BCM CORE += \ btstack_chipset_bcm.c \ @@ -34,7 +35,7 @@ VPATH += ${BTSTACK_ROOT}/3rd-party/rijndael VPATH += ${BTSTACK_ROOT}/platform/posix VPATH += ${BTSTACK_ROOT}/platform/embedded -VPATH += ${BTSTACK_ROOT}/chipset/bcm +VPATH += ${BTSTACK_ROOT}/chipset/bcm EXAMPLES = ${EXAMPLES_GENERAL} ${EXAMPLES_CLASSIC_ONLY} ${EXAMPLES_LE_ONLY} ${EXAMPLES_DUAL_MODE} EXAMPLES += pan_lwip_http_server diff --git a/port/posix-h5/Makefile b/port/posix-h5/Makefile index 828b2d3676..3ce2442dd5 100644 --- a/port/posix-h5/Makefile +++ b/port/posix-h5/Makefile @@ -1,5 +1,6 @@ # Makefile for libusb based examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= POSIX_H5 CORE += \ bluetooth_init_cc2564B_1.8_BT_Spec_4.1.c \ diff --git a/port/raspi/Makefile b/port/raspi/Makefile index 8027e1d289..fdb2f79b86 100644 --- a/port/raspi/Makefile +++ b/port/raspi/Makefile @@ -1,5 +1,6 @@ # Makefile for Raspberry Pi BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= RASPI CORE += \ btstack_chipset_bcm.c \ @@ -41,7 +42,7 @@ VPATH += ${BTSTACK_ROOT}/3rd-party/rijndael VPATH += ${BTSTACK_ROOT}/platform/posix VPATH += ${BTSTACK_ROOT}/platform/embedded -VPATH += ${BTSTACK_ROOT}/chipset/bcm +VPATH += ${BTSTACK_ROOT}/chipset/bcm EXAMPLES = ${EXAMPLES_GENERAL} ${EXAMPLES_CLASSIC_ONLY} ${EXAMPLES_LE_ONLY} ${EXAMPLES_DUAL_MODE} EXAMPLES += pan_lwip_http_server diff --git a/port/stm32-f103rb-nucleo/Makefile b/port/stm32-f103rb-nucleo/Makefile index 508fac4a68..484fb49f52 100644 --- a/port/stm32-f103rb-nucleo/Makefile +++ b/port/stm32-f103rb-nucleo/Makefile @@ -8,6 +8,7 @@ OPENCM3_DIR = libopencm3 LDSCRIPT = stm32f1-nucleo.ld BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= STM32_F103RB_NUCLEO VPATH = $(BTSTACK_ROOT)/example VPATH += $(BTSTACK_ROOT)/src VPATH += $(BTSTACK_ROOT)/src/ble @@ -72,7 +73,7 @@ include libopencm3.stm32f1.mk include ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc clean: - rm -f *.map *.o *.d *.out *.elf *.bin *.hex + rm -f *.map *.o *.d *.out *.elf *.bin *.hex distclean: clean make -C libopencm3 clean @@ -85,5 +86,4 @@ libopencm3/lib/libopencm3_stm32f1.a: # compile GATT database spp_and_gatt_counter.h: spp_and_gatt_counter.gatt - python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ - + python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ diff --git a/port/stm32-f4discovery-cc256x/Makefile b/port/stm32-f4discovery-cc256x/Makefile index a32ca24ea7..bfff42a19b 100644 --- a/port/stm32-f4discovery-cc256x/Makefile +++ b/port/stm32-f4discovery-cc256x/Makefile @@ -1,5 +1,5 @@ ########################################################################################################################## -# File automatically-generated by tool: [projectgenerator] version: [3.1.0] date: [Thu Mar 07 21:47:00 CET 2019] +# File automatically-generated by tool: [projectgenerator] version: [3.1.0] date: [Thu Mar 07 21:47:00 CET 2019] ########################################################################################################################## # ------------------------------------------------ @@ -32,6 +32,7 @@ OPT = -Os BUILD_DIR = build BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= STM32_F4DISCOVERY_CC256X VPATH += ${BTSTACK_ROOT}/example ###################################### @@ -210,7 +211,7 @@ SZ = $(PREFIX)size endif HEX = $(CP) -O ihex BIN = $(CP) -O binary -S - + ####################################### # CFLAGS ####################################### @@ -228,7 +229,7 @@ MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) # macros for gcc # AS defines -AS_DEFS = +AS_DEFS = # C defines C_DEFS = \ @@ -237,7 +238,7 @@ C_DEFS = \ # AS includes -AS_INCLUDES = +AS_INCLUDES = # C includes C_INCLUDES = \ @@ -293,7 +294,7 @@ CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" LDSCRIPT = STM32F407VGTx_FLASH.ld # libraries -LIBS = -lPDMFilter_CM4_GCC -lc -lm -lnosys +LIBS = -lPDMFilter_CM4_GCC -lc -lm -lnosys LIBDIR = -Lpdm LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections @@ -379,7 +380,7 @@ all: \ include ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc $(BUILD_DIR)/%.h: %.gatt - python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ + python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ @@ -393,15 +394,15 @@ $(BUILD_DIR)/%.elf: Makefile $(OBJECTS) $(BUILD_DIR)/%.o $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) $(HEX) $< $@ - + $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) - $(BIN) $< $@ - + $(BIN) $< $@ + $(BUILD_DIR)/%.jdebug: ozone.jdebug | $(BUILD_DIR) sed -e "s|EXAMPLE|$(basename $(notdir $@))|" $< > $@ $(BUILD_DIR): - mkdir $@ + mkdir $@ ####################################### # clean up diff --git a/port/stm32-l073rz-nucleo-em9304/Makefile b/port/stm32-l073rz-nucleo-em9304/Makefile index 991c03e454..6465b37e8e 100644 --- a/port/stm32-l073rz-nucleo-em9304/Makefile +++ b/port/stm32-l073rz-nucleo-em9304/Makefile @@ -1,5 +1,5 @@ ########################################################################################################################## -# File automatically-generated by tool: [projectgenerator] version: [3.1.0] date: [Sat Mar 30 18:50:14 CET 2019] +# File automatically-generated by tool: [projectgenerator] version: [3.1.0] date: [Sat Mar 30 18:50:14 CET 2019] ########################################################################################################################## # ------------------------------------------------ @@ -32,6 +32,7 @@ OPT = -Os BUILD_DIR = build BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= STM32_L073RZ_NUCLEO_EM9304 VPATH += ${BTSTACK_ROOT}/example ###################################### @@ -127,7 +128,7 @@ SZ = $(PREFIX)size endif HEX = $(CP) -O ihex BIN = $(CP) -O binary -S - + ####################################### # CFLAGS ####################################### @@ -145,7 +146,7 @@ MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) # macros for gcc # AS defines -AS_DEFS = +AS_DEFS = # C defines C_DEFS = \ @@ -154,7 +155,7 @@ C_DEFS = \ # AS includes -AS_INCLUDES = +AS_INCLUDES = # C includes C_INCLUDES = \ @@ -197,8 +198,8 @@ CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" LDSCRIPT = STM32L073RZTx_FLASH.ld # libraries -LIBS = -lc -lm -lnosys -LIBDIR = +LIBS = -lc -lm -lnosys +LIBDIR = LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections # default action: build all @@ -246,9 +247,9 @@ all: \ $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.jdebug)) \ $(BUILD_DIR)/%.h: %.gatt - python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ + python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ -$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) +$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) @@ -260,22 +261,22 @@ $(BUILD_DIR)/%.elf: Makefile $(OBJECTS) $(BUILD_DIR)/%.o $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) $(HEX) $< $@ - + $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) - $(BIN) $< $@ - + $(BIN) $< $@ + $(BUILD_DIR)/%.jdebug: ozone.jdebug | $(BUILD_DIR) sed -e "s|EXAMPLE|$(basename $(notdir $@))|" $< > $@ $(BUILD_DIR): - mkdir $@ + mkdir $@ ####################################### # clean up ####################################### clean: -rm -fR $(BUILD_DIR) - + ####################################### # dependencies ####################################### diff --git a/port/stm32-wb55xx-nucleo-freertos/Makefile b/port/stm32-wb55xx-nucleo-freertos/Makefile index a77f02e762..707f0453c0 100644 --- a/port/stm32-wb55xx-nucleo-freertos/Makefile +++ b/port/stm32-wb55xx-nucleo-freertos/Makefile @@ -1,5 +1,5 @@ ########################################################################################################################## -# File automatically-generated by tool: [projectgenerator] version: [3.1.0] date: [Sat Mar 30 18:50:14 CET 2019] +# File automatically-generated by tool: [projectgenerator] version: [3.1.0] date: [Sat Mar 30 18:50:14 CET 2019] ########################################################################################################################## # ------------------------------------------------ @@ -32,6 +32,7 @@ OPT = -Og BUILD_DIR = build BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= STM32_WB55xx_NUCLEO_FREERTOS FREERTOS_ROOT ?= Middlewares/amazon-freertos/lib VPATH += ${BTSTACK_ROOT}/example @@ -137,7 +138,7 @@ SZ = $(PREFIX)size endif HEX = $(CP) -O ihex BIN = $(CP) -O binary -S - + ####################################### # CFLAGS ####################################### @@ -155,7 +156,7 @@ MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) # macros for gcc # AS defines -AS_DEFS = +AS_DEFS = # C defines C_DEFS = \ @@ -164,7 +165,7 @@ C_DEFS = \ # AS includes -AS_INCLUDES = +AS_INCLUDES = # C includes C_INCLUDES = \ @@ -222,8 +223,8 @@ CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" LDSCRIPT = stm32wb55xx_flash_cm4.ld # libraries -LIBS = -lc -lm -lnosys -LIBDIR = +LIBS = -lc -lm -lnosys +LIBDIR = LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections # default action: build all @@ -273,9 +274,9 @@ all: \ $(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.jdebug)) \ $(BUILD_DIR)/%.h: %.gatt - python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ + python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ -$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) +$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) @@ -287,22 +288,22 @@ $(BUILD_DIR)/%.elf: Makefile $(OBJECTS) $(BUILD_DIR)/%.o $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) $(HEX) $< $@ - + $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) - $(BIN) $< $@ - + $(BIN) $< $@ + $(BUILD_DIR)/%.jdebug: ozone.jdebug | $(BUILD_DIR) sed -e "s|EXAMPLE|$(basename $(notdir $@))|" $< > $@ $(BUILD_DIR): - mkdir $@ + mkdir $@ ####################################### # clean up ####################################### clean: -rm -fR $(BUILD_DIR) - + ####################################### # dependencies ####################################### diff --git a/port/windows-h4-zephyr/Makefile b/port/windows-h4-zephyr/Makefile index 39d87b3b65..5cd517683b 100644 --- a/port/windows-h4-zephyr/Makefile +++ b/port/windows-h4-zephyr/Makefile @@ -1,5 +1,6 @@ # Makefile for windows-h4 examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= WINDOWS_H4_ZEPHYR CORE += main.c btstack_stdin_windows.c diff --git a/port/windows-h4/Makefile b/port/windows-h4/Makefile index 5713d317ff..aeca354af4 100644 --- a/port/windows-h4/Makefile +++ b/port/windows-h4/Makefile @@ -1,5 +1,6 @@ # Makefile for windows-h4 examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= WINDOWS_H4 CORE += main.c btstack_stdin_windows.c diff --git a/port/windows-winusb-intel/Makefile b/port/windows-winusb-intel/Makefile index 368400f30b..c93da8456c 100644 --- a/port/windows-winusb-intel/Makefile +++ b/port/windows-winusb-intel/Makefile @@ -1,5 +1,6 @@ # Makefile for windows WinUSB based examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= WINDOWS_WINUSB_INTEL CORE += main.c btstack_stdin_windows.c diff --git a/port/windows-winusb/Makefile b/port/windows-winusb/Makefile index acc42d56c0..a726ec0c00 100644 --- a/port/windows-winusb/Makefile +++ b/port/windows-winusb/Makefile @@ -1,5 +1,6 @@ # Makefile for windows WinUSB based examples BTSTACK_ROOT ?= ../.. +BTSTACK_SYSTEM ?= WINDOWS_WINUSB CORE += main.c btstack_stdin_windows.c From a681c9f194ea7f3aa03b482936e06bc459529c49 Mon Sep 17 00:00:00 2001 From: Nathan Ramanathan Date: Thu, 23 Apr 2020 02:42:05 -0500 Subject: [PATCH 2/2] forgot to include cleanup by accident. --- example/Makefile.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/example/Makefile.inc b/example/Makefile.inc index d92587728b..0e753f1310 100644 --- a/example/Makefile.inc +++ b/example/Makefile.inc @@ -441,6 +441,7 @@ endif clean: rm -f ${EXAMPLES} ${EXAMPLES_GATT_H_FILES} + rm -f *.o *.out *.hex *.exe *.wav *.sbc rm -rf *.dSYM rm -rf ${BTSTACK_ROOT}/src/*.o rm -rf ${BTSTACK_ROOT}/src/ble/*.o