M BUZZ CRAZE NEWS
// news

Is it possible to compile with make.inc and Makefile

By Emma Johnson

I am a newbie to the use of make files.

I have added a new module in project using make.inc

The structure of project is like:-

/Project/build.sh
/Project/make.inc
/Project/Module1/Makefile
/Project/Module2/Makefile
/Project/Module3/Makefile
/Project/Module4/Makefile
/Project/my_module/Makefile

Initially project the has 4 other modules each of which are compilable using make.inc

The module I have added till now is getting compiled with its own Makefile. Now I have included the make.inc path in this make file to reuse the CFLAGS already defined in make.inc as many flags are same for all modules. Now I am able to compile the whole project using build.sh using make.inc .

But when I compile my module alone with Makefile , its giving error as the the CFLAGS are defined in the make.inc and the Variable carrying the value of path of the module is also defined there.

How can I get that path when I run this make file only

I want to know How can make it compilable using both make file and make.inc

TIA

1 Answer

I think there should be a main Makefile in the root directory that contains a command such as include ./make.inc.

Or add on top of each subfolder\Makefile file: include ../make.inc

I found a nice example at:

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy