2013-02-06 37 views
0

嗨以前的问题,安装makedepend(现在解决)没有后,我现在想经营我的生成文件时,有下列错误:误差生成文件(可执行文件)

$ 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:

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 [email protected] $(LIBS) 

.c.o: 
    $(CC) $(INCLUDES) $(CCFLAGS) -c $< -o [email protected] 

$(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/* 

这里有什么问题?我是makefile的新手!将在此期间尝试解决这个问题。

的问题看起来像它做:

cp $(EXECUTABLES) executables 

但是,我不知道正确的途径可执行文件...

感谢。在你的Makefile代码

回答

4

没有设置EXECUTABLES变量,因此它替换为空字符串,它只是一个单一的参数调用cp,由此产生的误差。

相关问题