2000 Copyrights, Danielle S. Lahmani UNIX Tools G22.2245-001, Fall 2000 Danielle S. Lahmani Lecture 9.

Slides:



Advertisements
Similar presentations
Utilizing the GDB debugger to analyze programs Background and application.
Advertisements

The make Utility Programming Tools and Environments Winter 2006.
2000 Copyrights, Danielle S. Lahmani UNIX Tools G , Fall 2000 Danielle S. Lahmani Lecture 6.
Understanding Makefiles COMP 2400, Fall 2008 Prof. Chris GauthierDickey.
2000 Copyrights, Danielle S. Lahmani UNIX Tools G , Fall 2000 Danielle S. Lahmani Lecture 12.
Compilation & linkage.h read.h.c read.c.c main.c.c list.c.h list.h prog1 Linkage: g++ read.o main.o list.o –o prog1.o main.o.o list.o.o read.o Compilation:
1 The Makefile Utility ABC – Chapter 11,
CS Lecture 11 Outline Compiling C programs using gcc Archiving modules Using Makefiles Debugging using gdb Assignment 3 discussion Lecture 111CS.
© O. Nierstrasz— P2 —1 Exceptions All Exception classes look like this! Define your own exception class to distinguish your exceptions from any other kind.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Guide to Linux Installation and Administration, 2e1 Chapter 6 Using the Shell and Text Files.
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
CS465 - Unix C Programming (cc/make and configuration control)
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Make: the good, the bad, and the ugly Dan Berger Titus Winters
Introduction to Shell Script Programming
Introduction Use of makefiles to manage the build process Declarative, imperative and relational rules Environment variables, phony targets, automatic.
리눅스 : Lecture 5 UNIX 유틸리티 : text editor, compilation (make), …
Jump to first page (C) 1998, Arun Lakhotia 1 Software Configuration Management: Build Control Arun Lakhotia University of Southwestern Louisiana Po Box.
Lecture 5 Software Development. Types of Development Tools Archiving: tar, cpio, pax, RPM Configuration: autoconf Compilation and building: make Managing.
Old Chapter 10: Programming Tools A Developer’s Candy Store.
UNIX Shell Script (1) Dr. Tran, Van Hoai Faculty of Computer Science and Engineering HCMC Uni. of Technology
An Intro to Concurrent Versions System (CVS) ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University.
Chapter Ten g++ and make1 System Programming Software Development: g++ and make.
CSE 219 Computer Science III CVS
P51UST: Unix and Software Tools Unix and Software Tools (P51UST) Exam Revision Ruibin Bai (Room AB326) Division of Computer Science The University of Nottingham.
Guide To UNIX Using Linux Third Edition Chapter 8: Exploring the UNIX/Linux Utilities.
RCS The Revision Control System. To Be Covered… An RCS overview The RCS command set Some useful things Where it can be used Alternatives to RCS.
GNU Make Computer Organization II 1 © McQuain What is make ? make is a system utility for managing the build process (compilation/linking/etc).
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
Makefiles. Multiple Source Files (1) u Obviously, large programs are not going to be contained within single files. u C provides several techniques to.
CIT 470: Advanced Network and System AdministrationSlide #1 CIT 470: Advanced Network and System Administration Change and Configuration Management.
Linux+ Guide to Linux Certification, Third Edition
Data Display Debugger (DDD)
Tools – Ant-MakeEtc 1 CSCE 747 Fall 2013 CSCE 747 Software Testing and Quality Assurance Tools 12 – Hamcrest 10/02/
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
Makefiles CARYL RAHN. Separate compilation Large programs are generally separated into multiple files, e.g. main.c addmoney.c removemoney.c money.h With.
Prof: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015 Makefile Tutorial CIS5027.
Modular Programming. Introduction As programs grow larger and larger, it is more desirable to split them into sections or modules. C allows programs to.
Make: File Dependency System Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: “UNIX for Programmers and Users” Third.
CSI605 Introduction to make. Advantages of Make Significantly reduces the amount of time spent compiling a program. Insures that programs are compiled.
Advanced UNIX progamming Fall 2002 Instructor: Ashok Srinivasan Lecture 2 Class web site:
Visual Source Safe –A Quick Tour. CONTENTS What is VSS ? How to install VSS ? How does VSS track versions? VSS Concepts & Features Utilities available.
CSc 352 An Introduction to make Saumya Debray Dept. of Computer Science The University of Arizona, Tucson
GNU Make Computer Organization II 1 © McQuain What is make ? make is a system utility for managing the build process (compilation/linking/etc).
UNIX Development: g++ and make CS 2204 Class meeting 8 Created by Doug Bowman, 2001 Modified by Mir Farooq Ali, 2002.
Makefiles Manolis Koubarakis Data Structures and Programming Techniques 1.
Lecture 6 UNIX Development Tools. Software Development Tools.
The make utility (original presentation courtesy of Alark Joshi)
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha Fall 2015
Brief Intro to Make CST494/ Gannod.
SEEM3460 Tutorial The Make Utility.
SCMP Special Topic: Software Development Spring 2017 James Skon
Makefile Tutorial CIS5027 Prof: Dr. Shu-Ching Chen
What is make? make is a system utility for managing the build process (compilation/linking/etc). There are various versions of make; these notes discuss.
Prof: Dr. Shu-Ching Chen TA: Yimin Yang
Prof: Dr. Shu-Ching Chen TA: Samira Pouyanfar Hector Cen Fall 2017
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha
Makefiles and the make utility
Compilers, Make and SubVersion
Data Structures and Programming Techniques
Kyle Fitzpatrick Konstantin Zak 11/29/2004
SCMP Software Development Spring 2018 James Skon
Preparation for Assignment 2
CSc 352 An Introduction to make
Makefiles and the make utility
SCMP Software Development Spring 2018 James Skon
The make utility (original presentation courtesy of Alark Joshi)
Presentation transcript:

