/
Excluding platform specific files for a build

Excluding platform specific files for a build

This approach is to:

  • Name files with platform-specific suffixes (e.g., FooWindows.cpp for Windows, FooPosix.cpp for Linux/POSIX).

  • Utilize GNU make's pattern substitution to exclude non-relevant platform files during the build process.

OBJECTS := $(patsubst %Windows.o,,$(OBJECTS)) # Remove object files named *Windows.*

 

Related content

make wildcard matching list of files
make wildcard matching list of files
More like this
Make Dependency Files for C/C++ Headers
Make Dependency Files for C/C++ Headers
More like this
Make recipe rule
Make recipe rule
More like this
Linking an Executable - Example
Linking an Executable - Example
Read with this
Simple make system - putting it all together
Simple make system - putting it all together
More like this
Assign and use make variable
Assign and use make variable
Read with this