count.h
1 #ifndef COUNT_H
2 #define COUNT_H
3 int coun(int x);
4 #endif
count.c
1 #include“stdio.h”
2 int coun(int x)
3 {return (2*x);
}
num.c
1 #include"stdio.h"
2 #include"count.h"
3 int main()
4 {printf("%d\n",coun(1));
5 }
}
Makefile:
num : num.c count.h
make之後出錯
Makefile:
num: num.c count.o
%.o: %.c
gcc -c $<