Skipping A cpp file from make

How do you Skip a particular source file from compilation.

Short answer is use makefile’s filter-out

Long Answer :

While building any decent sized software you create a bunch of MakeFiles.

Like one for each module and one for generating your binary or the lib file.

Certain rules are defined in special Makefiles that are included by each Makefile.

These rules might be defined in the module makefiles as well.

You might have suffix or pattern role that defines how a .c or .cpp has to be compiled.

If you auto-generate a list of SOURCE files using find or any other Shell Command, you end up  listing all the .cpp or .c files in the directry.What if you do not want to compile a file called OnlyForWinDowsImplementation.cpp but you do not want to delete or modify this file.You can use Make’s filter-out to filter the file(s) out.

Read more about GNU Make’s text functions  here

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close