Home > database >  Is there a difference in the way one should build .S files vs .s files using makefile?
Is there a difference in the way one should build .S files vs .s files using makefile?

Time:03-01

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.

CodePudding user response:

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.

  • Related