我知道这个makefile非常简单,但我一直在阅读一些教程和示例,试图学习它并应用。 我所展示的内容是否有问题,或者是否应该与我展示的内容合作?
所有文件都位于运行make的CWD
。
以下是我的依赖项列表。
CT.c includes: studio.h, math.h, "CT.h", "TM.h"
CT.h includes: none
TM.c includes: "TM.h", stdio.h, math.h
TM.h includes: none
RP.c includes: "CT.h", math.h, fftw3.h, stdio.h, stdlib.h, "TM.h"
RP.h includes: fftw3.h
RF.c includes: "RF.h", stdlib.h, stdio.h
RF.h includes: none
DR.c includes: stdio.h, math.h, "DR.h"
main.c includes: "CT.h", "DR.h", "TM.h", "RP.h", "RF.h", stdio.h, math.h, time.h, stdlib.h, fftw3.h
这是我的makefile无效:
RFST: main.o CT.o TM.o RP.o RF.o DR.o
gcc -L/home/me/projects/RFST/libs -o RFST main.o CT.o TM.o RP.o RF.o DR.o -lfftw3 -lasc -lmfhdf -ldf -lz -ljeg -lm
main.o: main.c CT.h TM.h RP.h RF.h DR.h
gcc -I. -c main.c
CT.o: CT.c CT.h TM.h
gcc -I. -c CT.c
TM.o: TM.c TM.h
gcc -I. -c TM.c
RP.o: RP.c RP.h CT.h TM.h
gcc -I. -c RP.c
RF.o: RF.c RF.h
gcc -I. -c RF.c
DR.o: DR.c DR.h
gcc -I. -c DR.c
当试图运行makefile时,它会抱怨没有声明事物,但所有这些都是在包含的各种头文件中声明的。
示例:
'vA' undeclared(first use in this function)
'Variables' undeclared(first use in this funcion)
Variables vA[];
位于main.c.
Variables
是struct
中的DR.h
,它包含在main.c中。
答案 0 :(得分:0)
一些头球卫士被错过了。修复这两个标题警卫解决了这个问题。