当前位置: 技术问答>linux和unix
make问题
来源: 互联网 发布时间:2015-01-19
本文导语: 有个makefile文件,然后 make ,错误提示如下: don't know how to make rxldemo (bu42).? makefile文件内容如下: # ########用户设定#################### # ###可执行文件名 EXECUTABLE = rxldemo # ###需要的头文件目录 INCLUDES = -I. -I/usr/...
有个makefile文件,然后 make ,错误提示如下:
don't know how to make rxldemo (bu42).?
makefile文件内容如下:
#
########用户设定####################
#
###可执行文件名
EXECUTABLE = rxldemo
#
###需要的头文件目录
INCLUDES = -I. -I/usr/include/cxx
#
###需要的动态或静态库文件
LIBS = -L/usr/lib -L/usr/sys/lib
###C语言编译程序
CC = cxx
#
###C++编译程序
CXX = cxx
#
###C编译参数
CFLAGS = -g -Wall -O3 $(INCLUDES)
CXXFLAGS = $(CFLAGS)
#
###C预编译选项
#CPPFLAGS += -MD
#
###源文件
SOURCES = $(wildcard *.c) $(wildcard *.cc)
#
RM = rm -f -r
#
###目标文件
OBJS = $(patsubst %.c,%.o,$(patsubst %.cc,%.c,$(SOURCE)))
#
###依靠文件
DEPS = $(patsubst %.o %.d $(OBJS))
MISSING_DEPS = $(filter-out $(wildcard $(DEPS)),$(DEPS))
MISSING_DEPS_SOURCE = $(wildcard $(patsubst %.d, %.c, $(MISSING_DEPS)) $(patsubst %.d, %.cc,$(MISSING_DEPS)))
#
#.PHONY: everything deps objs clean everyclean rebuild
#
everything : $(EXECUTABLE)
#
deps : $(DEPS)
#
objs : $(OBJS)
#
clean:
@$(RM) *.o
@$(RM) *.d
#
everyclean : clean
@$(RM) $(EXECUTABLE)
#
rebuild : everyclean everything
#
ifneq ($(MISSING_DEPS), )
$(MISSING_DEPS):
@$(RM) $(patsubst %d, %.o $@)
endif
#
-include $(DEPS)
#
$(EXECUTABLE) : $(OBJS)
$(CC) $(CFLAGS) $(CPPFLAGS) -o $(EXECUTABLE) $(OBJS) $(LIBS)
don't know how to make rxldemo (bu42).?
makefile文件内容如下:
#
########用户设定####################
#
###可执行文件名
EXECUTABLE = rxldemo
#
###需要的头文件目录
INCLUDES = -I. -I/usr/include/cxx
#
###需要的动态或静态库文件
LIBS = -L/usr/lib -L/usr/sys/lib
###C语言编译程序
CC = cxx
#
###C++编译程序
CXX = cxx
#
###C编译参数
CFLAGS = -g -Wall -O3 $(INCLUDES)
CXXFLAGS = $(CFLAGS)
#
###C预编译选项
#CPPFLAGS += -MD
#
###源文件
SOURCES = $(wildcard *.c) $(wildcard *.cc)
#
RM = rm -f -r
#
###目标文件
OBJS = $(patsubst %.c,%.o,$(patsubst %.cc,%.c,$(SOURCE)))
#
###依靠文件
DEPS = $(patsubst %.o %.d $(OBJS))
MISSING_DEPS = $(filter-out $(wildcard $(DEPS)),$(DEPS))
MISSING_DEPS_SOURCE = $(wildcard $(patsubst %.d, %.c, $(MISSING_DEPS)) $(patsubst %.d, %.cc,$(MISSING_DEPS)))
#
#.PHONY: everything deps objs clean everyclean rebuild
#
everything : $(EXECUTABLE)
#
deps : $(DEPS)
#
objs : $(OBJS)
#
clean:
@$(RM) *.o
@$(RM) *.d
#
everyclean : clean
@$(RM) $(EXECUTABLE)
#
rebuild : everyclean everything
#
ifneq ($(MISSING_DEPS), )
$(MISSING_DEPS):
@$(RM) $(patsubst %d, %.o $@)
endif
#
-include $(DEPS)
#
$(EXECUTABLE) : $(OBJS)
$(CC) $(CFLAGS) $(CPPFLAGS) -o $(EXECUTABLE) $(OBJS) $(LIBS)
|
Sco unix下make的功能没这么强,patsubst 这种调用是不支持的
|
$(OBJS)的依赖关系在哪里??
|
Sco unix下make的功能也很强,只要领会其中的含义
|
把makefile写的这么复杂,有这必要吗?先问问你是在什么操作系统下的