有webserver文件夹,内有如下文件(已经将.C文件通过makefile命令编译到.o文件了)
自己编写的makefile文件如下:
OBJS = get_time.o http_session.o webserver.o
CC = gcc
CFLAGS = -Wall -O -g
webserver : $(OBJS)
$(CC) $^ -o $@
get_time.o : get_time.c get_time.h
$(CC) $(CFLAGS) -c $< -o $@
http_session.o : http_session.c http_session.h get_time.h http_protocol.h
$(CC) $(CFLAGS) -c $< -o $@
webserver.o : webserver.c get_time.h http_session.h http_protocol.h
$(CC) $(CFLAGS) -c $< -o $@
下面3个.c文件的代码就不放了,只放目标体的目标文件图片:
get_time.c文件有头文件如下:
http_session.c头文件如下:
webserver.c头文件如下:
运行结果就是这样的没反应
希望能帮忙看下自己编写的makefile哪里有错误并帮忙改正一下即可,谢谢
源代码没有改动,make 不会重新编译已编译的源文件,而且你这也没有报错啊
makefile编辑完,可以直接执行webserver文件?