I am trying to create a makefile for compiling an Oculus Rift based program. I have the object files of the Oculus Rift library in a directory and the header files in another directory. Here's my makefile:
#####
# MAIN PROGRAM
#####
CXX = g++
CXXFLAGS =
DEPS_OVR = ($wildcard LibOVR/Src/*.h) ($wildcard LibOVR/Src/CAPI/*.h) ($wildcard LibOVR/Src/Util/*.h)
DEPS =
OBJ_OVR = ($wildcard LibOVR/Obj/Linux/Release/x86_64/*.o)
OBJ = main.o
EXE = BenchOculus
LIBS =
#####
# RULES
#####
all: $(EXE)
%.o: %.cpp $(DEPS_OVR) $(DEPS)
$(CXX) -Wall -c -o $@ $< $(CXXFLAGS) $(LIBS)
$(EXE): $(OBJ) $(OBJ_OVR)
$(CXX) -o $@ $(OBJ) $(OBJ_OVR) $(CXXFLAGS) $(LIBS)
chmod +x $@
clean:
rm -f $(OBJ)
rm -f $(EXE)
When I run make, I have the following error:
make: *** No rule to make target `(ildcard', needed by `BenchOculus'. Stop.
I think the problem may reside in DEPS_OVR and OBJ_OVR but I can't figure how to fix this.
Look at the error message, and ask yourself why it's complaining about a target (ildcard
, when what you wrote was ($wildcard ...
. That tells you, to within a character or so, where your error is. Then go back and check the documentation for the wildcard
function in GNU Make.