I'm trying to build my project using Makefile
:
source := $(wildcard **/*.cpp)
headers := $(wildcard include/*.h)
objects := ${source:.cpp=.o}
run: $(objects)
g++ -o run $(objects)
diff -u <(cat $(source)) <(clang-format $(source))
%.o: %.cpp tests/%.cpp $(headers)
g++ $@ -o $<
And execution throws error:
/bin/sh: 1: Syntax error: "(" unexpected
make: *** [Makefile:8: run] Error 2
Then I tried to add #!/bin/bash
at the beginning of the makefile but got the same result.
What could be the problem and how can I fix it?