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) ] ;
17 applicationsdir ?= [ ConcatDirs $(datadir) applications ] ;
18 pixmapsdir ?= [ ConcatDirs $(datadir) pixmaps ] ;
20 ## InstallHeader headername [ : subdir ]
21 ## DoInstall a headerfile into the includedir directory. A subdirectory
22 ## relative to the includedir can be specified.
25 SEARCH on $(<:G=installheader) = $(SUBDIR) ;
26 Depends install_include : [ DoInstall $(<:G=installheader) : $(includedir) $(2) ] ;
29 ## InstallShellScript scriptname [ : subdir ]
30 ## Installs a shell script into the bindir directory. A subdirectory
31 ## relative to the bindir can be specified.
32 rule InstallShellScript
34 SEARCH on $(<:G=installscript) = $(SUBDIR) ;
35 Depends install_shellscript
36 : [ DoInstall $(<:G=installscript) : $(bindir) $(2) : $(INSTALL_SCRIPT) ]
40 ## InstallData files [ : subdir ]
41 ## Installs data files
44 SEARCH on $(<:G=installdata) = $(SUBDIR) ;
45 Depends install_data : [ DoInstall $(<:G=installdata) : $(appdatadir) $(2) ] ;
48 ## InstallConfig files [ : subdir ]
49 ## Installs configuration files
52 SEARCH on $(<:G=installconfig) = $(SUBDIR) ;
53 Depends install_config : [ DoInstall $(<:G=installconfig) : $(appconfdir) $(2) ] ;
56 ## InstallDoc files [ : subdir ]
57 ## Installs documentation files
60 SEARCH on $(<:G=installdoc) = $(SUBDIR) ;
61 Depends install_doc : [ DoInstall $(<:G=installdoc) : $(appdocdir) $(2) ] ;
65 ## DoInstall man files
70 SEARCH on $(<:G=installman) = $(SUBDIR) ;
71 for i in $(<:G=installman) {
74 case .1 : dir += man1 ;
75 case .2 : dir += man2 ;
76 case .3 : dir += man3 ;
77 case .4 : dir += man4 ;
78 case .5 : dir += man5 ;
79 case .6 : dir += man6 ;
80 case .7 : dir += man7 ;
81 case .8 : dir += man8 ;
82 case .9 : dir += man9 ;
84 echo "WARNING: manfile has no *.[0-9] ending." ;
86 Depends install_man : [ DoInstall $(i) : $(dir) ] ;
90 ## InstallPixmap files [ : subdir ]
94 LOCATE on $(<:G=installpixmap) = $(SUBDIR) ;
96 : [ DoInstall $(<:G=installpixmap) : $(pixmapsdir) $(2) ] ;
99 ## InstallDesktop files [ : subdir ]
100 ## Install a .desktop file (menu entries for kde/gnome and others)
103 LOCATE on $(<:G=installdesktop) = $(SUBDIR) ;
105 : [ DoInstall $(<:G=installdesktop) : $(applicationsdir) $(2) ] ;
108 ## DoInstall sourcename : directories [ : installapp ] [ : options ]
109 ## Creates a new installtarget for the given sources. The target(s) are
110 ## returned as function result.
113 local targets target i dir gdir ;
114 dir = [ ConcatDirs $(DESTDIR) $(2) ] ;
116 gdir = $(dir:G=dir) ;
120 target = $(i:BSR=$(dir):G=install) ;
121 targets += $(target) ;
122 Depends $(target) : $(gdir) $(i) ;
123 Install1 $(target) : $(i) ;
126 INSTALL on $(target) = $(3) ;
128 INSTALL on $(target) = $(INSTALL_DATA) ;
132 # We want to package all files we install
133 if ! [ IsElem nopackage : $(4) ] {
141 #----------------------------------------------------------------------------
143 INSTALLTARGETS = install_bin install_plugin install_lib install_header
144 install_shellscript install_data install_config
147 Always install $(INSTALLTARGETS) ;
148 NotFile install $(INSTALLTARGETS) ;
149 Depends install : $(INSTALLTARGETS) ;
151 Help install : "Install $(PACKAGE_NAME)" ;
155 $(INSTALL) "$(>)" "$(<:D)" $(INSTALLIBS) ;
160 $(COPYDIRS) "$(>)" "$(<)"