beautypg.com

How to change or disable dependency file creation, Sample build rule for testmx.c, How to change – HP Integrity NonStop J-Series User Manual

Page 55

background image

testmx.ec: "testmx.mxh" "testmx2.mxh"

Because the SQL/MX preprocessor does not specify the locations of header files, NSDEE performs
a final pass over the dependency file, adding paths to the dependencies through -I directives
specified in the invocation of the compiler.

Example 4 “Sample build rule for testmx.c ”

shows an example of the contents of a subdir.mk

file with a rule for building testmx.c using the source testmx.ec which has dependencies on
SQL/MX header files in mxprog/mxheaders.

Example 4 Sample build rule for testmx.c

EC_DEPS += \
./src/mxprog.dep

src/testmx.c: ../src/testmx.ec
@echo 'Building file: $<'
@echo 'Invoking: C/C++ SQL/MX Preprocessor (TNS/E)'
c89 -I"C:\Users\doon\workspace\testmx\mxheaders" -Wsystype=oss \
-Wsqlmx=preprocess_only -Wsqlmx_port=18650 -Wcall_shared \
-Wsqlhost=nonstopsystem.corp.net -Wsqluser=sdev.doon,\
`"C:/e3.7/eclipse/plugins/com.hp.nsdee_4.0/Tools/nsdee-auth.exe"\
invoke nonstopsystem.corp.net sdev.doon` -Wsqlmxadd='-c "$@" -V "$*.dep"' "$<" && \
sed '2~1s/\(.*\)/"\1"/'< "$*.dep" | tr -s '\r\n' ' ' | sed 's/ /: /; s/^.*\\//' \
>"$*.dep2"; mv "$*.dep2" "$*.dep"
@echo 'Finished building: $<'
@echo ' '

How to change or disable dependency file creation

NSDEE checks the build variable DependencyHandling to determine how to write commands
to makefiles for generating dependecy files. Using the Build Variables property page for your
project, you can set DependencyHandling to one of the following values:

none

to turn off generation of dependencies

makeonly

to limit generation of dependencies to those that can be generated without using

NSDEE (as when invoking make outside of NSDEE)

full

(the default) to generate a full list of dependencies (but not system header dependencies)

For information on setting build variables, see

“Setting build variables” (page 90)

.

Setting DependencyHandling to none can be useful if you are not crned about automatically
building sources when header files change. Setting DependencyHandling to none results in
faster builds. However, after an initial build generates dependency files for all object files,
subsequent builds only generate dependency files for objects that need to be rebuilt. So after an
initial build, the performance cost of generating dependency files is greatly lessened.

Setting DependencyHandling to makeonly can also result in faster builds since NSDEE does
not perform a final pass over dependency files to create dummy header file dependencies.

NOTE:

Because the SQL/MX preprocessor does not include paths to .mxh header files in its

dependency output, using makeonly for SQL/MX builds might not result in make detecting .mxh
header changes. Setting DependencyHandling to full causes NSDEE to post-process the
output to add paths to the header files.

To include system headers in dependency files, specify makeonly+systemHeaders or
full+systemHeaders

, depending whether you want NSDEE to perform final pass over the

dependency files to add dummy rules for headers.

NOTE:

If you misspell none or makeonly when setting DependencyHandling, dependency

generation defaults to full. Additionally, if you misspell +systemHeaders, no system headers
are added to dependency files.

Handling dependencies in managed builds

55

This manual is related to the following products: