Scripts and Utilities -- Make/rcs lecture links


  • Jim Plank
  • Directory: /home/cs494/notes/Make
  • This file: http://www.cs.utk.edu/~plank/plank/classes/cs494/494/notes/Make/links.html
  • The lecture notes: http://www.cs.utk.edu/~plank/plank/classes/cs494/494/notes/Make/lecture.html

    setup

    Simple makefile dependencies

    cd make1
    ls -l
    
    printname.c
    first.c
    last.c
    fn.h
    ln.h
    makefile
    make
    printname
    
    # modify last.c
    
    make
    printname
    
    make clean
    
    cd ..
    

    Little things: default target, multiple lines

    cd make2
    
    makefile
    make
    make clean
    
    cd ..
    

    Variables

    cd make3
    
    makefile
    
    setenv CC cc
    make
    
    setenv CC gcc
    make clean
    make
    
    cd ..
    

    .SUFFIXES

    cd make4
    
    makefile
    make
    
    cd ..
    

    Handy Make things

    homemakefile
            alias mk make -f $HOME/makefile
            alias mkd "pushd \!* ; make all ; popd"
    
    mkmake

    RCS examples

    Make a file called letter
    mkdir RCS
    ci letter
    
    ls letter
    ls -l RCS
    
    co -l letter
    cat letter
    
    Now, modify letter.
    ci -l letter
    cat letter
    rlog letter
    
    # Getting the old version:
    
    co -r1.1 letter
    ls -l letter
    cat letter
    
    co -l1.2 letter
    cat letter
    ls -l letter
    
    co -p1.1 letter > tmp
    cat tmp
    

    Revision numbers

    Now, modify letter again
    ci -l5.5 letter
    rlog letter
    

    Revision numbers

    Modify letter again.
    ci -l -m"yet another version" letter
    rlog letter
    

    Simple keywords

    hw.c
    ci -l1.0 -m'Initial version to test rcs' hw.c
    
    rlog hw.c
    cat hw.c
    
    Now, modify hw.c.
    ci -l -m'After modification' hw.c
    rlog hw.c
    cat hw.c
    

    The Log Keyword

    pj.c
    ci -l1.0 -m'First pass' pj.c
    cat pj.c
    
    
    Now, modify pj.c.
    ci -l -m"After modification" pj.c
    
    cat pj.c
    

    Managing all files in a directory

    mkdir ecc
    cd ecc
    cp /home/cs494/notes/Make/ecc1/* .
    make
    gs paper.ps
    
    make clean
    mkdir RCS
    
    ls > files
    
    Edit files and remove files and RCS.
    ci -l1.0 -m'Initial draft: intro, conclusions, bibliography' files `cat files`
    
    # add descriptions
    
    rm *
    co -l files
    co -l `cat files`
    ls
    make
    gs paper.ps
    
    # Now pretend you've done another draft:
    
    rm *
    cp /home/cs494/notes/Make/ecc2/* .
    make
    gs paper.ps
    
    make clean
    
    ls | sed '/RCS/d' | sed '/files/d' > files
    ci -l1.1 -f -m'Second draft -- added figures' files `cat files`
    
    rm *
    co -l files
    co -l `cat files`
    make
    gs paper.ps
    
    rm *
    co -l1.0 files
    co -l1.0 `cat files`
    make
    gs paper.ps