Skip to content
Snippets Groups Projects
Commit 8b9ac2d4 authored by Luca Erbetta's avatar Luca Erbetta :rocket:
Browse files

[SBS] Added ability to add library-specific defines

parent cef53632
Branches
Tags
No related merge requests found
......@@ -111,11 +111,11 @@ $(OBJDIR)/%.o: %.s
$(OBJDIR)/%.o : %.c
$(ECHO) "[CC] " $<
$(Q) $(CC) $(DFLAGS) $(CFLAGS) {SBS_CUSTOM_DEFINES} $< -o $@
$(Q) $(CC) $(DFLAGS) $(CFLAGS) {SBS_CUSTOM_DEFINES} {SBS_LIB_DEFINES} $< -o $@
$(OBJDIR)/%.o : %.cpp
$(ECHO) "[CXX] " $<
$(Q) $(CXX) $(DFLAGS) $(CXXFLAGS) {SBS_CUSTOM_DEFINES} $< -o $@
$(Q) $(CXX) $(DFLAGS) $(CXXFLAGS) {SBS_CUSTOM_DEFINES} {SBS_LIB_DEFINES} $< -o $@
folders:
$(Q) mkdir -pv $(dir $(OBJ)) $(BINDIR)
......
......@@ -156,6 +156,7 @@ def parseConf(path):
elif stype == 'library':
extlibs[i] = {'subdir': conf.get(i, 'Subdir'),
'libs': [x.strip() for x in conf.get(i, 'Libs').split()],
'defines': conf.get(i, 'Defines').strip(),
'includes': [x.strip() for x in conf.get(i, 'Includes').split()]}
elif stype == 'board' or stype == 'test':
if stype == 'test':
......@@ -221,7 +222,8 @@ def build_makefile(template, board, bname):
"BIN_NAME": board['bin'],
"LIB_SUBDIR": " ".join([x['subdir'] for _,x in board['libs'].items()]),
"LIB_LIBS": " ".join([" ".join(x['libs']) for _,x in board['libs'].items()]),
"LIB_INCLUDES": " ".join([" ".join([ "-I" + s for s in x['includes']]) for _,x in board['libs'].items()])
"LIB_INCLUDES": " ".join([" ".join([ "-I" + s for s in x['includes']]) for _,x in board['libs'].items()]),
"LIB_DEFINES": " ".join(x['defines'] for _,x in board['libs'].items())
}
rmap["PROJECT_INCLUDES"] = "-I" + projconf["SRC_PATH"].strip() + " "
......
......@@ -93,14 +93,30 @@ PROJECT_LIBS:
Type: library
Subdir: libs/mxgui
Libs: libs/mxgui/libmxgui.a
Defines:
Includes: libs/mxgui
[eigen]
Type: library
Subdir:
Libs:
Defines:
Includes: libs/eigen
[fmt]
Type: library
Subdir: libs/fmt/
Libs: libs/fmt/libfmt.a
Defines: -DFMT_STATIC_THOUSANDS_SEPARATOR=0 -D_GLIBCXX_USE_WCHAR_T
Includes: libs/fmt/include
[fmt-header-only]
Type: library
Subdir:
Libs:
Defines:
Includes: libs/fmt/include
#-----------------------------------#
# List of Sources #
#-----------------------------------#
......@@ -322,8 +338,18 @@ BoardId: stm32f429zi_stm32f4discovery
BinName: test-serial
Include:
Defines:
Libs: fmt
Main: test-serial
[test-trace-logger]
Type: test
BoardId: stm32f429zi_stm32f4discovery
BinName: test-trace-logger
Include: src/shared/diagnostic/PrintLogger.cpp
Defines: -DDEBUG
Libs: fmt
Main: test-trace-logger
[test-hsm]
Type: test
BoardId: stm32f429zi_stm32f4discovery
......@@ -612,6 +638,7 @@ Main: drivers/xbee/test-xbee-rcv
[test-xbee-bidir]
Type: test
# BoardId: stm32f429zi_skyward_death_stack_x
BoardId: stm32f429zi_stm32f4discovery
BinName: test-xbee-bidir
Include: %shared %spi %xbee %logger
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment