Skip to content
Snippets Groups Projects
Select Git revision
  • master
  • ws18
  • ss18
  • ws17
  • ss17
  • readme
  • offline_repo_integration
  • bash_sucks
  • ws15-final
  • ss15-final
  • ws14-final
  • ws14
12 results

Makefile

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Makefile 32.43 KiB
    #This file is part of lipck - the "linux install party customization kit".
    #
    # Copyright (C) 2014 trilader, Anwarias, Christopher Spinrath
    #
    # lipck is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    #
    # lipck is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with lipck.  If not, see <http://www.gnu.org/licenses/>.
    
    $(info lipck Copyright (C) 2014 trilader, Anwarias, Christopher Spinrath)
    $(info This program comes with ABSOLUTELY NO WARRANTY;)
    $(info This is free software, and you are welcome to redistribute it)
    $(info under certain conditions; cf. the COPYING file for details.)
    $(info )
    
    CONFIG_FILE_DEFAULTS=$(CURDIR)/config/Makefile.conf.defaults
    CONFIG_FILE=$(CURDIR)/config/Makefile.conf
    
    include $(CONFIG_FILE_DEFAULTS)
    include $(CONFIG_FILE)
    
    #read all offically config options from CONFIG_FILE_DEFAULTS
    CONFIGURABLE=$(shell cat "$(CONFIG_FILE_DEFAULTS)" | grep -v "^\#" | cut -s -d"=" -f1)
    
    ifndef ARCH
      ARCH=$(PRIMARY_ARCH)
    endif
    
    #some tools and targets need alternative architecture names,
    #so lets infer them
    define altarch =
    $(if $(subst x86_64,,$1),$(if $(subst i686,,$1),$1,i386),amd64)
    endef
    
    #inverse function of altarch; required by targets containing
    #the altarch string to depend on architecture specific stuff
    #Since all unknown names are mapped to itself this function
    #may be used to convert any name to the normal architecture name.
    define to_arch =
    $(if $(subst amd64,,$1),$(if $(subst i386,,$1),$1,i686),x86_64)
    endef
    
    #Some targets require the image partition to be mounted.
    #Although, it is easy to detect this (and mount the partition)
    #by depending on the phony target image_mount_if, make is unable
    #to calculate the dependencies correctly. The reason is that some
    #dependencies are located on the partition (which is not mounted
    #when scanning for dependencies). Hence, make will rebuild all
    #targets (after it mounted the partition) regardless of the state
    #of these files.
    #
    #To solve this issue we call ensure_mount on phony targets invoked
    #by the user. The actual target will serve as a wrapper which
    #mounts the partition and then invokes the actual target renamed
    #to <name>__ignore_mount. Note that both targets will be marked
    #as phony, since the renaming makes no sense for files (and most
    #probably this is a file on the partition anyway...) and the user
    #will invoke a phony target anyway.
    #
    #tl;dr every target that requires the image partition to be mounted
    #should be encapsulated in $(call ensure_mount,<target_name>).
    #