mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
Generate USB Strings from apps/*/usb_strings.txt files at compile time
This way we can skip the manually-crafted USB string definitions in the dfu_desc.c and usb.c files.
This commit is contained in:
@@ -139,6 +139,7 @@ INCLUDES += -Ilibboard/common/include -Ilibboard/$(BOARD)/include
|
||||
INCLUDES += -Ilibcommon/include
|
||||
INCLUDES += -Ilibosmocore/include
|
||||
INCLUDES += -Isrc_simtrace -Iinclude
|
||||
INCLUDES += -Iapps/$(APP)
|
||||
|
||||
CFLAGS += -Wall -Wchar-subscripts -Wcomment -Wimplicit-int #-Wformat=2
|
||||
CFLAGS += -Werror-implicit-function-declaration -Wmain -Wparentheses
|
||||
@@ -179,11 +180,17 @@ OUTPUT := $(BIN)/$(OUTPUT)
|
||||
# Rules
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
all: $(BIN) $(OBJ) $(MEMORIES)
|
||||
all: apps/$(APP)/usb_strings_generated.h $(BIN) $(OBJ) $(MEMORIES)
|
||||
|
||||
$(BIN) $(OBJ):
|
||||
mkdir $@
|
||||
|
||||
usbstring/usbstring: usbstring/usbstring.c
|
||||
gcc $^ -o $@
|
||||
|
||||
apps/$(APP)/usb_strings_generated.h: apps/$(APP)/usb_strings.txt usbstring/usbstring
|
||||
cat $< | usbstring/usbstring > $@
|
||||
|
||||
define RULES
|
||||
C_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(C_OBJECTS))
|
||||
ASM_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(ASM_OBJECTS))
|
||||
|
||||
Reference in New Issue
Block a user