In my Makefile I need to get a list of all directories present in some other directory.
To get a list of all directories in the same folder as my Makefile
I use:
DIRECTORIES = $(wildcard */)
all:
echo $(DIRECTORIES)
which works fine, and gives me the desired list. However if I want to have a list of all directories in another directory using
DIRECTORIES = $(wildcard ../Test/*/)
all:
echo $(DIRECTORIES)
I get a list of ALL files (with paths) in that directory, including .h
and .cpp
files.
Any suggestions why this happens and how to fix it? Other solutions to obtain the list are also welcome.