cancel
Showing results for 
Search instead for 
Did you mean: 

Make file rule failures. No rule to make target for .s files (i.e. build/tx_initialize_low_level.o)

William2003
Associate II

I've been trying to build example projects (i.e. Ux_Host_HID) with the make tool chain config with stm32cubeMX

So when i run make, a bunch of stuff compiles, then i get this error.

make: *** No rule to make target 'build/tx_initialize_low_level.o', needed by 'build/Ux_Host_HID.elf'.  Stop.
 
 
So when I search for that tx_initialize_low_level I find a .s assembly file in  Ux_Host/Core.Src
Also, the make file seems to already be looking for assembly files to create the .o but for some reason, make is not recognizing it has a valid rule. 

 

$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
$(AS) -c $(CFLAGS) $< -o $@
$(BUILD_DIR)/%.o: %.S Makefile | $(BUILD_DIR)
$(AS) -c $(CFLAGS) $< -o $@

 

 

Note: all files are generated from STM32CubeMX form their examples directory.

4 REPLIES 4
Ghofrane GSOURI
ST Employee

Hello @William2003 

Thank you for your valuable contribution.

I was able to reproduce the issue mentioned above 

 

GhofraneGSOURI_0-1762775993066.png

The issue has already been identified and escalated to the development team under internal ticket number 220146. It will be addressed and resolved as soon as possible.

I will keep you posted with updates.

THX

Ghofrane

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I'm using STM32CubeMX (6.15.0) and compiling those generated files in cmd
line with make


I think there is an issue with the auto-generated makefile. Its not picking
up the assembly files in
/STM32Cube/Example/Ux_Host_HID/Middlewares/ST/threadx/ports/cortex_m7/gnu/src/

I've found a solution by copying those files in the top directory
I think there is an error in the make file (i.e. below) where it uses the
vpath directive to target the assembly (.s .S) files.

There error must be in the following lines.

OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))OBJECTS
+= $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
vpath %.s $(sort $(dir $(ASM_SOURCES)))
vpath %.s $(sort $(dir $(ASM_SOURCES)))
William2003
Associate II

I think the initial challenge was to make sure that the correct set of assembly files are selected (ac6, gnu, iar). In my case I was compiling with gnu. 

 

 

Some notes:

[1] OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
C_SOURCES ->list of fullpath/file.c -> i.e. /Middlewares/ST/threadx/common/src/txe_timer_delete.c Middlewares/ST/threadx/common/src/txe_timer_info_get.c
C_SOURCES:.c=.o) -> replaces .c for .o -> i.e. /Middlewares/ST/threadx/common/src/txe_timer_delete.o Middlewares/ST/threadx/common/src/txe_timer_info_get.o
notdir (...) -> removes path txe_timer_delete.o txe_timer_info_get.o
addprefix($(BUIL_DIR), $(...)) -> ADDs build/ -> i.e. build/txe_timer_delete.c build/txe_timer_info_get.c

[2] vpath %.c $(sort $(dir $(C_SOURCES)))
yields all unique paths .c sources to vpath -> i.e. Middlewares/ST/threadx/common/src/ Middlewares/ST/threadx/common/src/

 

looks like vpath directive is used to append those files. I'm thinking of appending those paths to the VPATH MAKE SHELL VARIABLE instead. When I run the make file and print VPATH, its empty.

 

Thanks for the feedback

 

William2003
Associate II

I think the reason why this is failing, is because there are 3 versions of these assembly files

/home/williamkolment/STM32Cube/Example/Ux_Host_HID/Middlewares/ST/threadx/ports/cortex_m7/gnu/src/

/home/williamkolment/STM32Cube/Example/Ux_Host_HID/Middlewares/ST/threadx/ports/cortex_m7/ac6/src/

/home/williamkolment/STM32Cube/Example/Ux_Host_HID/Middlewares/ST/threadx/ports/cortex_m7/iar/src/

one for each type of toolchain. So, I suspect the vpath directive(lowercase) is not working properly

i.e. these lines -> vpath %.s $(sort $(dir $(ASM_SOURCES)))

 

So instead, I appended a path to VPATH make shell variable each time theres duplicate sets of files 

VPATH = Middlewares/ST/threadx/ports/cortex_m7/gnu/src

This FIXED THE COMPILATION ERRORS

I suspect, that STM32CubeMx is generating more files a than needed.