Celeb Glow
general | March 14, 2026

What is a Makefile.inc?

I have a basic questions as to if some Makefile includes a Makefile.inc. Generally what commands/configurations/rules go into the Makefile.inc ?

Any pointers would be useful.

thank you.

-AD

3 Answers

It depends. I've seen a makefile include <system>.inc files for system specific settings. Before you compile, you need to make sure that the correct .inc is used for the system that you are on.

It is also common to have project settings in .inc files, when there are multiple sub-makefiles for a project (one per directory).

It is also used to share common makefile code across different projects.

This depends on the programmer who wrote this make file.

Normally, a Makefile.inc file contains a common set of definitions and macros that are used across more than one installation. This way, they are more easily and centrally maintained.

It is just a text file whose extension as per 'just convention' is set as inc rather than txt.

Why? - Just to identify that the file is to be used for importing common variables and functions.

inc files are not language-specific, they are simply text files and can have any filename.

In your case - the programmer must have named Makefile.inc arbitrarily to say that it has common var and functions defined to be included in his actual Makefile.

Syntax: include < filename>.inc

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