我正在尝试编写一个makefile,但我一直遇到这个错误:
[jabdo@q0141 lab4]$ make
gcc -c show.c show.h
show.c:1:20: fatal error: "show.h": No such file or directory
compilation terminated.
show.h:7:18: fatal error: show.c: No such file or directory
compilation terminated.
make: *** [show.o] Error 1
我尝试查看我的目录,但我可以看到该目录中的两个文件:
[jabdo@q0141 lab4]$ ls
ex show.c show.h.gch utmplib.o who1.c who2.c who3.c
Makefile show.h utmplib.c who who1.o who2.o who3.o
我的Makefile看起来像这样
who3:who3.o utmplib.o
gcc -o who who3.o utmplib.o
who3.o:who3.c show.o
gcc -c who3.c show.o
show.o:show.c show.h
gcc -c show.c show.h
utmplib.o:utmplib.c
gcc -c utmplib.c
clean:
rm -f *.o
我做错了什么?