googleemployee-midtermsolutions内容摘要:

CC=g++ CFLAGS=g –Wall DDEBUG foobar: $(CC) $(CFLAGS) –o foobar : $(CC) $(CFLAGS) –c : $(CC) $(CFLAGS) –c clean: rm foobar Make Power Features • Many builtin rules – . C pilation • “Fake” targets – Targets that are not actually files – Can do just about anything, not just pile – Like the “clean” target • Forcing repiles – touch the required files – touch the Makefile to rebuild everything Version Control • Provide the ability to store/access and protect all of the versions of source code files • Provides the following benefits: – If program has multiple versions, it keeps track only of differences between multiple versions. – Multiuser support. Allows only one person at the time to do the editing. – Provides a way to look at the history of program development. Version Control Systems • SCCS: UNIX Source Code Control System – Rochkind, Bell Labs, 1972. • RCS: Revision Control System – Tichy, Purdue, 1980s. • CVS: Concurrent Versions System – Grune, 1986, Berliner, 1989. RCS Basic Operations • Set up a directory for RCS: – mkdir RCS • Check in a new file into the repository – ci filename • Check out a file from the repository for reading – co filename • Check out a file from the repository for writing – co –l filename – Acquires lock • Compare local copy of file to version in repository – rcsdiff [–rID] filename RCS Keywords • Keywords in source files are expanded to contain RCS info at checkout – $keyword$  $keyword: value $ – Use ident to extract RCS keyword info • $Author$ Username of person checked in the revision • $Date$ Date and time of checkin • $Id$ A title that includes the RCS filename, revision number, date, author, state, and (if locked) the person who locked the file • $Revision$ The revision number assigned SCCS Equivalents Function RCS SCCS Setup mkdir RCS mkdir SCCS Check in new ci sccs create Check in update to ci sccs delta Get readonly co sccs get Get writeable co l sccs edit Version history of rlog sccs print Compare to rcsdiff sccs diffs – CVS Major Features • No exclusive locks like RCS – No waiting around for other developers – No hurrying to make changes while others wait – Avoid the “lost update” problem • Client/Server model – Distributed software development • Frontend tool for RCS with more functions CVS Repositories • All revisions of a file in the project are in the repository (using RCS) • Work is done on the checkout (working copy) • Toplevel directories are modules。 checkout operates on modules • Different ways to connect CVSROOT • Environment Variable • Location of Repository • Can take different forms: – Local file system: /usr/local/cvsroot – Remote Shell: user@server:/usr/local/cvsroot – Client/Server: :pserver:user@server:/usr/local/cvsroot Getting Started • cvs [basicoptions] mand [cmdoptions] [files] • Basic options: – d cvsroot Specifies CVSROOT – H Help on mand – n Dry run • Commands – import, checkout – update, mit – add, remove – status, diff, log – tag... Setting up CVS • Importing source – Generates a new module – cd into source directory – cvs –dcvsroot import newmodule vendorbranch releasetag – cvs –dcvsroot checkout modulename Managing files • Add files: add (cvs add filename) • Remove files: remove (cvs remove filename) • Get latest version from repository: update – If out of sync, merges changes. Conflict resolution is manual。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。