[FL-1162] Compile all files in applications directory (#432)

* applications: fix errors in test apps
* applications.mk: add all source files from applications
This commit is contained in:
gornekich 2021-04-27 22:13:41 +03:00 committed by GitHub
parent 26c4b20ac2
commit 317bfba024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 45 deletions

View File

@ -2,7 +2,9 @@ APP_DIR = $(PROJECT_ROOT)/applications
LIB_DIR = $(PROJECT_ROOT)/lib
CFLAGS += -I$(APP_DIR)
C_SOURCES += $(APP_DIR)/applications.c
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
@ -37,17 +39,12 @@ APP_NFC ?= 0
ifeq ($(APP_NFC), 1)
APP_MENU = 1
CFLAGS += -DAPP_NFC
C_SOURCES += $(wildcard $(APP_DIR)/nfc/*.c)
endif
APP_DOLPHIN ?= 0
ifeq ($(APP_DOLPHIN), 1)
APP_MENU = 1
CFLAGS += -DAPP_DOLPHIN
C_SOURCES += $(wildcard $(APP_DIR)/dolphin/*.c)
C_SOURCES += $(wildcard $(APP_DIR)/dolphin/scenes/*.c)
C_SOURCES += $(wildcard $(APP_DIR)/dolphin/scenes/assets/*.c)
C_SOURCES += $(wildcard $(APP_DIR)/dolphin/passport/*.c)
endif
APP_POWER ?= 0
@ -55,14 +52,12 @@ ifeq ($(APP_POWER), 1)
APP_GUI = 1
APP_CLI = 1
CFLAGS += -DAPP_POWER
C_SOURCES += $(wildcard $(APP_DIR)/power/*.c)
endif
APP_BT ?= 0
ifeq ($(APP_BT), 1)
APP_CLI = 1
CFLAGS += -DAPP_BT
C_SOURCES += $(wildcard $(APP_DIR)/bt/*.c)
endif
APP_MENU ?= 0
@ -75,19 +70,11 @@ ifeq ($(BUILD_MENU), 1)
APP_INPUT = 1
APP_GUI = 1
CFLAGS += -DBUILD_MENU
C_SOURCES += $(wildcard $(APP_DIR)/menu/*.c)
C_SOURCES += $(wildcard $(APP_DIR)/app-loader/*.c)
endif
APP_TEST ?= 0
ifeq ($(APP_TEST), 1)
CFLAGS += -DAPP_TEST
C_SOURCES += $(APP_DIR)/tests/furi_record_test.c
C_SOURCES += $(APP_DIR)/tests/test_index.c
C_SOURCES += $(APP_DIR)/tests/minunit_test.c
C_SOURCES += $(APP_DIR)/tests/furi_valuemutex_test.c
C_SOURCES += $(APP_DIR)/tests/furi_pubsub_test.c
C_SOURCES += $(APP_DIR)/tests/furi_memmgr_test.c
endif
APP_EXAMPLE_BLINK ?= 0
@ -98,7 +85,6 @@ endif
BUILD_EXAMPLE_BLINK ?= 0
ifeq ($(BUILD_EXAMPLE_BLINK), 1)
CFLAGS += -DBUILD_EXAMPLE_BLINK
C_SOURCES += $(APP_DIR)/examples/blink.c
APP_INPUT = 1
endif
@ -110,7 +96,6 @@ endif
BUILD_EXAMPLE_UART_WRITE ?= 0
ifeq ($(BUILD_EXAMPLE_UART_WRITE), 1)
CFLAGS += -DBUILD_EXAMPLE_UART_WRITE
C_SOURCES += $(APP_DIR)/examples/uart_write.c
endif
APP_EXAMPLE_IPC ?= 0
@ -121,7 +106,6 @@ endif
BUILD_EXAMPLE_IPC ?= 0
ifeq ($(BUILD_EXAMPLE_IPC), 1)
CFLAGS += -DBUILD_EXAMPLE_IPC
C_SOURCES += $(APP_DIR)/examples/ipc.c
endif
APP_EXAMPLE_INPUT_DUMP ?= 0
@ -132,7 +116,6 @@ endif
BUILD_EXAMPLE_INPUT_DUMP ?= 0
ifeq ($(BUILD_EXAMPLE_INPUT_DUMP), 1)
CFLAGS += -DBUILD_EXAMPLE_INPUT_DUMP
C_SOURCES += $(APP_DIR)/examples/input_dump.c
APP_INPUT = 1
endif
@ -144,13 +127,10 @@ endif
BUILD_EXAMPLE_QRCODE ?= 0
ifeq ($(BUILD_EXAMPLE_QRCODE), 1)
CFLAGS += -DBUILD_EXAMPLE_QRCODE
C_SOURCES += $(APP_DIR)/examples/u8g2_qrcode.c
C_SOURCES += $(LIB_DIR)/qrcode/qrcode.c
endif
ifeq ($(BUILD_SUBGHZ), 1)
CFLAGS += -DBUILD_SUBGHZ
C_SOURCES += $(wildcard $(APP_DIR)/subghz/*.c)
APP_INPUT = 1
APP_GUI = 1
APP_CLI = 1
@ -164,8 +144,6 @@ endif
BUILD_LF_RFID ?= 0
ifeq ($(BUILD_LF_RFID), 1)
CFLAGS += -DBUILD_LF_RFID
C_SOURCES += $(wildcard $(APP_DIR)/lf-rfid/*.c)
CPP_SOURCES += $(wildcard $(APP_DIR)/lf-rfid/*.cpp)
APP_INPUT = 1
APP_GUI = 1
endif
@ -178,8 +156,6 @@ endif
BUILD_IRDA ?= 0
ifeq ($(BUILD_IRDA), 1)
CFLAGS += -DBUILD_IRDA
C_SOURCES += $(wildcard $(APP_DIR)/irda/*.c)
C_SOURCES += $(wildcard $(APP_DIR)/irda/*/*.c)
APP_INPUT = 1
APP_GUI = 1
endif
@ -192,7 +168,6 @@ endif
BUILD_SD_TEST ?= 0
ifeq ($(BUILD_SD_TEST), 1)
CFLAGS += -DBUILD_SD_TEST
CPP_SOURCES += $(wildcard $(APP_DIR)/sd-card-test/*.cpp)
APP_INPUT = 1
APP_GUI = 1
APP_SD_FILESYSTEM = 1
@ -206,7 +181,6 @@ endif
BUILD_SPEAKER_DEMO ?= 0
ifeq ($(BUILD_SPEAKER_DEMO), 1)
CFLAGS += -DBUILD_SPEAKER_DEMO
C_SOURCES += $(wildcard $(APP_DIR)/coreglitch_demo_0/*.c)
APP_INPUT = 1
APP_GUI = 1
endif
@ -214,7 +188,6 @@ endif
BUILD_VIBRO_DEMO ?= 0
ifeq ($(BUILD_VIBRO_DEMO), 1)
CFLAGS += -DBUILD_VIBRO_DEMO
C_SOURCES += $(wildcard $(APP_DIR)/examples/vibro.c)
APP_INPUT = 1
endif
@ -226,7 +199,6 @@ endif
BUILD_KEYPAD_TEST ?= 0
ifeq ($(BUILD_KEYPAD_TEST), 1)
CFLAGS += -DBUILD_KEYPAD_TEST
C_SOURCES += $(APP_DIR)/examples/keypad_test.c
BUILD_KEYPAD_TEST = 1
endif
@ -238,7 +210,6 @@ endif
BUILD_GPIO_DEMO ?= 0
ifeq ($(BUILD_GPIO_DEMO), 1)
CFLAGS += -DBUILD_GPIO_DEMO
C_SOURCES += $(wildcard $(APP_DIR)/gpio-tester/*.c)
endif
APP_MUSIC_PLAYER ?= 0
@ -249,7 +220,6 @@ endif
BUILD_MUSIC_PLAYER ?= 0
ifeq ($(BUILD_MUSIC_PLAYER), 1)
CFLAGS += -DBUILD_MUSIC_PLAYER
C_SOURCES += $(wildcard $(APP_DIR)/music-player/*.c)
endif
APP_FLOOPPER_BLOOPPER ?= 0
@ -260,7 +230,6 @@ endif
BUILD_FLOOPPER_BLOOPPER ?= 0
ifeq ($(BUILD_FLOOPPER_BLOOPPER), 1)
CFLAGS += -DBUILD_FLOOPPER_BLOOPPER
C_SOURCES += $(wildcard $(APP_DIR)/floopper-bloopper/*.c)
endif
APP_IBUTTON ?= 0
@ -271,8 +240,6 @@ endif
BUILD_IBUTTON ?= 0
ifeq ($(BUILD_IBUTTON), 1)
CFLAGS += -DBUILD_IBUTTON
CPP_SOURCES += $(wildcard $(APP_DIR)/ibutton/*.cpp)
CPP_SOURCES += $(wildcard $(APP_DIR)/ibutton/*/*.cpp)
endif
APP_GUI_TEST ?= 0
@ -283,7 +250,6 @@ endif
BUILD_GUI_TEST ?= 0
ifeq ($(BUILD_GUI_TEST), 1)
CFLAGS += -DBUILD_GUI_TEST
C_SOURCES += $(wildcard $(APP_DIR)/gui-test/*.c)
endif
APP_SDNFC ?= 0
@ -294,33 +260,26 @@ endif
BUILD_SDNFC ?= 0
ifeq ($(BUILD_SDNFC), 1)
CFLAGS += -DBUILD_SDNFC
CPP_SOURCES += $(APP_DIR)/sdnfc/sdnfc.cpp
endif
# device drivers
APP_GUI ?= 0
ifeq ($(APP_GUI), 1)
CFLAGS += -DAPP_GUI
C_SOURCES += $(wildcard $(APP_DIR)/gui/*.c)
C_SOURCES += $(wildcard $(APP_DIR)/gui/modules/*.c)
C_SOURCES += $(wildcard $(APP_DIR)/backlight-control/*.c)
endif
APP_SD_FILESYSTEM ?= 0
ifeq ($(APP_SD_FILESYSTEM), 1)
CFLAGS += -DAPP_SD_FILESYSTEM
C_SOURCES += $(wildcard $(APP_DIR)/sd-filesystem/*.c)
endif
APP_INPUT ?= 0
ifeq ($(APP_INPUT), 1)
CFLAGS += -DAPP_INPUT
C_SOURCES += $(APP_DIR)/input/input.c
endif
APP_CLI ?= 0
ifeq ($(APP_CLI), 1)
APP_GUI = 1
CFLAGS += -DAPP_CLI
C_SOURCES += $(wildcard $(APP_DIR)/cli/*.c)
endif

View File

@ -1,6 +1,6 @@
#include <furi.h>
#include <api-hal.h>
#include <input.h>
#include <input/input.h>
static void event_cb(const void* value, void* ctx) {
const InputEvent* event = value;

View File

@ -1,6 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <furi.h>
#include "api-hal-delay.h"
#include "minunit.h"