我遇到了一个错误,说我的 Makefile 的第 235 行有错误:
make[4]: Leaving directory `/opt/home/root/native-upstream/native_client/tools/SRC/glibc/wctype'
make subdir=manual -C manual ..=../ subdir_lib
make[4]: Entering directory `/opt/home/root/native-upstream/native_client/tools/SRC/glibc/manual'
Makefile:235: *** mixed implicit and normal rules. Stop.
make[4]: Leaving directory `/opt/home/root/native-upstream/native_client/tools/SRC/glibc/manual'
make[3]: *** [manual/subdir_lib] Error 2
make[3]: Leaving directory `/opt/home/root/native-upstream/native_client/tools/SRC/glibc'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/home/root/native-upstream/native_client/tools/BUILD/build-glibc32'
make[1]: *** [BUILD/stamp-glibc32] Error 2
make[1]: Leaving directory `/opt/home/root/native-upstream/native_client/tools'
make: *** [build-with-glibc] Error 2
但是我不知道哪个 Makefile 有这个错误,我的项目中有很多 Makefile:
# find . -name Makefile
./tools/Makefile
./tools/BUILD/.gcc-extra-build-cloog-ppl/doc/Makefile
./tools/BUILD/.gcc-extra-build-cloog-ppl/Makefile
./tools/BUILD/.gcc-extra-build-cloog-ppl/test/Makefile
./tools/BUILD/.gcc-extra-build-gmp/printf/Makefile
./tools/BUILD/.gcc-extra-build-gmp/doc/Makefile
./tools/BUILD/.gcc-extra-build-gmp/tests/Makefile
./tools/BUILD/.gcc-extra-build-gmp/tests/devel/Makefile
...
所以我想打印每个 Makefile 的第 235 行,以找出谁是罪魁祸首,例如:
./tools/Makefile: 235: $(objpfx)c++-types-check.out: $(check-data) scripts/check-c++-types.sh
./tools/BUILD/.gcc-extra-build-cloog-ppl/doc/Makefile: 235: ifneq (,$(check-data))
./tools/BUILD/.gcc-extra-build-cloog-ppl/Makefile: 235: $(objpfx)c++-types-check.out:
./tools/BUILD/.gcc-extra-build-cloog-ppl/test/Makefile: 235: endif
./tools/BUILD/.gcc-extra-build-gmp/printf/Makefile: 235:
./tools/BUILD/.gcc-extra-build-gmp/doc/Makefile: 235:
./tools/BUILD/.gcc-extra-build-gmp/tests/Makefile: 235: # Master Makefile for the GNU C library
./tools/BUILD/.gcc-extra-build-gmp/tests/devel/Makefile: 235:
有没有办法做到这一点?