我的Makefile如下:
TOPDIR = .
CROSS_COMPILE = mips-linux-gnu-
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
STRIP = $(CROSS_COMPILE)strip
AR = $(CROSS_COMPILE)ar
CFLAGS = -g -O2 -Wall
ifeq ($(FR), ON)
CFLAGS += -DFACE_RECOG
endif
INCLUDE = -I./t02_sdk/include
INCLUDE += -I./rtsp_server/include
INCLUDE += -I./t30_sdk/include
LIBS = -L./t02_sdk/lib/T30/glibc -lakubelli -lpthread
LIBS += -L./rtsp_server -lrtsp_server
LIBS += -L./rtsp_server/live555/lib/glibc -lliveMedia -lBasicUsageEnvironment -lUsageEnvironment -lgroupsock
LIBS += -L./t30_sdk/lib/glibc -limp -lalog -lsysutils
OBJS = akubelli_test.o imp.o
TARGET = akubelli_test
all: $(TARGET)
$(TARGET): librtsp_server $(OBJS)
$(CXX) $(OBJS) -o $(TARGET) $(INCLUDE) $(LIBS) -lpthread -lm -ldl -lrt -lstdc++
$(STRIP) $@
librtsp_server:
make -C $(TOPDIR)/rtsp_server
%o:%c
$(CC) $(INCLUDE) $(CFLAGS) $(LIBS) -c $< -o $@
.PHONY :clean
clean:
rm -rf $(TARGET) $(OBJS)
make -C $(TOPDIR)/rtsp_server clean
Make结果:
疑问点:
通用规则
%o:%c
$(CC) $(INCLUDE) $(CFLAGS) $(LIBS) -c $< -o $@
按理说不是应该会打印出$(INCLUDE) $(CFLAGS)的详细信息吗?
但实际却没有打印,还报找不到头文件(头文件在:./rtsp_server/include/RTSPServer.hh),这是为什么
补充:
加了info打印后的结果:
任何信息都没打印,包括我随便 echo 一个字符串都没输出的