[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.2.3 Output Directory

To avoid polluting the entire directory hierarchy with temporary and intermediate files, all output from the build process should be placed into a separate directory tree intended specifically for such transient files. By default this directory is named as follows, and assigned to the makefile variable `OUT'.

 
OUT = out/$(OS)/$(PROC)/$(MODE)$(OUTSUFX.$(MAKE_DLL))

So, if you're building a dynamic library for Linux on an Intel machine, the output directory would be named `out/LINUX/X86/optimize.so/'. To reference to the output directory you should use the variable $(OUT) in your submakefiles. For example, the following rule tells `make' how to compile `.cpp' files:

 
$(OUT)%$O: apps/gnipgnop/%.cpp
        $(DO.COMPILE.CPP)

This rule says that C++ source files in the `apps/gnipgnop' directory can be compiled to an object file in the $(OUT) directory via the $(DO.COMPILE.CPP) commands.

On ther other hand, if you need a separate rule for just one or several specific files, you could do it this way:

 
$(OUT)file1$O: apps/gnipgnop/file1.cpp
        $(DO.COMPILE.CPP) $(CFLAGS.FORFILE1)
$(OUT)file2$O: apps/gnipgnop/file2.cpp
        $(DO.COMPILE.CPP) $(CFLAGS.FORFILE2)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated using texi2html