cleaning up the build

This commit is contained in:
Attila Body 2019-12-16 11:20:59 +01:00
parent f714f6cd50
commit 24552e91a4
6 changed files with 20 additions and 40 deletions

4
.gitignore vendored
View file

@ -1,7 +1,5 @@
_[Bb][Uu][Ii][Ll][Dd]*/ _[Bb][Uu][Ii][Ll][Dd]*/
/[Bb][Uu][Ii][Ll][Dd]/ /[Bb][Uu][Ii][Ll][Dd]*/
_[Tt][Ee][Ss][Tt]*/
/[Tt][Ee][Ss][Tt]/
[Dd]ebug/ [Dd]ebug/
[Rr]elease/ [Rr]elease/
*.[Bb][Aa][Kk] *.[Bb][Aa][Kk]

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>f407ve_packetusart_c</name> <name>mississippi-mcu-packetusart-testbed</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>

View file

@ -312,8 +312,8 @@ ProjectManager.MainLocation=Src
ProjectManager.NoMain=false ProjectManager.NoMain=false
ProjectManager.PreviousToolchain=STM32CubeIDE ProjectManager.PreviousToolchain=STM32CubeIDE
ProjectManager.ProjectBuild=false ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=f407ve_packetusart_c.ioc ProjectManager.ProjectFileName=mississippi-mcu-packetusart-testbed.ioc
ProjectManager.ProjectName=f407ve_packetusart_c ProjectManager.ProjectName=mississippi-mcu-packetusart-testbed
ProjectManager.StackSize=0x400 ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=STM32CubeIDE ProjectManager.TargetToolchain=STM32CubeIDE
ProjectManager.ToolChainLocation= ProjectManager.ToolChainLocation=

View file

@ -6,24 +6,5 @@ endif
#$(eval C_SOURCES += $(wildcard $(REL_DIR)/*.c)) #$(eval C_SOURCES += $(wildcard $(REL_DIR)/*.c))
$(eval COMMON_INCLUDES += -I$(REL_DIR)) $(eval COMMON_INCLUDES += -I$(REL_DIR))
ifeq ($(MKDBG), 1) ifeq ($(MKDBG), 1)
$(info $$C_SOURCES is [${C_SOURCES}])
$(info )
$(info $$CXX_SOURCES is [${CXX_SOURCES}])
$(info )
$(info $$COMMON_DEFS is [${COMMON_DEFS}])
$(info )
$(info $$C_DEFS is [${C_DEFS}])
$(info )
$(info $$CXX_DEFS is [${CXX_DEFS}])
$(info )
$(info $$COMMON_INCLUDES is [${COMMON_INCLUDES}])
$(info )
$(info $$C_INCLUDES is [${C_INCLUDES}])
$(info )
$(info $$CXX_INCLUDES is [${CXX_INCLUDES}])
$(info )
$(info $$CFLAGS is [${CFLAGS}])
$(info )
$(info $$CXXFLAGS is [${CXXFLAGS}])
$(info <<<) $(info <<<)
endif endif

View file

