Ignore:
Timestamp:
Dec 15, 2006, 6:18:47 AM (19 years ago)
Author:
bird
Message:

Partial implementation of a _PATH target property for resolving relative paths. It's primarily intended for sub-makefile mode where we apply it to all targets automatically. TODOs: INCS, DEPs (source level) and SUBDIRS*.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/subfooter.kmk

    r665 r725  
    2525#
    2626
    27 _SUB_MAKEFILE_STACK := $(filter-out $(words $(_SUB_MAKEFILE_STACK)), $(_SUB_MAKEFILE_STACK))
    28 ifeq ($(words $(_SUB_MAKEFILE_STACK)),0)
    29 include $(PATH_KBUILD)/footer.kmk
     27
     28#
     29# Set the default path for all new targets.
     30#
     31define def_subheader
     32ifndef $(target)_PATH
     33$(target)_PATH := $(PATH_SUB_CURRENT)
     34endif
     35ifndef $(target)_MAKEFILE
     36$(target)_MAKEFILE := $(MAKEFILE_CURRENT)
     37endif
     38endef
     39
     40$(foreach target,\
     41        $(ALL_TARGETS) \
     42        $(FETCHES)     $(FETCHES.$(BUILD_TARGET))       $(FETCHES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
     43        $(PATCHES)     $(PATCHES.$(BUILD_TARGET))       $(PATCHES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
     44        $(BLDPROGS)    $(BLDPROGS.$(BUILD_PLATFORM))    $(BLDPROGS.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)) \
     45        $(LIBRARIES)   $(LIBRARIES.$(BUILD_TARGET))     $(LIBRARIES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
     46        $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET))   $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
     47        $(DLLS)        $(DLLS.$(BUILD_TARGET))          $(DLLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
     48        $(PROGRAMS)    $(PROGRAMS.$(BUILD_TARGET))      $(PROGRAMS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
     49        $(SYSMODS)     $(SYSMODS.$(BUILD_TARGET))       $(SYSMODS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
     50        $(INSTALLS)    $(INSTALLS.$(BUILD_TARGET))      $(INSTALLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
     51        $(OTHERS)      $(OTHERS.$(BUILD_TARGET))        $(OTHERS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
     52,$(eval $(def_subheader)))
     53
     54
     55#
     56# Switch back to the context of previous makefile on the stack.
     57#
     58MAKEFILE_CURRENT := $(call stack-pop,_SUB_MAKEFILE_STACK)
     59PATH_SUB_CURRENT := $(abspath $(patsubst %/,%,$(dir $(MAKEFILE_CURRENT))))
     60
     61#
     62# When we reach the last makefile we include the footer.
     63#
     64ifeq ($(_SUB_MAKEFILE_STACK),)
     65 include $(PATH_KBUILD)/footer.kmk
    3066endif
    3167
Note: See TracChangeset for help on using the changeset viewer.