当前位置: 技术问答>linux和unix
how to write makefile 4files
来源: 互联网 发布时间:2015-04-19
本文导语: i have 4 files: mainwork.c mainwork.h serial.c serial.h. in the file mainwork.h i have #include"serial.h", how can i write makefile? thanks! my computer is not support englis i cannt use chinese i am sorry for all. | ...
i have 4 files: mainwork.c mainwork.h serial.c serial.h.
in the file mainwork.h i have #include"serial.h",
how can i write makefile?
thanks!
my computer is not support englis i cannt use chinese i am sorry for all.
in the file mainwork.h i have #include"serial.h",
how can i write makefile?
thanks!
my computer is not support englis i cannt use chinese i am sorry for all.
|
main:mainwork.o serial.o
gcc -o main mainwork.o serial.o
serial.o: serial.c serial.h
gcc -c serial.o serial.c
mainwork.o: mainwork.c mainwork.h serial.h
gcc -c mainwork.o mainwork.c
gcc -o main mainwork.o serial.o
serial.o: serial.c serial.h
gcc -c serial.o serial.c
mainwork.o: mainwork.c mainwork.h serial.h
gcc -c mainwork.o mainwork.c