1 #------------------------------------------------------------------------------
2 # Make rules for determining the dependencies between source files.
4 # This file is intended for use in a Makefile via the include directive, e.g.
6 # include $(BUID_DIR)/depend_rules.mk
8 # It may also be include by other rule files in this directory.
10 # These rules rely upon proper setting of OBJS and SRC_EXTENSIONS.
12 # Copyright (C) 2001, WSI Corporation
13 #------------------------------------------------------------------------------
15 # For portability, use the Bourne shell within Makefiles.
16 # There have been problems using the C-shell under Linux.
21 # RULES for creating the source code dependencies.
23 # These are typically used to implement the rules depend and clean_depend
24 # in other make rule files.
26 # 'generic_depend' creates the dependencies and appends them to a separate
27 # file in the same directory as the source code, called .depend.
28 # Depend uses some customized logic to determine the name of the source
29 # code file associated with each object file in OBJS. This means that we
30 # can mix source code extensions in the same library (e.g. use C and C++
31 # source interchangeably). See compile_rules.mk for supported file name
32 # extensions for C and C++ development.
34 # 'generic_clean_depend' removes the dependencies file .depend.
41 if
[ -z
"$(OBJS)" ]; then\
46 for o in
$${objs}; do\
47 if
[ $$o = "foobar" ]; then\
48 echo
"Error: no objects were specified in OBJS.";\
51 b
=`echo $$o | sed -e 's/\.o//'` ;\
53 for e in
$(SRC_EXTENSIONS
) ; do \
55 if
[ -r
"$$s" ]; then\
56 srcs
="$${srcs} $$s" ;\
61 if
[ -z
"$$f" ]; then\
62 echo
"Could not find source file for object file $$o";\
66 if
[ "$(SYS_CXX_INCLUDES)" ]; then\
67 make_opts
="-I+ $(SYS_CXX_INCLUDES)";\
69 if
[ "$(SYS_C_INCLUDES)" ]; then\
70 make_opts
="$${make_opts} -I+ $(SYS_C_INCLUDES)";\
72 if
[ "$(C_INCLUDES)" ]; then\
73 make_opts
="$${make_opts} -I+ $(C_INCLUDES)";\
75 if
[ "$(CXX_INCLUDES)" ]; then\
76 make_opts
="$${make_opts} -I+ $(CXX_INCLUDES)";\
78 makedepend
$${make_opts} -f-
$${srcs} > .depend
;