PMake -- A Tutorial
Prev | Chapter 3 Short-cuts and Other Nice Things | Next

# 3.7. More Exercises

# Exercise 3.1

You have got a set programs, each of which is created from its own assembly-language source file (suffix `.asm`). Each program can be assembled into two versions, one with error-checking code assembled in and one without. You could assemble them into files with different suffixes (`.eobj` and `.obj`, for instance), but your linker only understands files that end in `.obj`. To top it all off, the final executables must have the suffix `.exe`. How can you still use transformation rules to make your life easier (Hint: assume the errorchecking versions have ec tacked onto their prefix)?

# Exercise 3.2

Assume, for a moment or two, you want to perform a sort of “indirection” by placing the name of a variable into another one, then you want to get the value of the first by expanding the second somehow. Unfortunately, PMake does not allow constructs like:

    $($(FOO))

What do you do? Hint: no further variable expansion is performed after modifiers are applied, thus if you cause a `$` to occur in the expansion, that is what will be in the result.

Prev | Home | Next
Modifying Variable Expansion | Up | PMake for Gods

This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.