我正在尝试运行以下makefile
CMDLINE_SRC=$(wildcard commandLine/*.c)
CMDLINE_OBJS = $(CMDLINE_SRC:.c=.o)
EXECUTABLES = $(CMDLINE_SRC:.c=)
LIB_SRC=$(wildcard c/*.c)
LIB_OBJ = $(LIB_SRC:.c=.o)
LIB_OUT = lib/libclinrisk.a
INCLUDES = -I include
# compiler
CC = gcc
CCFLAGS =
LDFLAGS =
# library paths
LIBS = -Llib -lclinrisk -lm
.SUFFIXES: .c
default: dep executables
executables: $(EXECUTABLES)
cp $(EXECUTABLES) executables
$(EXECUTABLES): $(LIB_OUT)
.c:
$(CC) $(INCLUDES) $(LDFLAGS) $< -o $@ $(LIBS)
.c.o:
$(CC) $(INCLUDES) $(CCFLAGS) -c $< -o $@
$(LIB_OUT): $(LIB_OBJ)
ar rcs $(LIB_OUT) $(LIB_OBJ)
depend: dep
dep:
makedepend -- $(CFLAGS) -- -I /usr/include/linux $(INCLUDES) $(LIB_SRC)
clean:
rm -f $(LIB_OBJ) $(LIB_OUT) Makefile.bak
rm -f $(CMDLINE_OBJ) $(CMDLINE_PROGS)
rm -f executables/*
# DO NOT DELETE并得到以下错误消息:
$ make
makedepend -- -- -M
make: makedepend: Command not found
make: *** [dep] Error 127我猜我可能不会像在输入make I get后按tab键那样安装makedepend:
$ make <TAB>
clean default dep depend executables makefile如果是这样的话,我没有安装have,我该如何安装它并指向
makedepend -- $(CFLAGS) -- -I /usr/include/linux $(INCLUDES) $(LIB_SRC)它需要指向什么?
谢谢!
更新: Davides answer已经解决了这个问题...
然而,我现在被困住了:
$ make
makedepend -- -- -I /usr/include/linux -I include
cp executables
cp: missing destination file operand after `executables'
Try `cp --help' for more information.
make: *** [executables] Error 1我怀疑这是一个实际makefile的问题...
发布于 2013-02-06 19:23:27
您错过了makedepend工具。
按照下面的说明编译源代码来安装它(这样你就独立于发行版了):
Download and install makedepend
https://stackoverflow.com/questions/14727506
复制相似问题