Exclude source file in compilation using Makefile
If you're using GNU Make, you can use filter-out
:
SRC_FILES := $(wildcard src/*.cpp)
SRC_FILES := $(filter-out src/bar.cpp, $(SRC_FILES))
Or as one line:
SRC_FILES = $(filter-out src/bar.cpp, $(wildcard src/*.cpp))
use find for it :)
SRC_FILES := $(shell find src/ ! -name "bar.cpp" -name "*.cpp")