1 #============================================================================
2 # Rules for installation
3 #============================================================================
8 INSTALL_PROGRAM ?= $(INSTALL) ;
9 INSTALL_SCRIPT ?= $(INSTALL) ;
10 INSTALL_DATA ?= "$(INSTALL) -m644" ;
13 appdatadir ?= [ ConcatDirs $(datadir) $(PACKAGE_NAME) ] ;
14 appdocdir ?= [ ConcatDirs $(datadir) doc $(PACKAGE_NAME)-$(PACKAGE_VERSION) ] ;
15 appconfdir ?= [ ConcatDirs $(sysconfdir) $(PACKAGE_NAME) ] ;
16 plugindir ?= [ ConcatDirs $(libdir) $(PACKAGE_NAME) ] ;
18 ## InstallHeader headername [ : subdir ]
19 ## DoInstall a headerfile into the includedir directory. A subdirectory
20 ## relative to the includedir can be specified.
23 SEARCH on $(<:G=installheader) = $(SUBDIR) ;
24 Depends install_include : [ DoInstall $(<:G=installheader) : $(includedir) $(2) ] ;
27 ## InstallShellScript scriptname [ : subdir ]
28 ## Installs a shell script into the bindir directory. A subdirectory
29 ## relative to the bindir can be specified.
30 rule InstallShellScript
32 SEARCH on $(<:G=installscript) = $(SUBDIR) ;
33 Depends install_shellscript
34 : [ DoInstall $(<:G=installscript) : $(bindir) $(2) : $(INSTALL_SCRIPT) ]
38 ## InstallData files [ : subdir ]
39 ## Installs data files
42 SEARCH on $(<:G=installdata) = $(SUBDIR) ;
43 Depends install_data : [ DoInstall $(<:G=installdata) : $(appdatadir) $(2) ] ;
46 ## InstallConfig files [ : subdir ]
47 ## Installs configuration files
50 SEARCH on $(<:G=installconfig) = $(SUBDIR) ;
51 Depends install_config : [ DoInstall $(<:G=installconfig) : $(appconfdir) $(2) ] ;
54 ## InstallDoc files [ : subdir ]
55 ## Installs documentation files
58 SEARCH on $(<:G=installdoc) = $(SUBDIR) ;
59 Depends install_doc : [ DoInstall $(<:G=installdoc) : $(appdocdir) $(2) ] ;
63 ## DoInstall man files
68 SEARCH on $(<:G=installman) = $(SUBDIR) ;
69 for i in $(<:G=installman) {
72 case .1 : dir += man1 ;
73 case .2 : dir += man2 ;
74 case .3 : dir += man3 ;
75 case .4 : dir += man4 ;
76 case .5 : dir += man5 ;
77 case .6 : dir += man6 ;
78 case .7 : dir += man7 ;
79 case .8 : dir += man8 ;
80 case .9 : dir += man9 ;
82 echo "WARNING: manfile has no *.[0-9] ending." ;
84 Depends install_man : [ DoInstall $(i) : $(dir) ] ;
88 ## DoInstall sourcename : directories [ : installapp ] [ : options ]
89 ## Creates a new installtarget for the given sources. The target(s) are
90 ## returned as function result.
93 local targets target i dir gdir ;
94 dir = [ ConcatDirs $(DESTDIR) $(2) ] ;
100 target = $(i:BSR=$(dir):G=install) ;
101 targets += $(target) ;
102 Depends $(target) : $(gdir) $(i) ;
103 Install1 $(target) : $(i) ;
106 INSTALL on $(target) = $(3) ;
108 INSTALL on $(target) = $(INSTALL_DATA) ;
112 # We want to package all files we install
113 if ! [ IsElem nopackage : $(4) ] {
121 #----------------------------------------------------------------------------
123 INSTALLTARGETS = install_bin install_plugin install_lib install_header
124 install_shellscript install_data install_config
127 Always install $(INSTALLTARGETS) ;
128 NotFile install $(INSTALLTARGETS) ;
129 Depends install : $(INSTALLTARGETS) ;
131 Help install : "Install $(PACKAGE_NAME)" ;
135 $(INSTALL) "$(>)" "$(<:D)" $(INSTALLFLAGS) ;
140 $(COPYDIRS) "$(>)" "$(<)"