VirtualBox

Changeset 2226 in kBuild


Ignore:
Timestamp:
Jan 8, 2009 10:31:25 PM (16 years ago)
Author:
bird
Message:

Config.kmk,Makefile.kmk: Split up data and docs in share/; made the NIX_INSTALL_DIR stuff more flexible.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r2202 r2226  
    9292
    9393#
     94# Where to fine the GNU Make stuff (for FreeBSD and Windows).
     95#
     96PATH_GNUMAKE_SRC ?= $(PATH_ROOT)/src/kmk
     97
     98
     99#
    94100# The OS and Architecture indicators.
    95101#
     
    110116# Check if we're building a *nix installation.
    111117#
     118# There are a few optional overrides here for customizing the install location
     119# and how it is installed:
     120#       MY_INST_BIN        - the bin/ directory (the trailing slash is mandatory).
     121#       MY_INST_DATA       - the share/kBuild/ directory (the trailing slash is mandatory).
     122#       MY_INST_DOC        - the share/doc/kBuild-x.y.z/ directory (the trailing slash is mandatory).
     123#       MY_INST_UID        - the default install UID or user name.
     124#       MY_INST_GID        - the default install GID or group name.
     125#       MY_INST_MODE       - the default install mode mask, ",a+x" is added for executables and files.
     126#       MY_INST_DATA_UID   - data specialization.
     127#       MY_INST_DATA_GID   - data specialization.
     128#       MY_INST_DATA_MODE  - data specialization.
     129#       MY_INST_DOC_UID    - doc specialization.
     130#       MY_INST_DOC_GID    - doc specialization.
     131#       MY_INST_DOC_MODE   - doc specialization.
     132#       MY_INST_BIN_UID    - binary (executable) specialization.
     133#       MY_INST_BIN_GID    - binary (executable) specialization.
     134#       MY_INST_BIN_MODE   - binary (executable) specialization.
     135#
     136# When running kmk install, you can use PATH_INS like you use DESTDIR in other makefile
     137# systems. (These things will be improved in 0.2.x btw, so will be possible to enable a
     138# mode where PREFIX and DESTDIR will.)
     139#
     140#
    112141ifdef NIX_INSTALL_DIR
    113 NIX_INSTALL_DIR_BIN   := $(patsubst /%,%,$(NIX_INSTALL_DIR))/bin
    114 NIX_INSTALL_DIR_SHARE := $(patsubst /%,%,$(NIX_INSTALL_DIR))/share/kBuild
     142 MY_INST_ROOT := $(patsubst /%,%,$(NIX_INSTALL_DIR))/
     143 ifndef MY_INST_BIN
     144  MY_INST_BIN := $(MY_INST_ROOT)bin/
     145 endif
     146 ifndef MY_INST_DATA
     147  MY_INST_DATA := $(MY_INST_ROOT)share/kBuild/
     148 endif
     149 ifndef MY_INST_DOC
     150  MY_INST_DOC := $(MY_INST_ROOT)share/doc/kBuild-$(KBUILD_VERSION)/
     151 endif
     152 if !defined(MY_INST_BIN_MODE) && defined(MY_INST_MODE)
     153  MY_INST_BIN_MODE := $(MY_INST_MODE),a+x
     154 endif
     155
    115156DEFS += \
    116         KBUILD_PATH=\"/$(NIX_INSTALL_DIR_SHARE)\" \
    117         KBUILD_BIN_PATH=\"/$(NIX_INSTALL_DIR_BIN)\"
    118 endif
    119 
    120 #
    121 # Where to fine the GNU Make stuff (for FreeBSD and Windows).
    122 #
    123 PATH_GNUMAKE_SRC               ?= $(PATH_ROOT)/src/kmk
     157        KBUILD_PATH=\"/$(patsubst %/,%,$(MY_INST_DATA))\" \
     158        KBUILD_BIN_PATH=\"/$(patsubst %/,%,$(MY_INST_BIN))\"
     159endif
     160
     161
     162#
     163# Templates for installing docs and make scripts.
     164#
     165TEMPLATE_DATA = Data installation template.
     166TEMPLATE_DATA_INST   = $(MY_INST_DATA)
     167TEMPLATE_DATA_MODE  ?= $(firstword $(MY_INST_DATA_MODE) $(MY_INST_MODE) a+r)
     168TEMPLATE_DATA_UID   ?= $(firstword $(MY_INST_DATA_UID)  $(MY_INST_UID))
     169TEMPLATE_DATA_GID   ?= $(firstword $(MY_INST_DATA_GID)  $(MY_INST_GID))
     170
     171TEMPLATE_DOC  = Documentation installation template.
     172TEMPLATE_DOC_INST   = $(MY_INST_DOC)
     173TEMPLATE_DOC_MODE   ?= $(firstword $(MY_INST_DOC_MODE) $(MY_INST_MODE) a+r)
     174TEMPLATE_DOC_UID    ?= $(firstword $(MY_INST_DOC_UID)  $(MY_INST_UID))
     175TEMPLATE_DOC_GID    ?= $(firstword $(MY_INST_DOC_GID)  $(MY_INST_GID))
    124176
    125177
     
    133185TEMPLATE_BIN_DEFS.release       = NDEBUG
    134186if defined(NIX_INSTALL_DIR) && !defined(KBUILD_BOOTSTRAP)
    135  TEMPLATE_BIN_INST             = $(NIX_INSTALL_DIR_BIN)/
     187 TEMPLATE_BIN_INST             = $(MY_INST_BIN)
     188 TEMPLATE_BIN_MODE            ?= $(firstword $(MY_INST_BIN_MODE) a+rx)
     189 TEMPLATE_BIN_UID             ?= $(firstword $(MY_INST_BIN_UID) $(MY_INST_UID))
     190 TEMPLATE_BIN_GID             ?= $(firstword $(MY_INST_BIN_GID) $(MY_INST_GID))
    136191else
    137192 TEMPLATE_BIN_INST             = kBuild/bin/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
    138193endif
     194
    139195
    140196ifeq ($(KBUILD_TARGET),os2)
  • trunk/Makefile.kmk

    r2202 r2226  
    3232ifdef NIX_INSTALL_DIR
    3333#
    34 # When doing a unix install, install all the kBuild scripts.
     34# When doing a unix install, install all the kBuild scripts and docs.
     35# TODO: Make this default and make it possible to disable it for in-tree development.
    3536#
    36 INSTALLS += kBuild
    37 kBuild_INST = $(NIX_INSTALL_DIR_SHARE)
    38 kBuild_SOURCES := \
     37INSTALLS += kBuild-data
     38kBuild-data_TEMPLATE = DATA
     39kBuild-data_SOURCES := \
    3940        $(foreach src,\
    4041                $(wildcard \
     
    4344                        kBuild/sdks/*.kmk \
    4445                        kBuild/units/*.kmk \
     46                        kBuild/msgstyles/*.kmk \
     47                        kBuild/templates/*.kmk),\
     48                $(src)=>$(subst kBuild/,,$(src)))
     49
     50INSTALLS += kBuild-doc
     51kBuild-doc_TEMPLATE = DOC
     52kBuild-doc_SOURCES := \
     53        $(foreach src,\
     54                $(wildcard \
    4555                        kBuild/doc/*.txt \
    4656                        kBuild/doc/*.html \
    47                         kBuild/msgstyles/* \
    48                         kBuild/templates/*),\
    49                 $(src)=>$(subst kBuild/,,$(src)))
     57                 ),\
     58                $(src)=>$(subst kBuild/doc/,,$(src)))
    5059endif
    5160
    5261#
    5362# And install any binary only tools and dlls.
     63# TODO: Ship env.sh and envos2.cmd / envwin.cmd where applicable.
    5464#
    5565INSTALLS += kBuild_bin
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette