Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 使makefile可执行_C_Makefile - Fatal编程技术网

C 使makefile可执行

C 使makefile可执行,c,makefile,C,Makefile,所以,我已经构建了我的makefile,它运行得很好,但是我仍然需要键入./escalunador(我的程序名)来运行它,我如何将它包含在我的makefile中 CC = gcc CFLAGS = -g -Wall -std=c99 all: escalunador escalunador: escalunador.o usables.o queue.o linkedlist.o $(CC) $(CFLAGS) -o escalunador escalunador.o usa

所以,我已经构建了我的makefile,它运行得很好,但是我仍然需要键入./escalunador(我的程序名)来运行它,我如何将它包含在我的makefile中

CC = gcc  
CFLAGS = -g -Wall -std=c99

all: escalunador

escalunador: escalunador.o usables.o queue.o linkedlist.o  
    $(CC) $(CFLAGS) -o escalunador escalunador.o usables.o queue.o linkedlist.o

escalunador.o: escalunador.c usables.h queue.h linkedlist.h  
    $(CC) $(CFLAGS) -c escalunador.c

usables.o: usables.c queue.h linkedlist.h  
    $(CC) $(CFLAGS) -c usables.c

queue.o: queue.c linkedlist.h  
    $(CC) $(CFLAGS) -c queue.c

linkedlist.o: linkedlist.c linkedlist.h  
    $(CC) $(CFLAGS) -c linkedlist.c

clean:   
    $(RM) escalunador *.p *~
非常简单:

run: escalunador
  ./escalunador

.PHONY: run

也许你想把
all:./escalunador
修改成
all:run

我现在都哑口无言了啊哈,谢谢你的回答,成功了!也谢谢你的编辑,这是我在这里的第一篇帖子:)