【发布时间】:2014-09-10 16:54:35
【问题描述】:
是否可以使用 makefile 在另一个目录中构建带有头文件的程序? 例如,我有一些文件(名为 client.cc),其中包含:
...
#include "talk/examples/peerconnection/client/conductor.h"
#include "talk/examples/peerconnection/client/main_wnd.h"
...
这包括在另一个目录中。如何将它添加到我的 makefile 中? 此时,我有 Makefile,其中包含:
CXX=arm-none-linux-gnueabi-g++
INC=-I/home/footniko/my/webrtcnative/trunk/
TARGET=$(shell basename `pwd`)
SOURCES=$(wildcard *.cc)
OBJECTS=$(SOURCES:%.cc=%.o)
all: $(TARGET)
$(OBJECTS): $(SOURCES)
$(TARGET): $(OBJECTS)
$(CXX) -o $(TARGET) $(LDFLAGS) $(INC) $(OBJECTS) $(LOADLIBES) $(LDLIBS)
clean:
$(RM) $(OBJECTS) $(TARGET)
.PHONY: all clean
/home/footniko/my/webrtcnative/trunk/ - 是我的标题的绝对路径。但是当我尝试制作时,出现此错误:
client.cc:28:59: fatal error: talk/examples/peerconnection/client/conductor.h: No such file or directory
【问题讨论】: