CS 330 Lecture 3 – Make
January 30, 2015 by Chris Johnson. Filed under
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
cs330, lectures, spring 2015.
Agenda
- what ?s
- what does this do?
- graph this
- capturing shell sequences with make
TODO
- Try out Ruby at http://tryruby.org.
- Watch a mini-documentary about Grace Hopper, creator of Cobol, one of the first high-level languages.
- Respond to these on a 1/4 sheet with 3-4 observations or questions.
What Does This Do?
#!/bin/sh
if [ `uname` = "Darwin" ]; then
clipboard=pbcopy
else
clipboard=xsel
fi
echo `pwd`/$1 | $clipboard
#!/usr/bin/env zsh
id=$1
vim $(grep -r -l $id *)
#!/usr/bin/env zsh
if [[ $# -ne 1 ]]; then
echo "Usage: $0 file" >&2
exit 1
fi
f=$1
say -f $f -o ${f:r}.aiff
Graph
Compose a graph showing the dependencies between the various files used to create a sign for Bring Your Pet to Class day:
- File
footer.tex is created by running genfooter, which replaces all instances of EMAIL in footer.template with the contents of file email.
- File
sign.pdf is created by running pdflatex on sign.tex, which includes footer.tex, header.tex, and mural.png.
- File
header.tex is not generated, but edited manually.
- File mural.png assembles
images[1-9].png into a mural using ImageMagick’s montage utility.
Represent each file as a node in your graph. Draw an edge from each file to its dependencies.
Code
email
petsday@uwec.edu
footer.template
Questions? Email #EMAIL.
genfooter
#!/bin/sh
email=`cat email`
sed -e "s/#EMAIL/$email/" footer.template
header.tex
Next Tuesday is Bring Your Pets to Class Day!
sign.tex
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\Large
\begin{center}
\input{header}
\includegraphics[width=0.99\linewidth]{mural}
\input{footer}
\end{center}
\end{document}
makefile
Note to copy and pasters: makefile rules need to be indented with real tabs, not spaces.
sign.pdf: header.tex footer.tex mural.png sign.tex
@echo "$@ is out-of-date. Newer: $?"
pdflatex sign.tex
footer.tex: footer.template email genfooter
@echo "$@ is out-of-date. Newer: $?"
./genfooter > footer.tex
mural.png: image1.png image2.png image3.png image4.png image5.png image6.png image7.png image8.png image9.png
@echo "$@ is out-of-date. Newer: $?"
montage -geometry '400x400+5+5>' -shadow $^ mural.png
Haiku
synonyms
Let’s mechanize it
Let’s forget how to do this
This wheel is perfect