helloworld:file1.o file2.o FORCE
gcc file1.o file2.o -o helloworld
file1.o:file1.c file2.h
gcc -c file1.c -o file1.o
file2.o:file2.c file2.h
gcc -c file2.c -o file2.o
helloworld:file1.o file2.o FORCE
gcc file1.o file2.o -o helloworld
file1.o:file1.c file2.h
gcc -c file1.c -o file1.o
file2.o:file2.c file2.h;gcc -c file2.c -o file2.o
clean:
rm -rf *.o helloworld; echo "This is ok"
$ make clean
rm -rf *.o helloworld; echo "This is ok"
This is ok
# We need some generic definitions (do not try to remake the file).
$(srctree)/scripts/Kbuild.include: ;
include $(srctree)/scripts/Kbuild.include
srctree := $(CURDIR)
include $(srctree)/scripts/Kbuild.include
all:
@echo $(VERSION)
[beyes@SLinux temp]$ make
1
srctree := $(CURDIR)
$(srctree)/scripts/Kbuild.iniclude:
include $(srctree)/scripts/Kbuild.include
all:
@echo $(VERSION)
[beyes@SLinux temp]$ make
make: Nothing to be done for `/home/beyes/Makefile/temp/scripts/Kbuild.iniclude'.
srctree := $(CURDIR)
$(srctree)/scripts/Kbuild.iniclude: ;
include $(srctree)/scripts/Kbuild.include
all:
@echo $(VERSION)
[beyes@SLinux temp]$ make
make: `/home/beyes/Makefile/temp/scripts/Kbuild.iniclude' is up to date.
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |