Makefile文件太多
[root@localhost DarwinStreamingSrvr6.0.3-Source]# find -name Makefile.POSIX ./APIModules/QTSSDemoAuthorizationModule.bproj/Makefile.POSIX ./APIModules/QTSSDemoRedirectModule.bproj/Makefile.POSIX ./APIModules/QTSSHomeDirectoryModule/Makefile.POSIX ./APIModules/QTSSRawFileModule.bproj/Makefile.POSIX ./APIModules/QTSSRefMovieModule/Makefile.POSIX ./APIModules/QTSSSpamDefenseModule.bproj/Makefile.POSIX ./CommonUtilitiesLib/Makefile.POSIX ./HTTPUtilitiesLib/Makefile.POSIX ./Makefile.POSIX ./MP3Broadcaster/Makefile.POSIX ./PlaylistBroadcaster.tproj/Makefile.POSIX ./QTFileLib/Makefile.POSIX ./QTFileTools/QTBroadcaster.tproj/Makefile.POSIX ./QTFileTools/QTFileInfo.tproj/Makefile.POSIX ./QTFileTools/QTFileTest.tproj/Makefile.POSIX ./QTFileTools/QTRTPFileTest.tproj/Makefile.POSIX ./QTFileTools/QTRTPGen.tproj/Makefile.POSIX ./QTFileTools/QTSampleLister.tproj/Makefile.POSIX ./QTFileTools/QTSDPGen.tproj/Makefile.POSIX ./QTFileTools/QTTrackInfo.tproj/Makefile.POSIX ./qtpasswd.tproj/Makefile.POSIX ./StreamingLoadTool/Makefile.POSIX ./StreamingProxy.tproj/Makefile.POSIX [root@localhost DarwinStreamingSrvr6.0.3-Source]#
经过查看之后,大多数文件内容格式如下:
.cpp.o: $(C++) -c -o $*.o $(DEFINES) $(C++FLAGS) $*.cpp .c.o: $(CC) -c -o $*.o $(DEFINES) $(CCFLAGS) $*.c
执行批量更换
[root@localhost DarwinStreamingSrvr6.0.3-Source]# find -name Makefile.POSIX | xargs sed -i ‘/.cpp.o/a\\t$(C++) -E -o $*.i $(DEFINES) $(C++FLAGS) $*.cpp‘ [root@localhost DarwinStreamingSrvr6.0.3-Source]# find -name Makefile.POSIX | xargs sed -i ‘/.c.o/a\\t$(CC) -E -o $*.i $(DEFINES) $(CCFLAGS) $*.c‘
批量更换之后:
.cpp.o: $(C++) -E -o $*.i $(DEFINES) $(C++FLAGS) $*.cpp $(C++) -c -o $*.o $(DEFINES) $(C++FLAGS) $*.cpp .c.o: $(CC) -E -o $*.i $(DEFINES) $(CCFLAGS) $*.c $(CC) -c -o $*.o $(DEFINES) $(CCFLAGS) $*.c
本文出自 “李春利” 博客,谢绝转载!
原文地址:http://990487026.blog.51cto.com/10133282/1954223