1 #------------------------------------------------------------------------------
2 # Make rules for installing binary files to a specified destination
4 # This file is intended for use in Makefile via the include directive, e.g.
6 # include $(BUILD_DIR)/binary_rules.mk
8 # It is assumed that the environment has been set by sourcing the build
9 # resource file (buildrc).
11 # This file defines the following rules for binary files:
13 # all, binary, utest, exe, clean, clean_lib, clean_exe,
14 # clean_depend, depend.
16 # Copyright (C) 2002, WSI Corporation
17 #------------------------------------------------------------------------------
19 # For portability, use the Bourne shell within Makefiles.
20 # There have been problems using the C-shell under Linux.
25 # RULES for installing scripts and script modules
27 # EXE_SRC specifies a list of files that contain executable scripts.
28 # Each file in the list will be installed in the $(BIN_DEST) directory
29 # and will be given executable permissions. If the variable EXE_EXT is
30 # set, this extension will be stripped from the end of the source file
31 # when it is installed, e.g. if EXE_SRC = "foo.pl" and EXE_EXT = ".pl",
32 # the executable installed in BIN_DEST will be named "foo".
34 # For tcl packages, MOD_SRC specifies a list of files that contain the
35 # source code that will make up the package. MOD_NAME specifies the
36 # file name for the package (this is typically the module name with a
37 # ".tcl" extension). In addition, the Makefile *MUST* specify a
38 # destination directory for installation. Typically, this is set to a
39 # subdirectory of BASE_DIR, e.g. MOD_DEST = $(BASE_DIR)/perllib for perl
42 # The EXE_SRC variable only needs to be set executable scripts need to be
43 # built. Likewise MOD_SRC determines if script modules should be built.
44 # The logic to set "src" to "invalid" is used to prevent shell errors
45 # if either or both of these variables are not set.
47 # However, if MOD_SRC is set, MOD_DEST must also be set to the location
48 # of a valid directory. The same is also true for EXE_SRC and BIN_DEST,
49 # but BIN_DEST is properly set when the buildrc resource file is sourced.
55 if
[ -z
"$${src}" ]; then \
57 else if
[ -z
"$(BIN_DEST)" ]; then \
58 echo
"Error: Binary installation directory BIN_DEST not set" 1>&2;\
61 for s in
$${src}; do \
62 if
[ -f
$(BIN_DEST
)/$${s} ]; then \
63 echo
" Removing $(BIN_DEST)/$${s}"; \
64 rm -f
$(BIN_DEST
)/$${s}; \
66 if
[ "$${s}" = "invalid" ]; then \
69 echo
" Copying $$s to $(BIN_DEST)/$${s}" ; \
70 cp
$$s $(BIN_DEST
)/$${s} ; \
74 # Include rules for installation of configuration files.
76 include $(BUILD_DIR
)/config_rules.mk
79 # RULES that are not implemented.
81 archive linked_lib
: .FORCE
82 @echo
" make $@ is not implemented for binary modules" 1>&2
85 # RULE for building unit test programs.
88 @echo
" make $@ is not implemented for binary modules" 1>&2
93 # RULES for cleaning up derived files.
95 # 'clean' removes any extraneous artifacts of producing script modules or
96 # executables. make clean also removes files core files and backup
99 # 'clean_lib' removes the installed libraries or modules
100 # 'clean_exe' removes the installed executable scripts
102 # A subsequent make will recreate the shared library from the compiled
106 @echo
" make $@ is not implemented for binary modules" 1>&2
109 @echo
" make $@ is not implemented for binary modules" 1>&2
112 @echo
" Cleaning up binary directory `pwd`" ;\
113 /bin
/rm -f Makefile.bak core
*~
#*#
116 # Rules for making dependencies.
117 # These are not implemented for scripts, so the rules do nothing.
119 depend clean_depend
: .FORCE
122 # DO NOT DELETE THIS LINE -- make depend depends on it.