2000 Copyrights, Danielle S. Lahmani UNIX Tools G , Fall 2000 Danielle S. Lahmani Lecture 9

2000 Copyrights, Danielle S. Lahmani UNIX Development Tools Make source control mechanisms –SCCS –RCS

2000 Copyrights, Danielle S. Lahmani MAKE reference:”Make a Programming for maintaining Computer Programs,” S.I.Feldman, BellLabs, 1978 make: “program for maintaining computer programs” developed at Bell Labs around 1978 automatically updates files for users based on a series of dependency rules stored in a special format file called a “makefile”.

2000 Copyrights, Danielle S. Lahmani make make can run with any programming language whose compiler can be run from a shell cmd. can describe any tasks where some files must be updated automatically from others whenever the others change. typical usage: executable is updated from object files which are in turn made by compiling source files uses makefile rules and file last modification times to decide which files need to be updated

2000 Copyrights, Danielle S. Lahmani Makefile format Targetlist : dependency list command list targetlist list of target files, that is the name of the executable file that will be produced command list: is a list of zero or more command lines, needed to reconstruct the target files from the dependency files

2000 Copyrights, Danielle S. Lahmani Invoking Make make -f makefile make target make make: looks for file makefile or Makefile in current directory, picks first target listed in the makefile

2000 Copyrights, Danielle S. Lahmani Make: Sequence of execution Make executes all commands associated with target in makefile if one of 2 conditions is satisfied. –file “target” does not exist –file “target” exists but one of the sourcefiles in the dependencylist has been modified more recentrly than file “target”

2000 Copyrights, Danielle S. Lahmani Make: Suggestions and Warnings make -n prints cmds without execution make -ts causes relevant files to be up to date make -d verbose output cmds listed in command list executed as /bin/sh provides macro substitution ability to encapsulate cmds in a single file for easy administration install: cp main1 /usr/bin/myprog; rm main1

2000 Copyrights, Danielle S. Lahmani Comparison between make and GNU make GNU make is usually /usr/local/bin/make Function | GNU make | SUN make Basic Rule target : dependency1... Same sh commandline1 sh commandline2... Variables VAR = Same... $(VAR)...

