github.com/hpcng/singularity@v3.1.1+incompatible/mlocal/frags/build_runtime.mk (about)

     1  # This file contains all of the rules for building the singularity runtime
     2  #   and installing the necessary config files.
     3  
     4  starter_SOURCE := $(shell $(SOURCEDIR)/makeit/gengodep $(SOURCEDIR)/cmd/starter/main.go)
     5  starter_CSOURCE := $(SOURCEDIR)/cmd/starter/c/starter.c \
     6                    $(SOURCEDIR)/cmd/starter/c/capability.c \
     7                    $(SOURCEDIR)/cmd/starter/c/message.c \
     8                    $(SOURCEDIR)/cmd/starter/c/setns.c
     9  
    10  $(BUILDDIR)/.clean-starter: $(starter_CSOURCE)
    11  	@echo " GO clean -cache"
    12  	$(V)(go clean -cache 2>/dev/null || true)
    13  	$(V)touch $@
    14  
    15  
    16  # starter
    17  starter := $(BUILDDIR)/cmd/starter/c/starter
    18  $(starter): $(BUILDDIR)/.clean-starter $(singularity_build_config) $(starter_SOURCE)
    19  	@echo " GO" $@
    20  	$(V)go build $(GO_BUILDMODE) -tags "$(GO_TAGS)" $(GO_LDFLAGS) -o $@ \
    21  		$(SOURCEDIR)/cmd/starter/main.go
    22  
    23  starter_INSTALL := $(DESTDIR)$(LIBEXECDIR)/singularity/bin/starter
    24  $(starter_INSTALL): $(starter)
    25  	@echo " INSTALL" $@
    26  	$(V)install -d $(@D)
    27  	$(V)install -m 0755 $(starter) $@
    28  
    29  CLEANFILES += $(starter)
    30  INSTALLFILES += $(starter_INSTALL)
    31  ALL += $(starter)
    32  
    33  
    34  # sessiondir
    35  sessiondir_INSTALL := $(DESTDIR)$(LOCALSTATEDIR)/singularity/mnt/session
    36  $(sessiondir_INSTALL):
    37  	@echo " INSTALL" $@
    38  	$(V)install -d $@
    39  
    40  INSTALLFILES += $(sessiondir_INSTALL)
    41  
    42  
    43  # run-singularity script
    44  run_singularity := $(SOURCEDIR)/scripts/run-singularity
    45  
    46  run_singularity_INSTALL := $(DESTDIR)$(BINDIR)/run-singularity
    47  $(run_singularity_INSTALL): $(run_singularity)
    48  	@echo " INSTALL" $@
    49  	$(V)install -d $(@D)
    50  	$(V)install -m 0755 $< $@
    51  
    52  INSTALLFILES += $(run_singularity_INSTALL)
    53  
    54  
    55  # capability config file
    56  capability_config_INSTALL := $(DESTDIR)$(SYSCONFDIR)/singularity/capability.json
    57  $(capability_config_INSTALL):
    58  	@echo " INSTALL" $@
    59  	$(V)install -d $(@D)
    60  	$(V)touch $@
    61  
    62  INSTALLFILES += $(capability_config_INSTALL)
    63  
    64  
    65  # syecl config file
    66  syecl_config := $(SOURCEDIR)/internal/pkg/syecl/syecl.toml.example
    67  
    68  syecl_config_INSTALL := $(DESTDIR)$(SYSCONFDIR)/singularity/ecl.toml
    69  $(syecl_config_INSTALL): $(syecl_config)
    70  	@echo " INSTALL" $@
    71  	$(V)install -d $(@D)
    72  	$(V)install -m 0644 $< $@
    73  
    74  INSTALLFILES += $(syecl_config_INSTALL)
    75  
    76  
    77  # action scripts
    78  action_scripts := $(SOURCEDIR)/etc/actions/exec $(SOURCEDIR)/etc/actions/run $(SOURCEDIR)/etc/actions/shell \
    79  	$(SOURCEDIR)/etc/actions/start $(SOURCEDIR)/etc/actions/test
    80  
    81  action_scripts_INSTALL := $(DESTDIR)$(SYSCONFDIR)/singularity/actions
    82  $(action_scripts_INSTALL): $(action_scripts)
    83  	@echo " INSTALL" $@
    84  	$(V)install -d $@
    85  	$(V)install -m 0755 $? $@
    86  
    87  INSTALLFILES += $(action_scripts_INSTALL)
    88  
    89  
    90  # seccomp profile
    91  seccomp_profile := $(SOURCEDIR)/etc/seccomp-profiles/default.json
    92  
    93  seccomp_profile_INSTALL := $(DESTDIR)$(SYSCONFDIR)/singularity/seccomp-profiles/default.json
    94  $(seccomp_profile_INSTALL): $(seccomp_profile)
    95  	@echo " INSTALL" $@
    96  	$(V)install -d $(@D)
    97  	$(V)install -m 0644 $< $@
    98  
    99  INSTALLFILES += $(seccomp_profile_INSTALL)
   100  
   101  
   102  # nvidia liblist config file
   103  nvidia_liblist := $(SOURCEDIR)/etc/nvliblist.conf
   104  
   105  nvidia_liblist_INSTALL := $(DESTDIR)$(SYSCONFDIR)/singularity/nvliblist.conf
   106  $(nvidia_liblist_INSTALL): $(nvidia_liblist)
   107  	@echo " INSTALL" $@
   108  	$(V)install -d $(@D)
   109  	$(V)install -m 0644 $< $@
   110  
   111  INSTALLFILES += $(nvidia_liblist_INSTALL)
   112  
   113  
   114  # cgroups config file
   115  cgroups_config := $(SOURCEDIR)/internal/pkg/cgroups/example/cgroups.toml
   116  
   117  cgroups_config_INSTALL := $(DESTDIR)$(SYSCONFDIR)/singularity/cgroups/cgroups.toml
   118  $(cgroups_config_INSTALL): $(cgroups_config)
   119  	@echo " INSTALL" $@
   120  	$(V)install -d $(@D)
   121  	$(V)install -m 0644 $< $@
   122  
   123  INSTALLFILES += $(cgroups_config_INSTALL)