updated top-level README and version_decl for V4.4.2 (#1795)
[WRF.git] / external / io_grib_share / build / binary_rules.mk
blobf97b9773456163ec7ec40ca0ad3f6054b2b117d9
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.
22 SHELL=/bin/sh
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
40 # modules.
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.
51 all : binary
53 binary:
54 @src="$(BIN_SRC)" ; \
55 if [ -z "$${src}" ]; then \
56 src="invalid" ;\
57 else if [ -z "$(BIN_DEST)" ]; then \
58 echo "Error: Binary installation directory BIN_DEST not set" 1>&2;\
59 src="invalid" ;\
60 fi; fi; \
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}; \
65 fi; \
66 if [ "$${s}" = "invalid" ]; then \
67 continue;\
68 fi;\
69 echo " Copying $$s to $(BIN_DEST)/$${s}" ; \
70 cp $$s $(BIN_DEST)/$${s} ; \
71 done; \
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.
87 utest: .FORCE
88 @echo " make $@ is not implemented for binary modules" 1>&2
90 .FORCE:
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
97 # files.
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
103 # object files.
105 clean_exe:
106 @echo " make $@ is not implemented for binary modules" 1>&2
108 clean_lib:
109 @echo " make $@ is not implemented for binary modules" 1>&2
111 clean:
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.