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 ...@@ -111,11 +111,11 @@ $(OBJDIR)/%.o: %.s
$(OBJDIR)/%.o : %.c $(OBJDIR)/%.o : %.c
$(ECHO) "[CC] " $< $(ECHO) "[CC] " $<
$(Q) $(CC) $(DFLAGS) $(CFLAGS) {SBS_CUSTOM_DEFINES} $< -o $@ $(Q) $(CC) $(DFLAGS) $(CFLAGS) {SBS_CUSTOM_DEFINES} {SBS_LIB_DEFINES} $< -o $@
$(OBJDIR)/%.o : %.cpp $(OBJDIR)/%.o : %.cpp
$(ECHO) "[CXX] " $< $(ECHO) "[CXX] " $<
$(Q) $(CXX) $(DFLAGS) $(CXXFLAGS) {SBS_CUSTOM_DEFINES} $< -o $@ $(Q) $(CXX) $(DFLAGS) $(CXXFLAGS) {SBS_CUSTOM_DEFINES} {SBS_LIB_DEFINES} $< -o $@
folders: folders:
$(Q) mkdir -pv $(dir $(OBJ)) $(BINDIR) $(Q) mkdir -pv $(dir $(OBJ)) $(BINDIR)
......
...@@ -156,6 +156,7 @@ def parseConf(path): ...@@ -156,6 +156,7 @@ def parseConf(path):
elif stype == 'library': elif stype == 'library':
extlibs[i] = {'subdir': conf.get(i, 'Subdir'), extlibs[i] = {'subdir': conf.get(i, 'Subdir'),
'libs': [x.strip() for x in conf.get(i, 'Libs').split()], '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()]} 'includes': [x.strip() for x in conf.get(i, 'Includes').split()]}
elif stype == 'board' or stype == 'test': elif stype == 'board' or stype == 'test':
if stype == 'test': if stype == 'test':
...@@ -221,7 +222,8 @@ def build_makefile(template, board, bname): ...@@ -221,7 +222,8 @@ def build_makefile(template, board, bname):
"BIN_NAME": board['bin'], "BIN_NAME": board['bin'],
"LIB_SUBDIR": " ".join([x['subdir'] for _,x in board['libs'].items()]), "LIB_SUBDIR": " ".join([x['subdir'] for _,x in board['libs'].items()]),
"LIB_LIBS": " ".join([" ".join(x['libs']) 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() + " " rmap["PROJECT_INCLUDES"] = "-I" + projconf["SRC_PATH"].strip() + " "
......
...@@ -93,14 +93,30 @@ PROJECT_LIBS: ...@@ -93,14 +93,30 @@ PROJECT_LIBS:
Type: library Type: library
Subdir: libs/mxgui Subdir: libs/mxgui
Libs: libs/mxgui/libmxgui.a Libs: libs/mxgui/libmxgui.a
Defines:
Includes: libs/mxgui Includes: libs/mxgui
[eigen] [eigen]
Type: library Type: library
Subdir: Subdir:
Libs: Libs:
Defines:
Includes: libs/eigen 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 # # List of Sources #
#-----------------------------------# #-----------------------------------#
...@@ -322,8 +338,18 @@ BoardId: stm32f429zi_stm32f4discovery ...@@ -322,8 +338,18 @@ BoardId: stm32f429zi_stm32f4discovery
BinName: test-serial BinName: test-serial
Include: Include:
Defines: Defines:
Libs: fmt
Main: test-serial 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] [test-hsm]
Type: test Type: test
BoardId: stm32f429zi_stm32f4discovery BoardId: stm32f429zi_stm32f4discovery
...@@ -612,6 +638,7 @@ Main: drivers/xbee/test-xbee-rcv ...@@ -612,6 +638,7 @@ Main: drivers/xbee/test-xbee-rcv
[test-xbee-bidir] [test-xbee-bidir]
Type: test Type: test
# BoardId: stm32f429zi_skyward_death_stack_x
BoardId: stm32f429zi_stm32f4discovery BoardId: stm32f429zi_stm32f4discovery
BinName: test-xbee-bidir BinName: test-xbee-bidir
Include: %shared %spi %xbee %logger 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