{Makefile Error} “commands commence before first target. Stop.”

后端 未结 2 539
花落未央
花落未央 2020-12-12 03:59

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 wit

2条回答
  •  攒了一身酷
    2020-12-12 04:53

    Smth like:

    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
    
    all: emobot_test
    
    emobot_test:
    tab$(CC) -o emobot_test.exe  main.cpp $(INCLUDE) $(LDFLAGS)
    

    is a literal keypress, donna how to insert it in the answer field.

    Explanation:
    $(CC) -o emobot_test... is a command which should be executed upon a target invocation.

    all is the default target which is executed when you simply run make without parameters.

    all depends on emobot_test target emobot_test doesn't depend on any target but always runs $(CC) -o emobot_test... for completion

提交回复
热议问题