Recator application build system: cleaner flags naming, set release flag to yes by default, include unit test and debug apps (#443)

This commit is contained in:
あく 2021-04-30 14:07:13 +03:00 committed by GitHub
parent 024ced4672
commit b90d72fadf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 315 additions and 320 deletions

View File

@ -52,7 +52,7 @@ jobs:
- name: Build firmware in docker
uses: ./.github/actions/docker
with:
run: make -j$(nproc) -C firmware TARGET=${TARGET_VERSION} APP_RELEASE=1
run: make -j$(nproc) -C firmware TARGET=${TARGET_VERSION}
- name: Generate dfu file for firmware
uses: ./.github/actions/docker

View File

@ -58,7 +58,7 @@ One liner: `./flash_core1_main.sh`
# Build from source
`docker-compose exec dev make -C firmware TARGET=f4 APP_RELEASE=1 flash` for build and flash dev board (see `applications/applications.mk` for list of applications/examples)
`docker-compose exec dev make -C firmware flash` for build and flash dev board (see `applications/applications.mk` for list of applications/examples)
# Links
* Task tracker: [Jira](https://flipperzero.atlassian.net/)

View File

@ -121,7 +121,8 @@ int32_t app_loader(void* p) {
menu_item_add(menu, menu_plugins);
});
#ifdef APP_DEBUG
// Debug
with_value_mutex(
menu_mutex, (Menu * menu) {
MenuItem* menu_debug =
@ -151,7 +152,6 @@ int32_t app_loader(void* p) {
menu_item_add(menu, menu_debug);
});
#endif
printf("[app loader] start\r\n");

View File

@ -1,9 +1,6 @@
#include "applications.h"
#ifdef APP_TEST
int32_t flipper_test_app(void* p);
#endif
int32_t application_blink(void* p);
int32_t application_uart_write(void* p);
int32_t application_input_dump(void* p);
@ -38,23 +35,23 @@ int32_t passport(void* p);
int32_t app_accessor(void* p);
const FlipperApplication FLIPPER_SERVICES[] = {
#ifdef APP_CLI
#ifdef SRV_CLI
{.app = cli_task, .name = "cli_task", .stack_size = 2048, .icon = A_Plugins_14},
#endif
#ifdef APP_EXAMPLE_BLINK
#ifdef SRV_EXAMPLE_BLINK
{.app = application_blink, .name = "blink", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_INPUT
#ifdef SRV_INPUT
{.app = input_task, .name = "input_task", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_EXAMPLE_INPUT_DUMP
#ifdef SRV_EXAMPLE_INPUT_DUMP
{.app = application_input_dump, .name = "input dump", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_GUI
#ifdef SRV_GUI
{.app = backlight_control,
.name = "backlight_control",
.stack_size = 1024,
@ -63,54 +60,133 @@ const FlipperApplication FLIPPER_SERVICES[] = {
{.app = gui_task, .name = "gui_task", .stack_size = 8192, .icon = A_Plugins_14},
#endif
#ifdef APP_MENU
#ifdef SRV_MENU
{.app = menu_task, .name = "menu_task", .stack_size = 1024, .icon = A_Plugins_14},
{.app = app_loader, .name = "app_loader", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_SD_FILESYSTEM
#ifdef SRV_SD_FILESYSTEM
{.app = sd_filesystem, .name = "sd_filesystem", .stack_size = 4096, .icon = A_Plugins_14},
#endif
#ifdef APP_DOLPHIN
#ifdef SRV_DOLPHIN
{.app = dolphin_task, .name = "dolphin_task", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_POWER
#ifdef SRV_POWER
{.app = power_task, .name = "power_task", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_BT
#ifdef SRV_BT
{.app = bt_task, .name = "bt_task", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_LF_RFID
#ifdef SRV_LF_RFID
{.app = lf_rfid_workaround,
.name = "lf rfid workaround",
.stack_size = 1024,
.icon = A_Plugins_14},
#endif
#ifdef APP_IRDA
#ifdef SRV_IRDA
{.app = irda, .name = "irda", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_NFC
#ifdef SRV_NFC
{.app = nfc_task, .name = "nfc_task", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_TEST
{.app = flipper_test_app, .name = "test app", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_EXAMPLE_QRCODE
#ifdef SRV_EXAMPLE_QRCODE
{.app = u8g2_qrcode, .name = "u8g2_qrcode", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_EXAMPLE_DISPLAY
#ifdef SRV_EXAMPLE_DISPLAY
{.app = u8g2_example, .name = "u8g2_example", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef SRV_SPEAKER_DEMO
{.app = coreglitch_demo_0,
.name = "coreglitch_demo_0",
.stack_size = 1024,
.icon = A_Plugins_14},
#endif
#ifdef SRV_SD_TEST
{.app = sd_card_test, .name = "sd_card_test", .stack_size = 4096, .icon = A_Plugins_14},
#endif
#ifdef SRV_MUSIC_PLAYER
{.app = music_player, .name = "music player", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef SRV_IBUTTON
{.app = app_ibutton, .name = "ibutton", .stack_size = 4096, .icon = A_Plugins_14},
#endif
#ifdef SRV_GPIO_DEMO
{.app = app_gpio_test, .name = "gpio test", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef SRV_FLOOPPER_BLOOPPER
{.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14},
#endif
#ifdef SRV_SDNFC
{.app = sdnfc, .name = "sdnfc", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef SRV_GUI_TEST
{.app = gui_test, .name = "gui_test", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef SRV_KEYPAD_TEST
{.app = keypad_test, .name = "keypad_test", .icon = A_Plugins_14},
#endif
#ifdef SRV_ACCESSOR
{.app = app_accessor, .name = "accessor", .stack_size = 4096, .icon = A_Plugins_14},
#endif
};
const size_t FLIPPER_SERVICES_COUNT = sizeof(FLIPPER_SERVICES) / sizeof(FlipperApplication);
// Main menu APP
const FlipperApplication FLIPPER_APPS[] = {
#ifdef APP_SUBGHZ
{.app = subghz_app, .name = "Sub-1 GHz", .stack_size = 1024, .icon = A_Sub1ghz_14},
#endif
#ifdef APP_LF_RFID
{.app = lf_rfid_workaround, .name = "125 kHz RFID", .stack_size = 1024, .icon = A_125khz_14},
#endif
#ifdef APP_IRDA
{.app = irda, .name = "Infrared", .stack_size = 1024, .icon = A_Infrared_14},
#endif
#ifdef APP_IBUTTON
{.app = app_ibutton, .name = "iButton", .stack_size = 4096, .icon = A_iButton_14},
#endif
#ifdef APP_GPIO_DEMO
{.app = app_gpio_test, .name = "GPIO", .stack_size = 1024, .icon = A_GPIO_14},
#endif
};
const size_t FLIPPER_APPS_COUNT = sizeof(FLIPPER_APPS) / sizeof(FlipperApplication);
// Plugin menu
const FlipperApplication FLIPPER_PLUGINS[] = {
#ifdef APP_MUSIC_PLAYER
{.app = music_player, .name = "music player", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_FLOOPPER_BLOOPPER
{.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14},
#endif
#ifdef APP_SPEAKER_DEMO
{.app = coreglitch_demo_0,
.name = "coreglitch_demo_0",
@ -118,24 +194,26 @@ const FlipperApplication FLIPPER_SERVICES[] = {
.icon = A_Plugins_14},
#endif
};
const size_t FLIPPER_PLUGINS_COUNT = sizeof(FLIPPER_PLUGINS) / sizeof(FlipperApplication);
// Plugin menu
const FlipperApplication FLIPPER_DEBUG_APPS[] = {
#ifdef APP_EXAMPLE_BLINK
{.app = application_blink, .name = "blink", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_EXAMPLE_INPUT_DUMP
{.app = application_input_dump, .name = "input dump", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_SD_TEST
{.app = sd_card_test, .name = "sd_card_test", .stack_size = 4096, .icon = A_Plugins_14},
#endif
#ifdef APP_MUSIC_PLAYER
{.app = music_player, .name = "music player", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_IBUTTON
{.app = app_ibutton, .name = "ibutton", .stack_size = 4096, .icon = A_Plugins_14},
#endif
#ifdef APP_GPIO_DEMO
{.app = app_gpio_test, .name = "gpio test", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_FLOOPPER_BLOOPPER
{.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14},
#ifdef APP_VIBRO_DEMO
{.app = application_vibro, .name = "vibro", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef APP_SDNFC
@ -154,96 +232,15 @@ const FlipperApplication FLIPPER_SERVICES[] = {
{.app = app_accessor, .name = "accessor", .stack_size = 4096, .icon = A_Plugins_14},
#endif
};
const size_t FLIPPER_SERVICES_COUNT = sizeof(FLIPPER_SERVICES) / sizeof(FlipperApplication);
// Main menu APP
const FlipperApplication FLIPPER_APPS[] = {
#ifdef BUILD_SUBGHZ
{.app = subghz_app, .name = "Sub-1 GHz", .stack_size = 1024, .icon = A_Sub1ghz_14},
#endif
#ifdef BUILD_LF_RFID
{.app = lf_rfid_workaround, .name = "125 kHz RFID", .stack_size = 1024, .icon = A_125khz_14},
#endif
#ifdef BUILD_IRDA
{.app = irda, .name = "Infrared", .stack_size = 1024, .icon = A_Infrared_14},
#endif
#ifdef BUILD_IBUTTON
{.app = app_ibutton, .name = "iButton", .stack_size = 4096, .icon = A_iButton_14},
#endif
#ifdef BUILD_GPIO_DEMO
{.app = app_gpio_test, .name = "GPIO", .stack_size = 1024, .icon = A_GPIO_14},
#endif
};
const size_t FLIPPER_APPS_COUNT = sizeof(FLIPPER_APPS) / sizeof(FlipperApplication);
// Plugin menu
const FlipperApplication FLIPPER_PLUGINS[] = {
#ifdef BUILD_MUSIC_PLAYER
{.app = music_player, .name = "music player", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef BUILD_FLOOPPER_BLOOPPER
{.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14},
#endif
#ifdef BUILD_SPEAKER_DEMO
{.app = coreglitch_demo_0,
.name = "coreglitch_demo_0",
.stack_size = 1024,
.icon = A_Plugins_14},
#endif
};
const size_t FLIPPER_PLUGINS_COUNT = sizeof(FLIPPER_PLUGINS) / sizeof(FlipperApplication);
// Plugin menu
const FlipperApplication FLIPPER_DEBUG_APPS[] = {
#ifdef BUILD_EXAMPLE_BLINK
{.app = application_blink, .name = "blink", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef BUILD_EXAMPLE_INPUT_DUMP
{.app = application_input_dump, .name = "input dump", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef BUILD_SD_TEST
{.app = sd_card_test, .name = "sd_card_test", .stack_size = 4096, .icon = A_Plugins_14},
#endif
#ifdef BUILD_VIBRO_DEMO
{.app = application_vibro, .name = "vibro", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef BUILD_SDNFC
{.app = sdnfc, .name = "sdnfc", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef BUILD_GUI_TEST
{.app = gui_test, .name = "gui_test", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef BUILD_KEYPAD_TEST
{.app = keypad_test, .name = "keypad_test", .icon = A_Plugins_14},
#endif
#ifdef BUILD_ACCESSOR
{.app = app_accessor, .name = "accessor", .stack_size = 4096, .icon = A_Plugins_14},
#ifdef APP_UNIT_TESTS
{.app = flipper_test_app, .name = "Unit Tests", .stack_size = 1024, .icon = A_Plugins_14},
#endif
};
const size_t FLIPPER_DEBUG_APPS_COUNT = sizeof(FLIPPER_DEBUG_APPS) / sizeof(FlipperApplication);
#ifdef APP_DOLPHIN
#ifdef SRV_DOLPHIN
const FlipperApplication FLIPPER_SCENE =
{.app = scene_app, .name = "Scenes", .stack_size = 1024, .icon = A_Games_14};

View File

@ -6,300 +6,298 @@ C_SOURCES += $(shell find $(APP_DIR) -name *.c)
CPP_SOURCES += $(shell find $(APP_DIR) -name *.cpp)
# Use APP_* for autostart app
# Use BUILD_* for add app to build
# Use SRV_* for autostart app
# Use APP_* for add app to build
APP_RELEASE ?= 0
APP_RELEASE ?= 1
ifeq ($(APP_RELEASE), 1)
# Main services
SRV_MENU = 1
SRV_NFC = 1
SRV_POWER = 1
SRV_BT = 1
SRV_CLI = 1
SRV_SD_FILESYSTEM = 1
SRV_DOLPHIN = 1
# Main Apps
APP_IRDA = 1
APP_SUBGHZ = 1
APP_LF_RFID = 1
APP_GPIO_DEMO = 1
APP_MUSIC_PLAYER = 1
APP_FLOOPPER_BLOOPPER = 1
APP_IBUTTON = 1
# Debug and misc
APP_GUI_TEST = 1
APP_KEYPAD_TEST = 1
APP_ACCESSOR = 1
APP_SD_TEST = 1
APP_VIBRO_DEMO = 1
APP_SPEAKER_DEMO = 1
APP_EXAMPLE_BLINK = 1
APP_EXAMPLE_UART_WRITE = 1
APP_EXAMPLE_INPUT_DUMP = 1
APP_UNIT_TESTS = 1
endif
SRV_NFC ?= 0
ifeq ($(SRV_NFC), 1)
SRV_MENU = 1
CFLAGS += -DSRV_NFC
endif
SRV_DOLPHIN ?= 0
ifeq ($(SRV_DOLPHIN), 1)
SRV_MENU = 1
CFLAGS += -DSRV_DOLPHIN
endif
SRV_POWER ?= 0
ifeq ($(SRV_POWER), 1)
SRV_GUI = 1
SRV_CLI = 1
CFLAGS += -DSRV_POWER
endif
SRV_BT ?= 0
ifeq ($(SRV_BT), 1)
SRV_CLI = 1
CFLAGS += -DSRV_BT
endif
SRV_MENU ?= 0
ifeq ($(SRV_MENU), 1)
CFLAGS += -DSRV_MENU
APP_MENU = 1
APP_NFC = 1
APP_POWER = 1
APP_BT = 1
APP_CLI = 1
APP_SD_FILESYSTEM = 1
BUILD_IRDA = 1
APP_DOLPHIN = 1
BUILD_SUBGHZ = 1
BUILD_LF_RFID = 1
BUILD_GPIO_DEMO = 1
BUILD_MUSIC_PLAYER = 1
BUILD_FLOOPPER_BLOOPPER = 1
BUILD_IBUTTON = 1
endif
APP_DEBUG ?=0
ifeq ($(APP_DEBUG), 1)
CFLAGS += -DAPP_DEBUG
BUILD_GUI_TEST = 1
BUILD_KEYPAD_TEST = 1
BUILD_ACCESSOR = 1
BUILD_SD_TEST = 1
BUILD_VIBRO_DEMO = 1
BUILD_SPEAKER_DEMO = 1
BUILD_EXAMPLE_BLINK = 1
BUILD_EXAMPLE_UART_WRITE = 1
BUILD_EXAMPLE_INPUT_DUMP = 1
endif
APP_NFC ?= 0
ifeq ($(APP_NFC), 1)
APP_MENU = 1
CFLAGS += -DAPP_NFC
endif
APP_DOLPHIN ?= 0
ifeq ($(APP_DOLPHIN), 1)
APP_MENU = 1
CFLAGS += -DAPP_DOLPHIN
endif
APP_POWER ?= 0
ifeq ($(APP_POWER), 1)
APP_GUI = 1
APP_CLI = 1
CFLAGS += -DAPP_POWER
endif
APP_BT ?= 0
ifeq ($(APP_BT), 1)
APP_CLI = 1
CFLAGS += -DAPP_BT
endif
APP_MENU ?= 0
ifeq ($(APP_MENU), 1)
SRV_INPUT = 1
SRV_GUI = 1
CFLAGS += -DAPP_MENU
BUILD_MENU = 1
endif
BUILD_MENU ?= 0
ifeq ($(BUILD_MENU), 1)
APP_INPUT = 1
APP_GUI = 1
CFLAGS += -DBUILD_MENU
endif
APP_TEST ?= 0
ifeq ($(APP_TEST), 1)
CFLAGS += -DAPP_TEST
APP_UNIT_TESTS ?= 0
ifeq ($(APP_UNIT_TESTS), 1)
CFLAGS += -DAPP_UNIT_TESTS
endif
SRV_EXAMPLE_BLINK ?= 0
ifeq ($(SRV_EXAMPLE_BLINK), 1)
CFLAGS += -DSRV_EXAMPLE_BLINK
APP_EXAMPLE_BLINK = 1
endif
APP_EXAMPLE_BLINK ?= 0
ifeq ($(APP_EXAMPLE_BLINK), 1)
CFLAGS += -DAPP_EXAMPLE_BLINK
BUILD_EXAMPLE_BLINK = 1
endif
BUILD_EXAMPLE_BLINK ?= 0
ifeq ($(BUILD_EXAMPLE_BLINK), 1)
CFLAGS += -DBUILD_EXAMPLE_BLINK
APP_INPUT = 1
SRV_INPUT = 1
endif
SRV_EXAMPLE_UART_WRITE ?= 0
ifeq ($(SRV_EXAMPLE_UART_WRITE), 1)
CFLAGS += -DSRV_EXAMPLE_UART_WRITE
APP_EXAMPLE_UART_WRITE = 1
endif
APP_EXAMPLE_UART_WRITE ?= 0
ifeq ($(APP_EXAMPLE_UART_WRITE), 1)
CFLAGS += -DAPP_EXAMPLE_UART_WRITE
BUILD_EXAMPLE_UART_WRITE = 1
endif
BUILD_EXAMPLE_UART_WRITE ?= 0
ifeq ($(BUILD_EXAMPLE_UART_WRITE), 1)
CFLAGS += -DBUILD_EXAMPLE_UART_WRITE
endif
SRV_EXAMPLE_IPC ?= 0
ifeq ($(SRV_EXAMPLE_IPC), 1)
CFLAGS += -DSRV_EXAMPLE_IPC
APP_EXAMPLE_IPC = 1
endif
APP_EXAMPLE_IPC ?= 0
ifeq ($(APP_EXAMPLE_IPC), 1)
CFLAGS += -DAPP_EXAMPLE_IPC
BUILD_EXAMPLE_IPC = 1
endif
BUILD_EXAMPLE_IPC ?= 0
ifeq ($(BUILD_EXAMPLE_IPC), 1)
CFLAGS += -DBUILD_EXAMPLE_IPC
endif
SRV_EXAMPLE_INPUT_DUMP ?= 0
ifeq ($(SRV_EXAMPLE_INPUT_DUMP), 1)
CFLAGS += -DSRV_EXAMPLE_INPUT_DUMP
APP_EXAMPLE_INPUT_DUMP = 1
endif
APP_EXAMPLE_INPUT_DUMP ?= 0
ifeq ($(APP_EXAMPLE_INPUT_DUMP), 1)
CFLAGS += -DAPP_EXAMPLE_INPUT_DUMP
BUILD_EXAMPLE_INPUT_DUMP = 1
endif
BUILD_EXAMPLE_INPUT_DUMP ?= 0
ifeq ($(BUILD_EXAMPLE_INPUT_DUMP), 1)
CFLAGS += -DBUILD_EXAMPLE_INPUT_DUMP
APP_INPUT = 1
SRV_INPUT = 1
endif
SRV_EXAMPLE_QRCODE ?= 0
ifeq ($(SRV_EXAMPLE_QRCODE), 1)
CFLAGS += -DSRV_EXAMPLE_QRCODE
APP_EXAMPLE_QRCODE = 1
endif
APP_EXAMPLE_QRCODE ?= 0
ifeq ($(APP_EXAMPLE_QRCODE), 1)
CFLAGS += -DAPP_EXAMPLE_QRCODE
BUILD_EXAMPLE_QRCODE = 1
endif
BUILD_EXAMPLE_QRCODE ?= 0
ifeq ($(BUILD_EXAMPLE_QRCODE), 1)
CFLAGS += -DBUILD_EXAMPLE_QRCODE
endif
ifeq ($(BUILD_SUBGHZ), 1)
CFLAGS += -DBUILD_SUBGHZ
APP_INPUT = 1
APP_GUI = 1
APP_CLI = 1
ifeq ($(APP_SUBGHZ), 1)
CFLAGS += -DAPP_SUBGHZ
SRV_INPUT = 1
SRV_GUI = 1
SRV_CLI = 1
endif
SRV_LF_RFID ?= 0
ifeq ($(SRV_LF_RFID), 1)
CFLAGS += -DSRV_LF_RFID
APP_LF_RFID = 1
endif
APP_LF_RFID ?= 0
ifeq ($(APP_LF_RFID), 1)
CFLAGS += -DAPP_LF_RFID
BUILD_LF_RFID = 1
endif
BUILD_LF_RFID ?= 0
ifeq ($(BUILD_LF_RFID), 1)
CFLAGS += -DBUILD_LF_RFID
APP_INPUT = 1
APP_GUI = 1
SRV_INPUT = 1
SRV_GUI = 1
endif
SRV_IRDA ?= 0
ifeq ($(SRV_IRDA), 1)
CFLAGS += -DSRV_IRDA
APP_IRDA = 1
endif
APP_IRDA ?= 0
ifeq ($(APP_IRDA), 1)
CFLAGS += -DAPP_IRDA
BUILD_IRDA = 1
endif
BUILD_IRDA ?= 0
ifeq ($(BUILD_IRDA), 1)
CFLAGS += -DBUILD_IRDA
APP_INPUT = 1
APP_GUI = 1
SRV_INPUT = 1
SRV_GUI = 1
endif
SRV_SD_TEST ?= 0
ifeq ($(SRV_SD_TEST), 1)
CFLAGS += -DSRV_SD_TEST
APP_SD_TEST = 1
endif
APP_SD_TEST ?= 0
ifeq ($(APP_SD_TEST), 1)
CFLAGS += -DAPP_SD_TEST
BUILD_SD_TEST = 1
endif
BUILD_SD_TEST ?= 0
ifeq ($(BUILD_SD_TEST), 1)
CFLAGS += -DBUILD_SD_TEST
APP_INPUT = 1
APP_GUI = 1
APP_SD_FILESYSTEM = 1
SRV_INPUT = 1
SRV_GUI = 1
SRV_SD_FILESYSTEM = 1
endif
SRV_SPEAKER_DEMO ?= 0
ifeq ($(SRV_SPEAKER_DEMO), 1)
CFLAGS += -DSRV_SPEAKER_DEMO
APP_SPEAKER_DEMO = 1
endif
APP_SPEAKER_DEMO ?= 0
ifeq ($(APP_SPEAKER_DEMO), 1)
CFLAGS += -DAPP_SPEAKER_DEMO
BUILD_SPEAKER_DEMO = 1
endif
BUILD_SPEAKER_DEMO ?= 0
ifeq ($(BUILD_SPEAKER_DEMO), 1)
CFLAGS += -DBUILD_SPEAKER_DEMO
APP_INPUT = 1
APP_GUI = 1
SRV_INPUT = 1
SRV_GUI = 1
endif
BUILD_VIBRO_DEMO ?= 0
ifeq ($(BUILD_VIBRO_DEMO), 1)
CFLAGS += -DBUILD_VIBRO_DEMO
APP_INPUT = 1
APP_VIBRO_DEMO ?= 0
ifeq ($(APP_VIBRO_DEMO), 1)
CFLAGS += -DAPP_VIBRO_DEMO
SRV_INPUT = 1
endif
SRV_KEYPAD_TEST ?= 0
ifeq ($(SRV_KEYPAD_TEST), 1)
CFLAGS += -DSRV_KEYPAD_TEST
APP_KEYPAD_TEST = 1
endif
APP_KEYPAD_TEST ?= 0
ifeq ($(APP_KEYPAD_TEST), 1)
CFLAGS += -DAPP_KEYPAD_TEST
BUILD_KEYPAD_TEST = 1
endif
BUILD_KEYPAD_TEST ?= 0
ifeq ($(BUILD_KEYPAD_TEST), 1)
CFLAGS += -DBUILD_KEYPAD_TEST
BUILD_KEYPAD_TEST = 1
APP_KEYPAD_TEST = 1
endif
SRV_ACCESSOR ?= 0
ifeq ($(SRV_ACCESSOR), 1)
CFLAGS += -DSRV_ACCESSOR
APP_ACCESSOR = 1
endif
APP_ACCESSOR ?= 0
ifeq ($(APP_ACCESSOR), 1)
CFLAGS += -DAPP_ACCESSOR
BUILD_ACCESSOR = 1
endif
BUILD_ACCESSOR ?= 0
ifeq ($(BUILD_ACCESSOR), 1)
CFLAGS += -DBUILD_ACCESSOR
BUILD_ACCESSOR = 1
APP_ACCESSOR = 1
endif
SRV_GPIO_DEMO ?= 0
ifeq ($(SRV_GPIO_DEMO), 1)
CFLAGS += -DSRV_GPIO_DEMO
APP_GPIO_DEMO = 1
endif
APP_GPIO_DEMO ?= 0
ifeq ($(APP_GPIO_DEMO), 1)
CFLAGS += -DAPP_GPIO_DEMO
BUILD_GPIO_DEMO = 1
endif
BUILD_GPIO_DEMO ?= 0
ifeq ($(BUILD_GPIO_DEMO), 1)
CFLAGS += -DBUILD_GPIO_DEMO
endif
SRV_MUSIC_PLAYER ?= 0
ifeq ($(SRV_MUSIC_PLAYER), 1)
CFLAGS += -DSRV_MUSIC_PLAYER
APP_MUSIC_PLAYER = 1
endif
APP_MUSIC_PLAYER ?= 0
ifeq ($(APP_MUSIC_PLAYER), 1)
CFLAGS += -DAPP_MUSIC_PLAYER
BUILD_MUSIC_PLAYER = 1
endif
BUILD_MUSIC_PLAYER ?= 0
ifeq ($(BUILD_MUSIC_PLAYER), 1)
CFLAGS += -DBUILD_MUSIC_PLAYER
endif
SRV_FLOOPPER_BLOOPPER ?= 0
ifeq ($(SRV_FLOOPPER_BLOOPPER), 1)
CFLAGS += -DSRV_FLOOPPER_BLOOPPER
APP_FLOOPPER_BLOOPPER = 1
endif
APP_FLOOPPER_BLOOPPER ?= 0
ifeq ($(APP_FLOOPPER_BLOOPPER), 1)
CFLAGS += -DAPP_FLOOPPER_BLOOPPER
BUILD_FLOOPPER_BLOOPPER = 1
endif
BUILD_FLOOPPER_BLOOPPER ?= 0
ifeq ($(BUILD_FLOOPPER_BLOOPPER), 1)
CFLAGS += -DBUILD_FLOOPPER_BLOOPPER
endif
SRV_IBUTTON ?= 0
ifeq ($(SRV_IBUTTON), 1)
CFLAGS += -DSRV_IBUTTON
APP_IBUTTON = 1
endif
APP_IBUTTON ?= 0
ifeq ($(APP_IBUTTON), 1)
CFLAGS += -DAPP_IBUTTON
BUILD_IBUTTON = 1
endif
BUILD_IBUTTON ?= 0
ifeq ($(BUILD_IBUTTON), 1)
CFLAGS += -DBUILD_IBUTTON
endif
SRV_GUI_TEST ?= 0
ifeq ($(SRV_GUI_TEST), 1)
CFLAGS += -DSRV_GUI_TEST
APP_GUI_TEST = 1
endif
APP_GUI_TEST ?= 0
ifeq ($(APP_GUI_TEST), 1)
CFLAGS += -DAPP_GUI_TEST
BUILD_GUI_TEST = 1
endif
BUILD_GUI_TEST ?= 0
ifeq ($(BUILD_GUI_TEST), 1)
CFLAGS += -DBUILD_GUI_TEST
endif
SRV_SDNFC ?= 0
ifeq ($(SRV_SDNFC), 1)
CFLAGS += -DSRV_SDNFC
APP_SDNFC = 1
endif
APP_SDNFC ?= 0
ifeq ($(APP_SDNFC), 1)
CFLAGS += -DAPP_SDNFC
BUILD_SDNFC = 1
endif
BUILD_SDNFC ?= 0
ifeq ($(BUILD_SDNFC), 1)
CFLAGS += -DBUILD_SDNFC
endif
# device drivers
APP_GUI ?= 0
ifeq ($(APP_GUI), 1)
CFLAGS += -DAPP_GUI
SRV_GUI ?= 0
ifeq ($(SRV_GUI), 1)
CFLAGS += -DSRV_GUI
endif
APP_SD_FILESYSTEM ?= 0
ifeq ($(APP_SD_FILESYSTEM), 1)
CFLAGS += -DAPP_SD_FILESYSTEM
SRV_SD_FILESYSTEM ?= 0
ifeq ($(SRV_SD_FILESYSTEM), 1)
CFLAGS += -DSRV_SD_FILESYSTEM
endif
APP_INPUT ?= 0
ifeq ($(APP_INPUT), 1)
CFLAGS += -DAPP_INPUT
SRV_INPUT ?= 0
ifeq ($(SRV_INPUT), 1)
CFLAGS += -DSRV_INPUT
endif
APP_CLI ?= 0
ifeq ($(APP_CLI), 1)
APP_GUI = 1
CFLAGS += -DAPP_CLI
SRV_CLI ?= 0
ifeq ($(SRV_CLI), 1)
SRV_GUI = 1
CFLAGS += -DSRV_CLI
endif

View File

@ -6,4 +6,4 @@ rm bootloader/.obj/f*/flash || true
make -C bootloader -j9 flash
rm firmware/.obj/f*/flash || true
make -C firmware -j9 APP_RELEASE=1 APP_DEBUG=1 flash
make -C firmware -j9 flash

View File

@ -36,7 +36,7 @@ C_SOURCES += $(FATFS_DIR)/ff_gen_drv.c
C_SOURCES += $(FATFS_DIR)/diskio.c
C_SOURCES += $(FATFS_DIR)/option/unicode.c
ifeq ($(APP_NFC), 1)
ifeq ($(SRV_NFC), 1)
ST25RFAL002_DIR = $(LIB_DIR)/ST25RFAL002
CFLAGS += -I$(ST25RFAL002_DIR)
CFLAGS += -I$(ST25RFAL002_DIR)/include
@ -58,13 +58,13 @@ C_SOURCES += $(LIB_DIR)/fnv1a-hash/fnv1a-hash.c
# build onewire/cyfral library only if
# we build iButton application
ifeq ($(BUILD_IBUTTON), 1)
ifeq ($(APP_IBUTTON), 1)
# onewire library
BUILD_ONEWIRE = 1
APP_ONEWIRE = 1
endif
BUILD_ONEWIRE ?= 0
ifeq ($(BUILD_ONEWIRE), 1)
APP_ONEWIRE ?= 0
ifeq ($(APP_ONEWIRE), 1)
# onewire library
ONEWIRE_DIR = $(LIB_DIR)/onewire
CFLAGS += -I$(ONEWIRE_DIR)