Re: [anjuta-devel] [anjuta-list] Is it possible to create a target with its own command



Hi Igor,


Le 22/05/2017 à 16:47, Igor Korot a écrit :
What this target does is generating a header file by running a binary
"comp_err" that was built previously.
So it is not a standard .so/.a library and it is not an executable.
Moreover it is running its own binary to make such target.
Is it possible?

I think yes, make is used to solve this kind of problem.


Now writing a Makefile is the work that I'm not a goof at.
Never had to try it.
I was successfully using Anjuta, MSVC and Xcode before this occurs.
Can you give some instruction on how to do that?

You probably need to read some documentation about makefile. There is nothing specific to Anjuta here. It can be something simple like

* Create a new file named Makefile in your directory
* Write in it in something like
all:
<tab>_write_the_command_used_to_generate_comp_err_
<tab>_write_the_command_used_to_generate_your_target_

The tab and not whitespace is mandatory at the beginning of the lines. Then, in Anjuta if you open a makefile project and open a file in this directory when you click on build, the first target (all here) will be executed.

If your project already used autotools, you should already have some files named Makefile.am in this directory. You can add those lines in it, but you should probably replace the all target by a dependency. It can be a dummy file that you add as a dependency of the make target generated by autotools. You can look in the build directory how is this makefile, it can be a bit complex.


But if you don't know make, the easiest solution is to create a menu item with the tools plugins but it is global and not linked to your project.


Or it is possible to create such target in Anjuta?

No, Anjuta will just call the makefile but will not write it.


Regards,

Sébastien


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]