| 1 |
######################################################################## |
| 2 |
# Code listing from "Advanced Linux Programming," by CodeSourcery LLC # |
| 3 |
# Copyright (C) 2001 by New Riders Publishing # |
| 4 |
# See COPYRIGHT for license information. # |
| 5 |
######################################################################## |
| 6 |
|
| 7 |
# Default compiler options for C and C++. To build with other options, |
| 8 |
# provide a definition of CFLAGS when invoking make. For example, |
| 9 |
# invoke "make CFLAGS=-O2 all". |
| 10 |
CFLAGS = -g -Wall |
| 11 |
CXXFLAGS = $(CFLAGS) |
| 12 |
|
| 13 |
# Pass these variables to make subprocesses. |
| 14 |
export CFLAGS CXXFLAGS |
| 15 |
|
| 16 |
# The subdirectories in this directory. |
| 17 |
SUBDIRS = chapter-1 chapter-2 chapter-3 chapter-4 chapter-5 \ |
| 18 |
chapter-6 chapter-7 chapter-8 chapter-9 chapter-10 \ |
| 19 |
chapter-11 appendix-a appendix-b |
| 20 |
|
| 21 |
.PHONY: all clean $(SUBDIRS) |
| 22 |
|
| 23 |
# The default target: build the contents of each subdirectory. |
| 24 |
all: $(SUBDIRS) |
| 25 |
|
| 26 |
# For each subdirectory, invoke a make subprocess. |
| 27 |
$(SUBDIRS): |
| 28 |
cd $@; $(MAKE) |
| 29 |
|
| 30 |
# Clean up build products in all subdirectories. |
| 31 |
clean: |
| 32 |
for subdir in $(SUBDIRS); do \ |
| 33 |
(cd $${subdir}; $(MAKE) $@); \ |
| 34 |
done |