I am brand new to make files and Boost
, and I'm trying to follow this tutorial, specifically Makefile4.
I only have two source files, namely S1.cpp
, where main.cpp
is located, and GaussQuadrature.h
. Now, GaussQuadrature.h
also uses a Boost
file, so (as far as I know) I must tell the compiler where Boost
is located, which is up two directories from where my source files are. My makefile is
CC=g++
CFLAGS=-o2 -std=c++0x
DEPS = GaussQuadrature.h
OBJ = S1.o
%.o: %.cpp $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
S1: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) S1.o -o S1 -I ../../boost_1_55_0
When I run the make command I get the error
makeS1:7: *** missing separator. Stop.
I've read this is most commonly due to missing tabs for the command (and it's interesting that when I hit 'tab' that the two commands are indented differently above), but even when I change those to
%.o: %.cpp $(DEPS)
\t$(CC) -c -o $@ $< $(CFLAGS)
S1: $(OBJ)
\t$(CC) -o $@ $^ $(CFLAGS) S1.o -o S1 -I ../../boost_1_55_0
I get the same error.
Other than fixing this error, what is proper way to include the Boost
directory in a makefile, or is there a way around including it altogether? Thanks!