Ignore:
Timestamp:
Dec 12, 2005, 4:36:07 AM (20 years ago)
Author:
bird
Message:

Use fixed lot's of those $$$$(PATH_<target>) thingies. Better target install, install pass and install target type. Generic passes. And more.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/header.kmk

    r329 r353  
    44# kBuild - File included at top of makefile.
    55#
    6 # Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>
     6# Copyright (c) 2004-2005 knut st. osmundsen <bird-srcspam@anduin.net>
    77#
    88#
     
    119119
    120120# Fill in defaults if needed.
    121 ifndef BUILD_PLATFORM_ARCH 
     121ifndef BUILD_PLATFORM_ARCH
    122122BUILD_PLATFORM_ARCH   := x86
    123123endif
     
    234234PATH_OUT            := $(PATH_OUT_BASE)/$(BUILD_TARGET)/$(BUILD_TARGET_ARCH)/$(BUILD_TYPE)
    235235endif
    236 endif # !x86 
     236endif # !x86
    237237endif # !define PATH_OUT
    238 PATH_OBJ            := $(PATH_OUT)/obj
    239 PATH_TARGET         := $(PATH_OBJ)/$(CURSUBDIR)
    240 ifndef KBUILD_NEW_STUFF
    241 PATH_BIN            := $(PATH_OUT)/bin
    242 PATH_LIB            := $(PATH_OUT)/lib
    243 PATH_DOC            := $(PATH_ROOT)/out/doc
    244 else
    245 PATH_INS            := $(PATH_OUT)
    246 PATH_BIN            := $(PATH_INS)/bin
    247 PATH_DLL            := $(PATH_INS)/bin
    248 PATH_LIB            := $(PATH_INS)/lib
    249 PATH_DOC            := $(PATH_INS)/doc
    250 endif
     238PATH_OBJ             = $(PATH_OUT)/obj
     239PATH_TARGET          = $(PATH_OBJ)/$(CURSUBDIR)
     240PATH_INS             = $(PATH_OUT)
     241PATH_BIN             = $(PATH_INS)/bin
     242PATH_DLL             = $(PATH_INS)/bin
     243PATH_SYS             = $(PATH_INS)/bin
     244PATH_LIB             = $(PATH_INS)/lib
     245PATH_DOC             = $(PATH_INS)/doc
    251246
    252247# Usually kBuild is external to the source tree.
     
    348343endif
    349344
    350 # Standard Unix shell utils.
     345# Standard Unix shell utils
    351346ifdef KMK_BUILTIN
    352347ECHO                := kmk_builtin_echo
     
    359354RM                  := $(PATH_TOOLS)/rm$(HOSTSUFF_EXE)
    360355CP                  := $(PATH_TOOLS)/cp$(HOSTSUFF_EXE)
     356APPEND              := $(PATH_TOOLS)/append$(HOSTSUFF_EXE)
    361357endif
    362358CP_EXT              := $(PATH_TOOLS)/cp$(HOSTSUFF_EXE)
     
    364360SED                 := $(PATH_TOOLS)/sed$(HOSTSUFF_EXE)
    365361CAT                 := $(PATH_TOOLS)/cat$(HOSTSUFF_EXE)
     362LN_SYMLINK          := $(CP)
     363#LN_SYMLINK          := ln -s
    366364# Bourn shell clone.
    367365MAKESHELL           := $(PATH_TOOLS)/ash$(HOSTSUFF_EXE)
     
    369367export SHELL MAKESHELL
    370368
     369# kBuild utils.
     370ifeq ($(filter append,$(KMK_BUILTIN)),append)
     371APPEND              := kmk_builtin_append
     372else
     373APPEND              := $(PATH_TOOLS)/append$(HOSTSUFF_EXE)
     374endif
     375
    371376
    372377#
     
    410415                      $(path))))
    411416endif
    412                                          
     417
    413418## DIRDEP - make create directory dependencies.
    414419#
    415420# @param        $1      The paths to the directories which must be created.
    416 DIRDEP = $(foreach path,$(1),$(path)/.dir_created)
     421ifeq ($(BUILD_PLATFORM),win32)
     422DIRDEP = $(patsubst %/,%,$(1))
     423else
     424DIRDEP = $(foreach path,$(patsubst %/,%,$(1)),$(path)/)
     425endif
    417426
    418427
     
    428437CYGPATHMIXED = $(1)
    429438endif
     439
     440#
     441# Initialize some of the globals which the Config.kmk and
     442# others can add stuff to if they like for processing in the footer.
     443#
     444
     445## ALL_TARGET
     446# This is the list of all targets.
     447ALL_TARGETS :=
     448
     449## TEMPLATE_PATHS
     450# List a paths (separated by space) where templates can be found.
     451TEMPLATE_PATHS :=
     452
     453## TOOL_PATHS
     454# List of paths (separated by space) where tools can be found.
     455TOOL_PATHS :=
     456
     457## SDK_PATHS
     458# List of paths (separated by space) where SDKs can be found.
     459SDK_PATHS :=
     460
     461## Proritized list of the default makefile when walking subdirectories.
     462# The user can overload this list.
     463DEFAULT_MAKEFILE := Makefile.kmk makefile.kmk Makefile makefile
     464
     465## PROPS_SINGLE
     466# The list of non-accumulative target properties.
     467# A Config.kmk file can add it's own properties to this list and kBuild
     468# will do the necessary inheritance from templates to targets.
     469PROPS_SINGLE := TOOL ARTOOL CTOOL CXXTOOL ASTOOL LDTOOL INST NOINST
     470
     471## PROPS_DEFERRED
     472# This list of non-accumulative target properties which are functions,
     473# and thus should not be expanded until the very last moment.
     474PROPS_DEFERRED := INSTFUN INSTALLER
     475
     476## PROPS_ACCUMULATE
     477# The list of accumulative target properties.
     478# A Config.kmk file can add it's own properties to this list and kBuild
     479# will do the necessary inheritance from templates to targets.
     480PROPS_ACCUMULATE := \
     481        SDKS DEFS INCS SOURCES \
     482        COPTS CFLAGS CDEFS CINCS CXXOPTS CXXFLAGS CXXDEFS CXXINCS \
     483        ASOPTS ASFLAGS ASDEFS ASINCS \
     484        LDFLAGS LIBS LIBPATH \
     485        BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU \
     486        SYSSUFF EXESUFF DLLSUFF LIBSUFF ARLIBSUFF \
     487
     488
     489## PROPS_TOOLS
     490# This is a subset of the other PROPS
     491PROPS_TOOLS := TOOL CTOOL CXXTOOL ASTOOL ARTOOL LDTOOL
     492
     493
     494#
     495# Pass configuration.
     496#
     497# The PASS_<passname>_trgs variable is listing the targets.
     498# The PASS_<passname>_vars variable is listing the target variables.
     499# The PASS_<passname>_pass variable is the lowercased passname.
     500#
     501
     502## PASS: bldprogs
     503# This pass builds targets which are required for building the rest.
     504PASS_BLDPROGS       := Build Programs
     505PASS_BLDPROGS_trgs  :=
     506PASS_BLDPROGS_vars  := _BLDPROGS
     507PASS_BLDPROGS_pass  := bldprogs
     508
     509## PASS: libraries
     510# This pass builds library targets.
     511PASS_LIBRARIES      := Libraries
     512PASS_LIBRARIES_trgs :=
     513PASS_LIBRARIES_vars := _LIBS _IMPORT_LIBS _OTHER_LIBRARIES
     514PASS_LIBRARIES_pass := libraries
     515
     516## PASS: binaries
     517# This pass builds dll targets.
     518PASS_DLLS           := DLLs
     519PASS_DLLS_trgs      :=
     520PASS_DLLS_vars      := _DLLS _OTHER_DLLS
     521PASS_DLLS_pass      := dlls
     522
     523## PASS: binaries
     524# This pass builds binary targets, i.e. programs, system modules and stuff.
     525PASS_BINARIES       := Programs
     526PASS_BINARIES_trgs  :=
     527PASS_BINARIES_vars  := _PROGRAMS _SYSMODS _OTHER_BINARIES
     528PASS_BINARIES_pass  := binaries
     529
     530## PASS: others
     531# This pass builds other targets.
     532PASS_OTHERS         := Other Stuff
     533PASS_OTHERS_trgs    :=
     534PASS_OTHERS_vars    := _OTHERS
     535PASS_OTHERS_pass    := others
     536
     537## PASS: install
     538# This pass installs the built entities to a sandbox area.
     539PASS_INSTALLS       := Install
     540PASS_INSTALLS_trgs  :=
     541PASS_INSTALLS_vars  := _INSTALLS
     542PASS_INSTALLS_pass  := installs
     543
     544## PASS: packing
     545# This pass processes custom packing rules.
     546PASS_PACKING        := Packing
     547PASS_PACKING_trgs   := packing
     548PASS_PACKING_vars   :=
     549PASS_PACKING_pass   := packing
     550
     551## PASS: clean
     552# This pass removes all generated files.
     553PASS_CLEAN          := Clean
     554PASS_CLEAN_trgs     := do-clean
     555PASS_CLEAN_vars     :=
     556PASS_CLEAN_pass     := clean
     557# alias
     558clean: pass_clean
     559
     560## PASS: nothing
     561# This pass just walks the tree.
     562PASS_NOTHING        := Nothing
     563PASS_NOTHING_trgs   := do-nothing
     564PASS_NOTHING_vars   :=
     565PASS_NOTHING_pass   := nothing
     566# alias
     567nothing: pass_nothing
     568
     569## DEFAULT_PASSES
     570# The default passes and their order.
     571DEFAULT_PASSES := BLDPROGS LIBRARIES DLLS BINARIES OTHERS INSTALLS
     572
     573## PASSES
     574# The passes that should be defined. This must include
     575# all passes mentioned by DEFAULT_PASSES.
     576PASSES := $(DEFAULT_PASSES) NOTHING CLEAN
     577
    430578
    431579#
Note: See TracChangeset for help on using the changeset viewer.