2000 Copyrights, Danielle S. Lahmani make and GNU make comparisons Function | GNU make | SUN make Pattern Rule t1%t2 : d1%d2 Same... $*... Automatic Variable == target Same in commandline $* == % pattern $* == % pattern OR target w/out suffix $< == first dependency $< == all dependencies $^ == all dependencies Not Defined

2000 Copyrights, Danielle S. Lahmani GNU make and make comparison Function | GNU make | SUN make Automatic Variable in dependency list means target Same Predefined Pattern %.o : %.c Same Rules (Small Sample) % : SCCS Same % : RCS N/A Variables used in CFLAGS = Same Predefined Patterns CPPFLAGS = Same (Small Sample) CC = Same

2000 Copyrights, Danielle S. Lahmani GNU Make and Make comparison Function | GNU make | SUN make Automatic #include include $(OBJ:.o=.d).KEEP_STATE: dependency generation %.d: %.c for C programs /bin/sh -ec 'gcc -MM -MG $(CPPFLAGS) $*.c | sed '\''s/$*\.o[ &/g'\'' > (Just include these # The previous line is for GNU make only line(s) in the # Handles missing.h files # All.h files must be makefile) # (with RCS or SCCS) # present. # Doesn't notice if a # Notices if makefile # makefile command changes # command changes.

2000 Copyrights, Danielle S. Lahmani RCS and SCCS RCS: Revision Control System SCCS is the UNIX Source Code Control System provide the ability to store/access and protect all of the versions of source code files.

2000 Copyrights, Danielle S. Lahmani SCCS provides the following benefits 1. if program has multiple versions, it keeps track only of differences between multiple versions. 2. allows only one person at the time to do the editing 3. provides a way to look at the history of program development

2000 Copyrights, Danielle S. Lahmani SCCS: Basic operations Admin or create utility to create an SCCS file. the SCCS file cannot be edited or compiled directly, it contains special info. get or edit utility to edit a file specifying for reading or writing (-e) option. delta utility to return a new version of a file to the SCCS system prs allows you to obtain a file's history. sact allows you to see the current editing activities on a particular SCCS file.

2000 Copyrights, Danielle S. Lahmani RCS: Basic Operations mkdir RCS: for setup ci foo: check in new file foo co foo: get read only file foo co -l foo: get writable version of file foo.rcsdiff [-r ] foo.c: compare foo.c with checked -in foo.c

2000 Copyrights, Danielle S. Lahmani RCS and SCCS Comparison (Prof. Thomas Anantharanam's Notes) Version Control: ID Numbering : 1.1 -> 1.2 -> > 2.1 -> 2.2 -> \ -> > > > ID's with 2 digits are called "main line" or "trunk" versions. ID's with 4 (in RCS 4 or more) digits are called "branch" versions.

2000 Copyrights, Danielle S. Lahmani RCS and SCCS Comparison (Prof. Thomas Anantharanam's Notes) Function | GNU RCS | SCCS setup mkdir RCS mkdir SCCS check in new foo.c ci foo.c sccs create foo.c check in update to foo.c ci foo.c sccs delta foo.c get readonly foo.c co foo.c sccs get foo.c get writeable foo.c co -l foo.c sccs edit foo.c

2000 Copyrights, Danielle S. Lahmani RCS and SCCS Comparison (Prof. Thomas Anantharanam's Notes) Function | GNU RCS | SCCS Specify next version ID co -l foo.c sccs edit - r foo.c (Default : increment ci -r foo.c sccs delta foo.c last ID digit by one) # id is ID without # the last digit! compare foo.c with rcsdiff [-r ] foo.c sccs diffs [-r ] \ checked in foo.c foo.c [-r if not latest]

2000 Copyrights, Danielle S. Lahmani RCS and SCCS Comparison (Prof. Thomas Anantharanam's Notes) Function | GNU RCS | SCCS list versions of foo.c rlog foo.c sccs print foo.c Insert version in code char *ID = "$Id$; char *ID = "%A%"; Display these versions ident what in compiled program.