User forums > Using Code::Blocks

How makefile

(1/2) > >>

Дмитро:
Good afternoon! I never learned how to use makefile, which is present in other projects, or write them myself. I can't figure it out. Here is the project, what settings do I need to make it work?

Do I need to create a project *.cbp if some makefile is already present?


Checking if target is up-to-date: mingw32-make.exe -q -f D:\Makefile-Templates\Makefile-Templates-master\SmallProject\Example\Makefile Debug
Running command: mingw32-make.exe -f D:\Makefile-Templates\Makefile-Templates-master\SmallProject\Example\Makefile Debug
mingw32-make.exe: *** No rule to make target 'Debug'.  Stop.
Process terminated with status 2 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 :-\

Дмитро:
Well, here's a self-written makefile. That is, I typed it by hand. When I write them myself, I always have the same mistake every time. What it is?

||=== Build: Debug in makefile1 (compiler: GNU GCC Compiler) ===|
Makefile|3|*** missing separator.  Stop.|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 2 second(s)) ===|

Miguel Gimenez:
Whitespace in makefiles is very strict, you must use tabs and remove most spaces.

Miguel Gimenez:
For example, in this target

--- Code: ---distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile

--- End code ---
whitespace before -rm is a tab, while the rest are spaces. There is no space between distclean and the colon, in your makefile there are some.

Дмитро:
Thanks! For several months, with great irritation, I did not understand what was going on. Finally everything is clear, use the Tab key! It's so simple that I laughed.

Navigation

[0] Message Index

[#] Next page

Go to full version