4 # DROPS (Dresden Realtime OPerating System) Component
6 # Makefile-Include for install-rules
8 # This file is useful only when actually building files, thus if
9 # BUILD_ONE_ARCHITECTURE (see Makeconf) is defined.
10 # INSTALL_TARGET and INSTALL_TARGET_$(ARCH) contain the targets to be
11 # installed. If they are both empty, and NOTARGETSTOINSTALL is not set,
12 # they are set to TARGET and TARGET_$(ARCH).
14 # INSTALLDIR and INSTALLDIR_LOCAL is the dir the files will be installed
15 # in and must be set prior to including this file. INSTALLDIR is used by the
16 # target "install" and "INSTALLDIR_LOCAL" by the target "all".
18 # The target "all" is made depending on the installed files in
19 # INSTALLDIR_LOCAL. "install" on the files in INSTALLDIR. An other
20 # difference is that "all" results in using the variable
21 # $(INSTALLFILE_LOCAL) to install the files and "install" in using
22 # $(INSTALLFILE). This allows the difference between linking and actually
23 # copying (with stripping for bins).
25 ifndef INSTALL_TARGET_$(OSYSTEM)
26 ifndef NOTARGETSTOINSTALL
27 INSTALL_TARGET?=$(TARGET)
30 INSTALL_TARGET += $(INSTALL_TARGET_$(OSYSTEM))
32 all:: $(addprefix $(INSTALLDIR_LOCAL)/,$(INSTALL_TARGET))
33 install:: $(addprefix $(INSTALLDIR)/,$(INSTALL_TARGET))
35 # with prog.mk, we copy
36 ifeq ($(ROLE),prog.mk)
37 $(foreach f,$(INSTALL_TARGET),$(INSTALLDIR_LOCAL)/$(f)):$(INSTALLDIR_LOCAL)/%:%
38 @$(INSTALL_LOCAL_MESSAGE)
39 $(if $(INSTALLFILE_LOCAL),$(VERBOSE)$(INSTALL) -d $(dir $@))
40 $(VERBOSE)$(call INSTALLFILE_LOCAL,$<,$@)
42 # with others, we symlink
43 # we check for each locally installed lib if the symlink is correct or if
44 # it's a shared lib since we need to always call the local install rule as
45 # we need to load shared libs to the target
46 .PHONY: $(addprefix $(INSTALLDIR_LOCAL)/,$(INSTALL_TARGET))
47 $(foreach f,$(INSTALL_TARGET),$(INSTALLDIR_LOCAL)/$(f)):$(INSTALLDIR_LOCAL)/%:%
48 @$(if $(INSTALLFILE_LOCAL), \
50 if [ ! $< -ef $@ -o "$${f%%.so}" != "$$f" ] ; then \
51 $(if $(INSTALL_LOCAL_MESSAGE),$(INSTALL_LOCAL_MESSAGE);) \
52 $(INSTALL) -d $(dir $@); \
53 $(call INSTALLFILE_LOCAL,$<,$@); \
57 $(foreach f,$(INSTALL_TARGET),$(INSTALLDIR)/$(f)):$(INSTALLDIR)/%:%
59 $(if $(INSTALLFILE),$(VERBOSE)$(INSTALL) -d $(dir $@))
60 $(VERBOSE)$(call INSTALLFILE,$<,$@)
62 # unconditionally install on "make install"
63 .PHONY: $(addprefix $(INSTALLDIR)/,$(INSTALL_TARGET))
65 .general.d: $(L4DIR)/mk/install.inc