1

I have generated a ThreadX project using CubeMX, which has provided me with both .s and .S files. When building using make I get the 'No rule to make target' for the .S files, but not for the .s file (the object file is created successfully)... What is the difference between these types of files, and is there an extra step one must take for building .S files into object files? I have understood that this error mainly occurs when the compiler does not find the file, but I have verified the path several times.

hdl
  • 13
  • 3
  • `.S` is for assembly files that get preprocessed by the C preprocessor. `.s` is for files where this does not apply. – fuz Mar 01 '22 at 10:17
  • depends on the tool being used. as mentioned with gnu tools this can often mean C preprocess or straight to the assembler. but you need to provide more information (and the answer should be in that information) – old_timer Mar 01 '22 at 15:42

1 Answers1

1

No, there's no difference in how you should build them, gcc -c works on either to produce a .o.

GCC handles the difference in pre-processing them or not.

Obviously your Makefile needs to have a rule to build a .o from a .s or .S. At the simplest, just duplicate the pattern rule for %.o: %.S, since it seems to be surprisingly inconvenient to define a case-insensitive pattern rule or simply list two possible patterns for one rule in the general case.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847