github.com/stackdocker/rkt@v0.10.1-0.20151109095037-1aa827478248/stage1/makelib/aci_simple_static_c_bin.mk (about)

     1  # inputs cleared after including this file:
     2  #
     3  # ASSCB_EXTRA_HEADERS - additional local C headers used
     4  #
     5  # ASSCB_FLAVORS - which flavors want this app, set to STAGE1_FLAVORS
     6  # if empty
     7  #
     8  # ASSCB_EXTRA_CFLAGS - additional cflags
     9  
    10  # There are two parts:
    11  #
    12  # 1. Building the binary - it is done only once.
    13  #
    14  # 2. Installing the binary into the ACI rootfs directory - this is
    15  # done once for each flavor.
    16  
    17  # Initial stuff
    18  
    19  # The path of this file. This file is included (or at least it should
    20  # be) with a standard include directive instead of our inc-one (or
    21  # inc-many), so the MK_PATH, MK_FILENAME and MK_SRCDIR are set to
    22  # values specific to the parent file (that is - including this one).
    23  _ASSCB_PATH_ := $(lastword $(MAKEFILE_LIST))
    24  # Name of a binary, deduced upon filename of a parent Makefile.
    25  _ASSCB_NAME_ := $(patsubst %.mk,%,$(MK_FILENAME))
    26  # Path to built binary. Not the one in the ACI rootfs.
    27  _ASSCB_BINARY_ := $(TOOLSDIR)/$(_ASSCB_NAME_)
    28  
    29  ifeq ($(ASSCB_FLAVORS),)
    30  
    31  ASSCB_FLAVORS := $(STAGE1_FLAVORS)
    32  
    33  endif
    34  
    35  # 1.
    36  
    37  # variables for build_static_c_bin.mk
    38  BSCB_BINARY := $(_ASSCB_BINARY_)
    39  BSCB_HEADERS := $(foreach h,$(ASSCB_EXTRA_HEADERS),$(MK_SRCDIR)/$h)
    40  BSCB_SOURCES := $(MK_SRCDIR)/$(_ASSCB_NAME_).c
    41  BSCB_ADDITIONAL_CFLAGS := -Wall -Os $(ASSCB_EXTRA_CFLAGS)
    42  
    43  CLEAN_FILES += $(_ASSCB_BINARY_)
    44  
    45  include makelib/build_static_c_bin.mk
    46  
    47  $(_ASSCB_BINARY_): $(_ASSCB_PATH_) $(MK_PATH) | $(TOOLSDIR)
    48  
    49  # 2.
    50  
    51  AIB_FLAVORS := $(ASSCB_FLAVORS)
    52  AIB_BINARY := $(_ASSCB_BINARY_)
    53  include stage1/makelib/aci_install_bin.mk
    54  
    55  $(call undefine-namespaces,ASSCB _ASSCB)