那位大虾帮我看一下这个程序(nachos 原程序makefile)

Gump09 2003-09-14 08:51:41
36 ifndef MAKEFILE_COMMON
37 define MAKEFILE_COMMON
38 yes
39 endef

44 include ../Makefile.dep

49 vpath %.cc ../network:../filesys:../vm:../userprog:../threads:../machine
50 vpath %.h ../network:../filesys:../vm:../userprog:../threads:../machine
51 vpath %.s ../network:../filesys:../vm:../userprog:../threads:../machine

54 CFLAGS = -g -Wall -Wshadow -fwritable-strings $(INCPATH) $(DEFINES) $(HOST) -DCHANGED
55
56 # The variables {C,S,CC}FILES should be initialized by the Makefile
57 # that invokes this makefile. The ofiles variable is used in building
58 # the different versions of nachos corresponding to each assignment; it
59 # is not used by the Makefiles for the bin or test directories.
60
61 s_ofiles = $(SFILES:%.s=$(obj_dir)/%.o)
62 c_ofiles = $(CFILES:%.c=$(obj_dir)/%.o)
63 cc_ofiles = $(CCFILES:%.cc=$(obj_dir)/%.o)
64
65 ofiles = $(cc_ofiles) $(c_ofiles) $(s_ofiles)
66
67 program = $(bin_dir)/nachos
68

88 $(bin_dir)/% :
89 @echo ">>> Linking" $@ "<<<"
90 $(LD) $^ $(LDFLAGS) -o $@
91 ln -sf $@ $(notdir $@)
92
93 # Building object files (.o) from C++ source (.cc) files.
94 # See the comment above for executables regarding multiple rules.
95 $(obj_dir)/%.o: %.cc
96 @echo ">>> Compiling" $< "<<<"
97 $(CC) $(CFLAGS) -c -o $@ $<
98
99 # Building object files (.o) from C source (.c) files.
100 # See the comment above for executables regarding multiple rules.
101 $(obj_dir)/%.o: %.c
102 @echo ">>> Compiling" $< "<<<"
103 $(CC) $(CFLAGS) -c -o $@ $<
104

111 $(obj_dir)/%.o: %.s
112 @echo ">>> Assembling" $< "<<<"
113 $(CPP) $(CPPFLAGS) $< > $(obj_dir)/tmp.s
114 $(AS) -o $@ $(obj_dir)/tmp.s
115 rm $(obj_dir)/tmp.s
116
117
118 # Automatic dependency generation: see gmake info documentation for
119 # full details. This stuff supercedes the old make depend stuff.
120
121 # We want to build a .d file for every source file (.s, .c, .cc), which
122 # contains make rules generated automatically by gcc/cpp. The .d files
123 # are to be included later in this Makefile.
124
125 s_dfiles = $(SFILES:%.s=$(depends_dir)/%.d)
126 c_dfiles = $(CFILES:%.c=$(depends_dir)/%.d)
127 cc_dfiles = $(CCFILES:%.cc=$(depends_dir)/%.d)
128
129 dfiles = $(cc_dfiles) $(c_dfiles) $(s_dfiles)
130
131
132 # The following set of rules define how to build dependency files
133 # automatically from various source files. These rules have been
134 # taken from the gmake documentation with minor modifications.
135
136 $(depends_dir)/%.d: %.cc
137 @echo ">>> Building dependency file for " $< "<<<"
138 @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
139 | sed '\''s@$*.o[ ]*:@$(depends_dir)/$(notdir $@) $(obj_dir)/&@g'\'' > $@'
140
141 $(depends_dir)/%.d: %.c
142 @echo ">>> Building dependency file for" $< "<<<"
143 @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
144 | sed '\''s@$*.o[ ]*:@$(depends_dir)/$(notdir $@) $(obj_dir)/&@g'\'' > $@'
145
146 $(depends_dir)/%.d: %.s
147 @echo ">>> Building dependency file for" $< "<<<"
148 @$(SHELL) -ec '$(CPP) -MM $(CPPFLAGS) $< \
149 | sed '\''s@$*.o[ ]*:@$(depends_dir)/$(notdir $@) $(obj_dir)/&@g'\'' > $@'

162 include $(dfiles)

174
175 clean:
176 rm -f `find $(arch_dir) -type f -print | egrep -v '(CVS|cvsignore)'`
177 rm -f nachos coff2noff coff2flat
178 rm -f *.noff *.flat
179
180 tmpclean:
181 rm -f tmp*
182
183 endif # MAKEFILE_COMMON
184
就是看不明白 $ @ % 这些符号,请讲一下好吗
...全文
70 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
isunning 2003-09-14
  • 打赏
  • 举报
回复
到www.fanqiang.com等LINUX网站上看看就知道了。

23,110

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