3 ###################################################################
12 # ${LIBINTL_H}: ${INTL_DEP}
17 # ${DEFDIR}/common.o: $(BUILTIN_SRCDIR)/common.c
18 @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} common.o) || exit 1
22 builtins_bushgetopt_o ()
24 # ${DEFDIR}/bushgetopt.o: $(BUILTIN_SRCDIR)/bushgetopt.c
25 @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} bushgetopt.o) || exit 1
28 ###################################################################
33 (cd ${DOCDIR} ; ${MAKE} ${MFLAGS} CFLAGS='${CCFLAGS}' $1 )
39 (cd ${DOCDIR} ; ${MAKE} ${MFLAGS} )
42 ###################################################################
47 ${SHELL} ${SUPPORT_SRC}mkinstalldirs ${DESTDIR}${bindir}
48 ${SHELL} ${SUPPORT_SRC}mkinstalldirs ${DESTDIR}${man1dir}
49 ${SHELL} ${SUPPORT_SRC}mkinstalldirs ${DESTDIR}${infodir}
50 ${SHELL} ${SUPPORT_SRC}mkinstalldirs ${DESTDIR}${docdir}
51 ( cd ${PO_DIR} ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} installdirs )
54 ${MAKE} ${MFLAGS} INSTALL_PROGRAM='${INSTALL_PROGRAM} -s' \
55 prefix=${prefix} exec_prefix=${exec_prefix} \
56 DESTDIR=${DESTDIR} install
58 # install: .made installdirs
59 ${INSTALL_PROGRAM} ${INSTALLMODE} ${Program} ${DESTDIR}${bindir}/${Program}
60 ${INSTALL_SCRIPT} ${INSTALLMODE2} bushbug ${DESTDIR}${bindir}/bushbug
61 ${INSTALL_DATA} ${OTHER_DOCS} ${DESTDIR}${docdir}
62 ( cd ${DOCDIR} ; ${MAKE} ${MFLAGS} \
63 man1dir=${man1dir} man1ext=${man1ext} \
64 man3dir=${man3dir} man3ext=${man3ext} \
65 infodir=${infodir} htmldir=${htmldir} DESTDIR=${DESTDIR} install )
66 ( cd ${DEFDIR} ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install )
67 ( cd ${PO_DIR} ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install )
68 ( cd ${LOADABLES_DIR} && ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install )
74 ${RM} ${DESTDIR}${bindir}/${Program} ${DESTDIR}${bindir}/bushbug
75 ( cd ${DESTDIR}${docdir} && ${RM} ${OTHER_INSTALLED_DOCS} )
76 ( cd ${DOCDIR} ; ${MAKE} ${MFLAGS} \
77 man1dir=${man1dir} man1ext=${man1ext} \
78 man3dir=${man3dir} man3ext=${man3ext} \
79 infodir=${infodir} htmldir=${htmldir} DESTDIR=${DESTDIR} uninstall )
80 ( cd ${PO_DIR} ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
81 ( cd ${LOADABLES_DIR} && ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
86 # install-headers-dirs:
87 ${SHELL} ${SUPPORT_SRC}mkinstalldirs ${DESTDIR}${headersdir}
88 ${SHELL} ${SUPPORT_SRC}mkinstalldirs ${DESTDIR}${headersdir}/builtins
89 ${SHELL} ${SUPPORT_SRC}mkinstalldirs ${DESTDIR}${headersdir}/include
90 ${SHELL} ${SUPPORT_SRC}mkinstalldirs ${DESTDIR}${pkgconfigdir}
92 # install-headers: install-headers-dirs
93 for hf in ${INSTALLED_HEADERS} ; do
94 ${INSTALL_DATA} ${srcdir}/"$$hf" ${DESTDIR}${headersdir}/$$hf || exit 1;
96 for hf in ${INSTALLED_INCFILES} ; do
97 ${INSTALL_DATA} ${BUSHINCDIR}/"$$hf" ${DESTDIR}${headersdir}/include/$$hf || exit 1;
99 for hf in ${INSTALLED_BUILTINS_HEADERS} ; do
100 ${INSTALL_DATA} ${BUILTIN_SRCDIR}/"$$hf" ${DESTDIR}${headersdir}/builtins/$$hf || exit 1;
102 for hf in ${CREATED_HEADERS} ; do
103 if test -f ${BUILD_DIR}/"$$hf" ; then
104 ${INSTALL_DATA} ${BUILD_DIR}/"$$hf" ${DESTDIR}${headersdir}/$$hf || exit 1;
106 ${INSTALL_DATA} ${srcdir}/"$$hf" ${DESTDIR}${headersdir}/$$hf || exit 1;
109 ${INSTALL_DATA} ${SDIR}/bush.pc ${DESTDIR}${pkgconfigdir}/bush.pc
115 ( cd ${DESTDIR}${headersdir} && ${RM} ${INSTALLED_HEADERS} )
116 ( cd ${DESTDIR}${headersdir}/include && ${RM} ${INSTALLED_INCFILES} )
117 ( cd ${DESTDIR}${headersdir}/builtins && ${RM} ${INSTALLED_BUILTINS_HEADERS} )
118 ( cd ${DESTDIR}${headersdir} && ${RM} ${CREATED_HEADERS} )
119 ( ${RM} ${DESTDIR}${pkgconfigdir}/bush.pc )
126 ${RM} ${OBJECTS} ${Program} bushbug
127 ${RM} .build .made src/version.h mksignames bushversion
130 ( cd ${DOCDIR} && ${MAKE} ${MFLAGS} clean )
131 ( cd builtins && ${MAKE} ${MFLAGS} clean )
132 ( cd ${SDIR} && ${MAKE} ${MFLAGS} clean )
133 for libdir in ${LIB_SUBDIRS}; do \
134 (cd $$libdir && test -f Makefile && ${MAKE} ${MFLAGS} clean) ;
136 ( cd ${PO_DIR} ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} clean )
137 ( cd ${LOADABLES_DIR} && ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} clean )
138 ${RM} ${CREATED_SUPPORT}
145 if test X"`cd ${topdir} && pwd -P`" != X"`cd ${BUILD_DIR} && pwd -P`" ; then
146 ${RM} parser-built src/lxrgmr/y.tab.c src/lxrgmr/y.tab.h ;
149 # mostlyclean: basic-clean
150 ( cd ${DOCDIR} && ${MAKE} ${MFLAGS} mostlyclean )
151 ( cd builtins && ${MAKE} ${MFLAGS} mostlyclean )
152 ( cd ${SDIR} && ${MAKE} ${MFLAGS) mostlyclean )
153 for libdir in ${LIB_SUBDIRS}; do
154 (cd $$libdir && test -f Makefile && ${MAKE} ${MFLAGS} mostlyclean) ;
156 ( cd ${PO_DIR} ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} mostlyclean )
157 ( cd ${LOADABLES_DIR} && ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} mostlyclean )
159 # distclean: basic-clean maybe-clean
160 ( cd ${DOCDIR} && ${MAKE} ${MFLAGS} distclean )
161 ( cd builtins && ${MAKE} ${MFLAGS} distclean )
162 ( cd ${SDIR} && ${MAKE} ${MFLAGS} distclean )
163 for libdir in ${LIB_SUBDIRS}; do
164 (cd $$libdir && test -f Makefile && ${MAKE} ${MFLAGS} distclean) ;
166 ( cd ${PO_DIR} ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} distclean )
167 ( cd ${LOADABLES_DIR} && ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} distclean )
168 ${RM} ${CREATED_CONFIGURE} tags TAGS
169 ${RM} ${CREATED_SUPPORT} Makefile ${CREATED_MAKEFILES} src/pathnames.h
175 cd ${LOADABLES_DIR} && ${MAKE} ${MFLAGS} all
180 # strip: ${Program} .made
188 # TAGS: $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE)
189 etags ${SOURCES} ${BUILTIN_C_SRC} ${LIBRARY_SOURCE}
191 # tags: $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE)
192 ctags -x ${SOURCES} ${BUILTIN_C_SRC} ${LIBRARY_SOURCE} > tags
197 # ${MAKE} ${MFLAGS} CFLAGS='${GCC_LINT_FLAGS}' .made
202 # ${MAKE} ${MFLAGS} ADDON_CFLAGS='${ASAN_XCFLAGS}' ADDON_LDFLAGS='${ASAN_XLDFLAGS}' .made
207 # ${MAKE} ${MFLAGS} CFLAGS=-g ADDON_CFLAGS='${GCOV_XCFLAGS}' ADDON_LDFLAGS='${GCOV_XLDFLAGS}' .made
210 ###################################################################
214 # $(SDIR)/man2html$(EXEEXT): ${SUPPORT_SRC}/man2html.c
215 (cd ${SDIR} && ${MAKE} ${MFLAGS} all ) || exit 1
220 # recho/zecho/printenv/xcase/hashtest
222 # recho$(EXEEXT): $(SUPPORT_SRC)recho.c
223 @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
225 # zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c
226 @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
228 # printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c
229 @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
231 # xcase$(EXEEXT): $(SUPPORT_SRC)xcase.c
232 @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)xcase.c ${LIBS_FOR_BUILD}
234 # hashtest: src/hashlib.c
235 $(CC) -DTEST_HASHING $(CCFLAGS) $(TEST_NBUCKETS) -o $@ $(srcdir)/src/hashlib.c xmalloc.o $(INTL_LIB) $(MALLOC_LIBRARY)
239 ###################################################################
243 # asan-tests: asan $(TESTS_SUPPORT)
244 @test -d tests || mkdir tests
245 cp ${TESTS_SUPPORT} tests
246 ( cd ${srcdir}/tests && \
247 BUILD_DIR=${BUILD_DIR} PATH=${BUILD_DIR}/tests:$$PATH THIS_SH=${THIS_SH} ${SHELL} ${TESTSCRIPT} )
252 # profiling-tests: ${PROGRAM}
253 test "X$$PROFILE_FLAGS" == "X" && { echo "profiling-tests: must be built with profiling enabled" >&2; exit 1; }
254 ${MAKE} ${MFLAGS} tests TESTSCRIPT=run-gprof
259 # test tests check: force $(Program) $(TESTS_SUPPORT)
260 @-test -d tests || mkdir tests
261 @cp $(TESTS_SUPPORT) tests
262 @( cd $(srcdir)/tests && \
263 BUILD_DIR=$(BUILD_DIR) PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
266 ###################################################################
271 @echo Bush distributions are created using $(srcdir)/support/mkdist.
272 @echo Here is a sample of the necessary commands:
273 @echo $(Program) $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r ${PACKAGE} -t $(PACKAGE_VERSION)
279 ( cd $(DOCDIR) && $(MAKE) $(MFLAGS) $@ )
280 ( cd po && $(MAKE) $(MFLAGS) $@ )
288 @echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
289 $(Program) $(SUPPORT_SRC)mkdep -c ${CC} -- ${CCFLAGS} ${CSOURCES}