Changeset 472 for trunk/kBuild


Ignore:
Timestamp:
Jul 15, 2006, 6:33:50 AM (19 years ago)
Author:
bird
Message:

New feature: Sub-Makefile.

Location:
trunk/kBuild
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r460 r472  
    147147# @remark There are two major hacks here:
    148148#           1. Source files in the output directory are translated into a gen/ subdir.
    149 #               2. Catch anyone specifying $(PATH_CURRENT)/sourcefile.c.
     149#               2. Catch anyone specifying $(PATH_SUB_CURRENT)/sourcefile.c.
    150150_OBJECT_BASE = $(PATH_TARGET)/$(2)/$(call no-root-slash,$(call no-drive,$(basename \
    151         $(patsubst $(PATH_ROOT)/%,%,$(patsubst $(PATH_CURRENT)/%,%,$(patsubst $(PATH_TARGET)/$(2)/%,gen/%,$(1)))))))
     151        $(patsubst $(PATH_ROOT)/%,%,$(patsubst $(PATH_SUB_CURRENT)/%,%,$(patsubst $(PATH_TARGET)/$(2)/%,gen/%,$(1)))))))
    152152
    153153## Figure out where to put object files.
     
    457457                $($(target)_$(source)_DEPORD_)
    458458        $(call MSG_L1,Creating $$@)
    459         $(RM) -f $(dep) $(out) $($(target)_$(source)_OUTPUT_)
     459        $(RM) -f $(dep) $(obj) $($(target)_$(source)_OUTPUT_)
    460460        $(custom_pre)
    461461
  • trunk/kBuild/header.kmk

    r464 r472  
    248248#
    249249ifeq ($(filter abspath,$(KMK_FEATURES)),abspath)
     250
    250251PATH_CURRENT        := $(abspath $(CURDIR))
     252ifneq ($(strip $(SUB_DEPTH)),)
     253PATH_SUB_CURRENT    := $(abspath $(PATH_CURRENT)/$(SUB_DEPTH))
     254else
     255PATH_SUB_CURRENT    := $(PATH_CURRENT)
     256endif
    251257PATH_ROOT           := $(abspath $(PATH_CURRENT)/$(DEPTH))
    252258
     
    254260
    255261PATH_CURRENT        := $(CURDIR)
    256 # Get the real root path.
     262PATH_SUB_CURRENT    := $(PATH_CURRENT)
     263ifneq ($(strip $(SUB_DEPTH)),)
     264ifneq ($(SUB_DEPTH),.)
     265$(foreach d,$(subst /, ,$(SUB_DEPTH)), $(eval PATH_SUB_CURRENT := $(patsubst %/,%,$(dir $(PATH_SUB_CURRENT)))) )
     266endif
     267endif
    257268PATH_ROOT           := $(PATH_CURRENT)
    258269ifneq ($(DEPTH),.)
     
    261272
    262273endif
     274
    263275# Subdirectory relative to the root.
    264276ifneq ($(PATH_ROOT),$(PATH_CURRENT))
    265 CURSUBDIR           := $(patsubst $(PATH_ROOT)/%,%,$(PATH_CURRENT))
     277CURSUBDIR           := $(patsubst $(PATH_ROOT)/%,%,$(PATH_SUB_CURRENT))
    266278else
    267279CURSUBDIR           := .
Note: See TracChangeset for help on using the changeset viewer.