@ -7,9 +7,7 @@ $(eval C_SOURCES += $(wildcard $(REL_DIR)/platform/*.c))
$(eval COMMON_INCLUDES += -I$(REL_DIR) -I$(REL_DIR)/gtest_i386/include) $(eval COMMON_INCLUDES += -I$(REL_DIR) -I$(REL_DIR)/gtest_i386/include)
$(eval LIBDIR += -L$(REL_DIR)/gtest_i386/lib) $(eval LIBDIR += -L$(REL_DIR)/gtest_i386/lib)
$(eval LIBS += -lgtest -lgtest_main -lpthread) $(eval LIBS += -lgtest -lgtest_main -lpthread)
$(eval COMPONENT_DEPS += gtest_build) $(eval COMPONENT_DEPS += $(REL_DIR)/gtest_i386)
gtest_build: | $(REL_DIR)/gtest_i386
$(REL_DIR)/gtest_i386: $(REL_DIR)/gtest_i386:
$(REL_DIR)/build-googletest.sh gtest_i386 $(REL_DIR)/build-googletest.sh gtest_i386

View file

@ -13,7 +13,8 @@
###################################### ######################################
# target # target
###################################### ######################################
TARGET = f407ve_packetusart_c_test TARGET = mississippi-mcu-packetusart-testbed
COMPONENT_DEPS =
###################################### ######################################
# building variables # building variables
@ -30,7 +31,7 @@ CXXSTD = -std=c++0x
# paths # paths
####################################### #######################################
# Build path # Build path
BUILD_DIR = test BUILD_DIR = build_tests
COMPONENTS = components COMPONENTS = components
PLATFORMS = platforms PLATFORMS = platforms
PLATFORM = test PLATFORM = test
@ -109,6 +110,12 @@ ASFLAGS = $(CPU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall
CFLAGS = $(CPU) $(COMMON_DEFS) $(C_DEFS) $(COMMON_INCLUDES) $(C_INCLUDES) $(OPT) -Wall CFLAGS = $(CPU) $(COMMON_DEFS) $(C_DEFS) $(COMMON_INCLUDES) $(C_INCLUDES) $(OPT) -Wall
CXXFLAGS = $(CPU) $(COMMON_DEFS) $(CXX_DEFS) $(COMMON_INCLUDES) $(CXX_INCLUDES) $(OPT) $(CXXSTD) -Wall CXXFLAGS = $(CPU) $(COMMON_DEFS) $(CXX_DEFS) $(COMMON_INCLUDES) $(CXX_INCLUDES) $(OPT) $(CXXSTD) -Wall
# default action: build all
.PONY: all clean
all: $(BUILD_DIR)/$(TARGET)
####################################### #######################################
# components # components
####################################### #######################################
@ -158,15 +165,11 @@ ifeq ($(MKDBG), 1)
$(info $$LIBDIR is [${LIBDIR}]) $(info $$LIBDIR is [${LIBDIR}])
$(info ) $(info )
$(info $$LIBS is [${LIBS}]) $(info $$LIBS is [${LIBS}])
$(info )
$(info $$COMPONENT_DEPS is [${COMPONENT_DEPS}])
$(info <<--------------------------------------------) $(info <<--------------------------------------------)
endif endif
# default action: build all
.PONY: all clean
all: $(BUILD_DIR)/$(TARGET)
####################################### #######################################
# build the application # build the application
####################################### #######################################
@ -181,15 +184,15 @@ vpath %.s $(sort $(dir $(ASM_SOURCES)))
OBJECTS +=$(addprefix $(BUILD_DIR)/,$(CXX_SOURCES:.cpp=.o)) OBJECTS +=$(addprefix $(BUILD_DIR)/,$(CXX_SOURCES:.cpp=.o))
vpath %.cpp $(sort $(dir $(CXX_SOURCES))) vpath %.cpp $(sort $(dir $(CXX_SOURCES)))
$(BUILD_DIR)/%.o: %.c Makefile firmware.mk | $(BUILD_DIR) $(BUILD_DIR)/%.o: %.c Makefile firmware.mk $(COMPONENT_DEPS) | $(BUILD_DIR)
mkdir -p $(@D) mkdir -p $(@D)
$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(<:.c=.lst) $< -o $@ $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(<:.c=.lst) $< -o $@
$(BUILD_DIR)/%.o: %.cpp Makefile firmware.mk | $(BUILD_DIR) $(BUILD_DIR)/%.o: %.cpp Makefile firmware.mk $(COMPONENT_DEPS) | $(BUILD_DIR)
mkdir -p $(@D) mkdir -p $(@D)
$(CXXC) -c $(CXXFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(<:.cpp=.lst) $< -o $@ $(CXXC) -c $(CXXFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(<:.cpp=.lst) $< -o $@
$(BUILD_DIR)/%.o: %.s Makefile firmware.mk | $(BUILD_DIR) $(BUILD_DIR)/%.o: %.s Makefile firmware.mk $(COMPONENT_DEPS) | $(BUILD_DIR)
mkdir -p $(@D) mkdir -p $(@D)
$(AS) -c $(CFLAGS) $< -o $@ $(AS) -c $(CFLAGS) $< -o $@
@ -211,4 +214,4 @@ clean:
####################################### #######################################
-include $(wildcard $(BUILD_DIR)/*.d) -include $(wildcard $(BUILD_DIR)/*.d)
# *** EOF *** # *** EOF ***