C ++ Make file issue"没有规则来制作目标..."

时间:2017-01-18 16:48:43

标签: c++ makefile

我刚开始使用makefile。 我收到了我的C ++项目的makefile错误。

制作:没有规则要制作目标' bin / smartCart_app',所有人都需要。  下面是目录结构和与之关联的文件。

CC=gcc
CPP=g++
CCFLAGS=-g -Wall -std=gnu+0x -o0 
CC_LDFLAGS = -g -Wl 

BUILD=./build
BIN = ./bin

SC_SRC_ROOT = ../src
SC_SRC_SUBDIRS = config util 
SC_SRC_RELDIRS = $(addprefix $(strip $(SC_SRC_ROOT)), $(strip $(SC_SRC_SUBDIRS)))
SC_SRCS_ = $(shell /usr/bin/find $(SC_SRC_ROOT)/config $(SC_SRC_ROOT)/util -name "*.cpp")
SC_SRCS = $(SC_SRCS_) baseStation.cpp
SC_NEW_SRCS = $(notdir $(SC_SRCS))

SPACE :=
SPACE += 
INCLUDE = $(addprefix -I, $(SRC_RELDIRS))
VPATH = $(subst $(SPACE),:,$(SRC_RELDIRS)) $(subst $(SPACE),:,$(SC_SRC_RELDIRS))
SC_INCLUDE = $(addprefix -I, $(SC_SRC_RELDIRS))

SC_OBJS = $(SC_NEW_SRCS:%.cpp=$(BUILD)/%.o)
SC_DEPS = $(SC_OBJS:%.o=%.d)

# Ensure paths exist.
$(shell [ -d "$(BIN)"   ] || mkdir -p $(BIN))
$(shell [ -d "$(BUILD)" ] || mkdir -p $(BUILD))

# Explicit rules.
.PHONY: all clean $(PHONY)
all: $(BIN)/smartCart_app

clean: 
        @echo "Cleaning..."
        -@rm -f $(BIN)/smartCart_app $(SC_OBJS) 

$(SC_OBJS): $(BUILD)/%.o: %.cpp
     @echo "Compiling $(notdir $<)"
    @$(CPP) $(CCFLAGS) $(INCLUDE) $(SC_INCLUDE) -MD -c -o $@ $<

$(MACRO_DEPS):
    -@rm -f $(patsubst %_ON.d,%_OFF.d,$@) $(patsubst %_OFF.d,%_ON.d,$@) $@
    @touch $@

#$(ALL_OBJS): %.o: %.d

$(DEPS): $(BUILD)/%.d: %.cpp
    @$(CC) $< -MM -MF $@ $(INCLUDE)

这是我的Make文件

{
  "document_tone": {
    "tone_categories": [
      {
        "tones": [
          {
            "score": 0.25482,
            "tone_id": "anger",
            "tone_name": "Anger"
          },
          {
            "score": 0.345816,
            "tone_id": "disgust",
            "tone_name": "Disgust"
          },
          {
            "score": 0.121116,
            "tone_id": "fear",
            "tone_name": "Fear"
          },
          {
            "score": 0.078903,
            "tone_id": "joy",
            "tone_name": "Joy"
          },
          {
            "score": 0.199345,
            "tone_id": "sadness",
            "tone_name": "Sadness"
          }
        ],
        "category_id": "emotion_tone",
        "category_name": "Emotion Tone"
      }
    ]
  }
}

0 个答案:

没有答案