I'm trying to produce a makefile for use with my Raspberry Pi, the intention is to use the Pi's camera board to detect faces with opencv. However I keep facing myself with the following error:
Makefile:12: *** commands commence before first target. Stop.
I use the following makefile:
FLAGS = 'pkg-config --cflags opencv --libs opencv'
CC = g++
HOME = /home/pi
LDFLAGS_CAMCV = -L$(HOME)/git/robidouille/raspicam_cv -lraspicamcv
LDFLAGS_USER =-L$(HOME)/git/raspberrypi/userland/build/lib -lmmal_core -lmmal -$
LDFLAGS_FACE = -l$(HOME)/git/emobot/libfacere0.04
LDFLAGS = $(LDFLAGS_CAMCV) $(LDFLAGS_USER) $(LDFLAGS_FACE)
INCLUDE = -I$(HOME)/git/robidouille/raspicam_cv
$(CC) -o emobot_test.exe: main.cpp $(INCLUDE) $(LDFLAGS)
LDFLAGS_CAMCV
and LDFLAGS_USER
are required for the raspicamcv library and INCLUDE
is the associated header file. LDFLAGS_FACE
is needed to detect faces in opencv2.3 as 2.4 is currently unsupported by the Pi.
I'm certain this error is incredibly trivial however clear documentation about makefiles is few and far between if anyone can provide a solution I would be grateful.
See Question&Answers more detail:os