2 @ .oÎļþµÄrulesÌí¼Ó.obj/µÄpfx¡£
21 $(Program): .build $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP)
30 src/version.h: $(SOURCES) config.h Makefile src/patchlevel.h
31 $(SHELL) $(SUPPORT_SRC)mkversion.sh -b -S ${topdir} -s $(RELSTATUS) -d $(Version) -o src/newversion.h \
32 && mv src/newversion.h src/version.h
34 bushversion$(EXEEXT): buildversion.o $(SUPPORT_SRC)bushversion.c
35 echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
36 $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)bushversion.c buildversion.o ${LIBS_FOR_BUILD}
38 buildversion.o: $(srcdir)/src/version.c
39 $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -DBUILDTOOL -c -o $@ $(srcdir)/src/version.c
41 buildversion.o: src/bushintl.h $(BUSHINCDIR)/gettext.h
42 buildversion.o: src/version.h src/patchlevel.h src/conftypes.h
60 .obj/impl/%.o : src/impl/%.c
61 .obj/input/%.o : src/input/%.c
62 .obj/lxrgmr/%.o : src/lxrgmr/%.c
63 .obj/runner/%.o : src/runner/%.c
64 .obj/var/%.o : src/var/%.c
69 $(CC) $(CCFLAGS) -c $< -o $@
70 @echo $(CC) $(CCFLAGS) -c $<
78 .obj/lxrgmr/y.tab.o: src/lxrgmr/y.tab.h src/lxrgmr/y.tab.c ${GRAM_H} src/lxrgmr/command.h ${BUSHINCDIR}/stdc.h src/input/input.h
79 ${GRAM_H}: src/lxrgmr/y.tab.h
80 @-if test -f src/lxrgmr/y.tab.h ; then \
81 cmp -s $@ src/lxrgmr/y.tab.h 2>/dev/null || cp -p src/lxrgmr/y.tab.h $@; \
84 src/lxrgmr/y.tab.c: src/lxrgmr/parse.y
85 # -if test -f src/lxrgmr/y.tab.h; then mv -f src/lxrgmr/y.tab.h old-src/lxrgmr/y.tab.h; fi
86 $(YACC) -d $(srcdir)/src/lxrgmr/parse.y -o $@
88 # -if cmp -s old-src/lxrgmr/y.tab.h src/lxrgmr/y.tab.h; then mv old-src/lxrgmr/y.tab.h src/lxrgmr/y.tab.h; else cp -p src/lxrgmr/y.tab.h ${GRAM_H}; fi
90 src/lxrgmr/y.tab.h: src/lxrgmr/y.tab.c
94 ## $(OBJECTS) ==> siglist_o mksyntax.c
95 --------------------------------------
97 signames.o: $(SUPPORT_SRC)signames.c
99 $(CC) $(CCFLAGS) -c $(SUPPORT_SRC)signames.c
101 buildsignames.o: $(SUPPORT_SRC)signames.c
103 $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -DBUILDTOOL -o $@ -c $(SUPPORT_SRC)signames.c
105 mksignames.o: $(SUPPORT_SRC)mksignames.c
107 $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -DBUILDTOOL -c $(SUPPORT_SRC)mksignames.c
109 mksignames$(EXEEXT): mksignames.o buildsignames.o
111 $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ mksignames.o buildsignames.o ${LIBS_FOR_BUILD}
113 mksyntax$(EXEEXT): ${srcdir}/mksyntax.c config.h src/syntax.h ${BUSHINCDIR}/chartypes.h src/bushansi.h
115 ${CC_FOR_BUILD} ${CCFLAGS_FOR_BUILD} ${LDFLAGS_FOR_BUILD} -o $@ ${srcdir}/mksyntax.c ${LIBS_FOR_BUILD}
117 # make a list of signals for the local system -- this is done when we're
118 # *not* cross-compiling
119 src/lsignames.h: mksignames$(EXEEXT)
121 ./mksignames$(EXEEXT) $@
123 # copy the correct signames header file to src/signames.h
124 src/signames.h: $(SIGNAMES_H)
125 if cmp -s $(SIGNAMES_H) $@ ; then :; else $(RM) $@ ; $(CP) $(SIGNAMES_H) $@ ; fi
127 syntax.c: mksyntax${EXEEXT} $(srcdir)/src/syntax.h
129 ./mksyntax$(EXEEXT) -o $@
137 # $(BUILTINS_DEP) <== $(BUILTINS_LIBRARY)
138 -----------------------------------------
140 $(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BUSHINCDIR}/memalloc.h $(DEFDIR)/builtext.h src/version.h
141 @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} targets ) || exit 1
143 in builtins/Makefile.in:
145 all: $(MKBUILTINS) libbuiltins.a $(HELPFILES_TARGET)
151 MKBUILTINS = mkbuiltins$(EXEEXT)
155 mkbuiltins.o: ../config.h
156 mkbuiltins.o: mkbuiltins.c
158 $(CC_FOR_BUILD) -c $(CCFLAGS_FOR_BUILD) $<
160 mkbuiltins$(EXEEXT): mkbuiltins.o
161 $(CC_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $(MKBUILTINS) mkbuiltins.o $(LIBS_FOR_BUILD)
167 libbuiltins.a: $(MKBUILTINS) $(OFILES) .obj/builtins/builtins.o
174 # Subdirs will often times want src/version.h, so they'll change back up to
175 # the top level and try to create it. This causes parallel build issues
176 # so just force top level sanity before we descend.
178 #$(LIBDEP): src/version.h
180 $(READLINE_LIBRARY): config.h $(READLINE_SOURCE)
181 @echo making $@ in ${RL_LIBDIR}
182 @( { test "${RL_LIBDIR}" = "${libdir}" && exit 0; } || \
183 cd ${RL_LIBDIR} && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} libreadline.a) || exit 1
185 $(HISTORY_LIBRARY): config.h $(HISTORY_SOURCE) $(READLINE_DEP)
186 @echo making $@ in ${HIST_LIBDIR}
187 @( { test "${HIST_LIBDIR}" = "${libdir}" && exit 0; } || \
188 cd ${HIST_LIBDIR} && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} libhistory.a) || exit 1
190 $(GLOB_LIBRARY): config.h $(GLOB_SOURCE)
191 @echo making $@ in ${GLOB_LIBDIR}
192 @(cd ${GLOB_LIBDIR} && \
193 $(MAKE) $(MFLAGS) DEBUG=${DEBUG} libglob.a) || exit 1
195 $(TILDE_LIBRARY): config.h $(TILDE_SOURCE)
196 @echo making $@ in ${TILDE_LIBDIR}
197 @(cd ${TILDE_LIBDIR} && \
198 $(MAKE) $(MFLAGS) libtilde.a) || exit 1
200 $(TERMCAP_LIBRARY): config.h ${TERMCAP_SOURCE}
201 @echo making $@ in ${TERM_LIBDIR}
202 @(cd ${TERM_LIBDIR} && \
203 $(MAKE) $(MFLAGS) libtermcap.a) || exit 1
205 $(SHLIB_LIBRARY): config.h ${SHLIB_SOURCE}
206 @echo making $@ in ${SH_LIBDIR}
207 @(cd ${SH_LIBDIR} && \
208 $(MAKE) $(MFLAGS) DEBUG=${DEBUG} ${SHLIB_LIBNAME}) || exit 1
210 ${INTL_LIBRARY}: config.h ${INTL_LIBDIR}/Makefile
211 @echo making $@ in ${INTL_LIBDIR}
212 @(cd ${INTL_LIBDIR} && \
213 $(MAKE) $(MFLAGS) XCFLAGS="${LOCAL_CFLAGS}" all) || exit 1
215 ${LIBINTL_H}: ${INTL_DEP}
245 # these require special rules to circumvent make builtin rules
246 ${DEFDIR}/common.o: $(BUILTIN_SRCDIR)/common.c
247 @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} common.o) || exit 1
249 ${DEFDIR}/bushgetopt.o: $(BUILTIN_SRCDIR)/bushgetopt.c
250 @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} bushgetopt.o) || exit 1
252 ${DEFDIR}/builtext.h: $(BUILTIN_DEFS)
253 @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) builtext.h ) || exit 1
255 ${DEFDIR}/pipesize.h:
256 @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) pipesize.h ) || exit 1
258 $(SDIR)/man2html$(EXEEXT): ${SUPPORT_SRC}/man2html.c
259 @(cd $(SDIR) && $(MAKE) $(MFLAGS) all ) || exit 1
273 Makefile makefile: config.status $(srcdir)/Makefile.in
274 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
276 Makefiles makefiles: config.status $(srcdir)/Makefile.in
277 @for mf in $(CREATED_MAKEFILES); do \
278 CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status || exit 1; \
283 stamp-h: config.status $(srcdir)/config.h.in $(srcdir)/config-top.h $(srcdir)/config-bot.h
284 CONFIG_FILES= CONFIG_HEADERS=config.h $(SHELL) ./config.status
286 config.status: $(srcdir)/configure
287 $(SHELL) ./config.status --recheck
289 src/pathnames.h: Makefile $(srcdir)/src/pathnames.h.in
290 @sed -e 's|@DEBUGGER_START_FILE\@|${DEBUGGER_START_FILE}|g' $(srcdir)/src/pathnames.h.in > pathnames.tmp
291 @if test -f $@; then \
292 cmp -s pathnames.tmp $@ || mv pathnames.tmp $@; \
294 mv pathnames.tmp $@; \
298 # comment out for distribution
299 $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/aclocal.m4 $(srcdir)/config.h.in
300 cd $(srcdir) && autoconf