'Exlude Directory from Source Files in Makefile?
NOTE: I use Mingw Make.
Basically, I've got a makefile with the following snippet for source files:
SRC_FILES = $(wildcard $(SRC_DIR)/*.c $(SRC_DIR)/*/*.c $(SRC_DIR)/*/*/*.c)
SRC_FILES := $(filter-out $(SRC_DIR)/sys/mswin/win_main.c, $(SRC_FILES))
Not the prettiest, I'll admit I'm still a beginner, but it does work. However, the second line shows what I'd like to exclude. Issue is, I currently have to do this per file I want to exclude. (Note: I've tried replacing win_main.c with *.c, doesn't work).
What I'd like to be able to do is exclude the entire 'sys' directory from SRC_FILES, but I'm honestly unsure of how to do this. I attempted to have:
SRC_FILES := $(filter-out $(SRC_DIR)/sys, $(SRC_FILES))
But this didn't work, either. I'm honestly unsure if this is even possible at this point, but I hope I'm just missing something. Any help is appreciated!
EDIT: I know that the project structure itself isn't ideal, but that's not really the point of this, however improvement tips are certainly apprectiated, and if you need any other information to answer the question just ask.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
