News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

How makefile

Started by Дмитро, February 21, 2022, 03:08:20 PM

Previous topic - Next topic

Дмитро

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

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

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.

Дмитро

#4
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.

Дмитро

#5
But again

Checking if target is up-to-date: mingw32-make.exe -q -f Makefile Debug
Running command: mingw32-make.exe -f Makefile Debug
mingw32-make.exe: *** No rule to make target 'Debug'.  Stop.

jordi

There are two possibilities:
You don't have the target Debug in your makefile
Debug: .....
Or it is not declared in the .PHONY whether Debug is not a file
.PHONY: Debug ....