Hi
I'm perplexed. :-/
I added a module "EEPROM" (files found from another forum contributor, based on ST AN2594) to my command line toolchain ~/libmaple/libraries/
folder.
I had to create a rules.mk
file. This is what I have for that ...
~/libmaple/libraries/EEPROM/rules.mk:
---
# Standard things
sp := $(sp).x
dirstack_$(sp) := $(d)
d := $(dir)
BUILDDIRS += $(BUILD_PATH)/$(d)
# Local flags
CFLAGS_$(d) := $(WIRISH_INCLUDES) $(LIBMAPLE_INCLUDES)
CXXFLAGS_$(d) := $(WIRISH_INCLUDES) $(LIBMAPLE_INCLUDES)
# Local rules and targets
cSRCS_$(d) := flash_stm32.c
cppSRCS_$(d) := EEPROM.cpp
cFILES_$(d) := $(cSRCS_$(d):%=$(d)/%)
cppFILES_$(d) := $(cppSRCS_$(d):%=$(d)/%)
OBJS_$(d) := $(cFILES_$(d):%.c=$(BUILD_PATH)/%.o) \
$(cppFILES_$(d):%.cpp=$(BUILD_PATH)/%.o)
DEPS_$(d) := $(OBJS_$(d):%.o=%.d)
$(OBJS_$(d)): TGT_CFLAGS := $(CFLAGS_$(d))
$(OBJS_$(d)): TGT_CXXFLAGS := $(CXXFLAGS_$(d))
TGT_BIN += $(OBJS_$(d))
# Standard things
-include $(DEPS_$(d))
d := $(dirstack_$(sp))
sp := $(basename $(sp))
Now when I compile, it appears that my main project rules.mk
file is being ignored -- or at least the cppSRCS
part ...
make
...
[CXX] /Users/bryan/libmaple/libraries/FreeRTOS/MapleFreeRTOS.cpp
[CC] /Users/bryan/libmaple/libraries/EEPROM/flash_stm32.c
[CXX] /Users/bryan/libmaple/libraries/EEPROM/EEPROM.cpp
[CXX] main.cpp
[LD] maple_mini.elf
Notice that there is no longer a real-main.cpp
, as there normally is! Huh?!
When I remove the new EEPROM library from ~/libmaple/Makefile
...
# User modules
###USER_MODULES := $(SRCROOT)/libraries/EEPROM <--- commented out
# User modules:
ifneq ($(USER_MODULES),)
LIBMAPLE_MODULES += $(USER_MODULES)
endif
... my real-main.cpp
gets compiled again and all is well -- except I don't have my new EEPROM library available, of course.
- - -
I've spent well over an hour trying to figure out what I've done wrong. I just can't see it for the looking. :-/
Any ideas? Thanks!
P.S: When I aded this same new EEPROM module to the IDE, by placing it in ~/Documents/MapleIDE/libraries
, all worked as expected. That is, the Maple IDE compiler worked. But then, it doesn't use a real-main.cpp
anyway. Hmmm. {shrug}