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