# vmlinux image - including updated kernel symbols
vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o $(kallsyms.o) FORCE
PHONY +=FORCE
FORCE:
# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable so we can use it in if_changed and friends.
.PHONY: $(PHONY)
ifdef CONFIG_HEADERS_CHECK
$(Q)$(MAKE)-f $(srctree)/Makefile headers_check
endif
ifdef CONFIG_SAMPLES
$(Q)$(MAKE) $(build)=samples
endif
ifdef CONFIG_BUILD_DOCSRC
$(Q)$(MAKE) $(build)=Documentation
endif
$(call vmlinux-modpost)
$(call if_changed_rule,vmlinux__)
$(Q)rm -f .old_version
helloworld:file1.o file2.o
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
PHONY +=FORCE
FORCE:
.PHONY: $(PHONY)
[beyes@SLinux Makefile]$ ll
total 32
-rw-rw-r--. 1 beyes beyes 129 Apr 16 19:00 file1.c
-rw-rw-r--. 1 beyes beyes 924 Apr 16 20:20 file1.o
-rw-rw-r--. 1 beyes beyes 108 Apr 16 19:01 file2.c
-rw-rw-r--. 1 beyes beyes 139 Apr 16 18:49 file2.h
-rw-rw-r--. 1 beyes beyes 880 Apr 16 20:20 file2.o
-rwxrwxr-x. 1 beyes beyes 4786 Apr 16 20:20 helloworld
-rw-rw-r--. 1 beyes beyes 246 Apr 16 20:20 Makefile
[beyes@SLinux Makefile]$ ll
total 32
-rw-rw-r--. 1 beyes beyes 129 Apr 16 19:00 file1.c
-rw-rw-r--. 1 beyes beyes 924 Apr 16 20:20 file1.o
-rw-rw-r--. 1 beyes beyes 108 Apr 16 19:01 file2.c
-rw-rw-r--. 1 beyes beyes 139 Apr 16 18:49 file2.h
-rw-rw-r--. 1 beyes beyes 880 Apr 16 20:20 file2.o
-rwxrwxr-x. 1 beyes beyes 4786 Apr 16 20:26 helloworld
-rw-rw-r--. 1 beyes beyes 246 Apr 16 20:20 Makefile
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |