Make
From Christoph's Personal Wiki
- The correct title of this article is make. The initial letter is capitalized due to technical restrictions.
In computing, make is a utility that automates the process of generating ("making") a file (or files). The make is most commonly used to generate an application. For each application, a programmer writes a file named "makefile" or (later) "Makefile", which tells make all the files and other tools involved in generating the final output file (or files).
Example makefile
Note: A random mix of stuff for examples.
SHELL = /bin/sh
AWK = awk
SED = sed
RM = rm
# Clear out pre-defined suffixes
.SUFFIXES:
.SUFFIXES: .seg .pdb .dat .log
%.seg: %.log
$(SED) -n '/^[0-9]/{n;p;}' $< | \
$(SED) -e 's/ [0-9].*\.\(.*\)//' >$@
SEG = 01 02 03 04 05
%.seg.s: %.seg
for n in $(SEG);\
do \
head -$$n $< | \
tail -1 | \
$(SED) 's/[)|;]/\n/g' - | \
head -$$n | \
$(SED) 's/[(('$(CH)':)| ]//g' - | \
$(SED) 's/-/\t/g' - | \
sort -nk1 - | \
$(SED) = - | $(SED) 'N;s/\n/\t/' >$@$$n ;\
done
show:
@echo "***************************************"
@echo SED = $(SED)
LIST = one two three
blah:
@for i in $(LIST); do \
echo $$i; \
done
clean:
$(RM) *.seg.s*
Useful utilities
Core
cat cmp cp diff echo egrep expr false grep install-info ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true
Extended
[ basename bash cat chgrp chmod chown cmp cp dd diff echo egrep expand expr false fgrep find getopt grep gunzip gzip hostname install install-info kill ldconfig ln ls md5sum mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee test touch true uname xargs yes