Thinking in C and *nix (CSC 282 2015S) : Outlines
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [Teaching & Learning] - [Calendar]
Current: [Outline] [EBoard] [Lab] [Assignment]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines]
Reference: [EBook] - [ISO] [GNU Coding Standards] [GCC Documentation] - [TAoUP] [Make3]
Previous Offerings: [CSC 295 2013S] [CSC 295 2014S]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker]
Held: Thursday, 9 April 2015
Back to Outline 09 - Automating Work with Make. On to Outline 11 - Miscellaneous C Programming Issues.
Summary
We continue our exploration of Make by exploring various ways to generalize makefiles.
Related Pages
Overview
Administrivia
NAME = ....These get used with the default rules for C.
CC - the C compilerCFLAGS - flags for the C compilerCPPFLAGS - flags for the C preproccesorLDFLAGS - flags for the loaderLINK.o - The thing that links .o files$@ is "the target"$^ is "the prerequisites"$< is "the first prerequisite" (why might that
be useful?)$? is "the newer prerequisites"$* is "the stem of the target".o file from a .c file
should work no matter what the name of the .c file is.make -p.$(shell *command*)HTML = $(shell ls *.html) PS = $(subst .html,.ps,$(HTML))
find,
which, whereis, or something similar to
identify locations of files that you plan to use.makedepend does that for you.pkg-config helps you figure out where.
pkg-config --cflags *package* computes the
C flags.pkg-config --libs *package* computes the flags
for the linker.automake) that make them for you.