$ ls
hello.c hi.c main.c Makefile
分类: Delphi
2016-12-14 10:04:52
$ ls
hello.c hi.c main.c Makefile
main: main.o hello.o hi.o
gcc -o main main.o hello.o hi.o
main.o: main.c
cc -c main.c
hello.o: hello.c
cc -c hello.c
hi.o: hi.c
cc -c hi.c
clean:
rm *.o
rm main
main: main.o hello.o hi.o
gcc -o $@ $^
main.o: main.c
cc -c $<
hello.o: hello.c
cc -c $<
hi.o: hi.c
cc -c $<
clean:
rm *.o
rm main
beyes@debian:~/makefile_test/semicolon/real$ make
cc -c main.c
cc -c hello.c
cc -c hi.c
gcc -o main main.o hello.o hi.o
beyes@debian:~/makefile_test/semicolon/real$ ls
hello.c hello.o hi.c hi.o main main.c main.o Makefile