mbcrawfo/GenericMakefile

multiple source path

Opened this issue · 1 comments

How can I append multiple source paths?

my present makefile looks like this. but I don't know how to place multiple path in SRC_PATH

# Path to the source directory, relative to the makefile
SRC_PATH = . ../../../source
# Add additional include paths
INCLUDES = -I. -I../../../source -I../../../config

Error

blinky.c:1: *** missing separator.  Stop.

Looks like the problem is happening on line 219. That line is intended to add a rule for every file that's part of your project, but when you try to use multiple paths after the variable substitution happens that line will become something like build_path/%.o: src_path_1 src_path_2 src_path_3/%.c. This isn't valid make syntax (due to the spaces between the source paths) and causes the missing separator error that you're seeing.

Unfortunately I don't know of a straightforward way to add support for this since to my knowledge make variables only support simple text substitution (no array support). Happy to look at PR's if I'm wrong there or anyone knows a good workaround.