VirtualBox

Changeset 75 in kBuild for trunk


Ignore:
Timestamp:
May 31, 2004 8:05:15 AM (21 years ago)
Author:
bird
Message:

..

Location:
trunk/kBuild
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/config.kmk

    r72 r75  
    3030#
    3131
    32 ifdef skipme
     32ifdef rewrite_me
    3333
    3434.ifndef __KBLD_config_kMk_
  • trunk/kBuild/footer.kmk

    r74 r75  
    3535# all targets.
    3636ALL_TARGETS := $(LIBRARIES) $(PROGRAMS) $(DLLS) $(DRIVERS) $(OTHERS)
     37
     38# dependency files.
     39_DEPFILES :=
     40
     41# All kind of output files except for _OBJS and _DEPFILES.
     42# Compiling or linking definition outputting other things that $@ and any
     43# required dependency file must add those output files to this variable.
     44_OUT_FILES :=
    3745
    3846# all of a type
     
    4856endef
    4957$(foreach target, $(ALL_TARGETS), $(eval _OBJS_$(target) := ))
    50 
    51 # misc
    52 type :=
    5358
    5459
     
    362367_OBJS += $(_OBJS_$(target))
    363368_LIBS += $(lib)
     369_OUT_FILES += $(lib)
    364370endef
    365371
     
    448454_OBJS += $(_OBJS_$(target))
    449455_EXES += $(exe)
     456_OUT_FILES += $(exe)
    450457endef
    451458
     
    481488# Directories.
    482489#
    483 _DIRFILES := $(sort $(addsuffix /.dir_created,$(_DIRS)) $(addsuffix .dir_created,$(dir $(_OBJS) $(_LIBS) $(_EXES) $(_DLLS))))
     490_OUTPUT_FILES := $(_OBJS) $(_LIBS) $(_EXES) $(_DLLS)
     491_DIRFILES := $(sort $(addsuffix /.dir_created,$(_DIRS)) $(addsuffix .dir_created,$(dir $(_OUTPUT_FILES))))
    484492
    485493define def_createdir
     
    492500$(foreach dirfile,$(_DIRFILES),$(eval $(def_createdir)))
    493501
     502               
     503#
     504# Include dependency files.
     505#
     506$(foreach dep,$(wildcard $(_DEPFILES)),$(eval include $(dep)))
     507
     508               
     509#
     510# PASSES (including directory and makefile walking)
     511#
     512# Do all the default passes if it's unspecified.
     513PASSES ?= needed libraries binaries others publish
     514
     515## Proritized list of the default makefile when walking subdirectories.
     516# The user can overload this list.
     517DEFAULT_MAKEFILE ?= Makefile.kmk makefile.kmk Makefile makefile
     518
     519## Subdir
     520# @param        $(pass)         Lowercase pass name.
     521# @param        $(PASS)         Uppercase pass name.
     522# @param        $(subdir)       Subdirectory
     523# @param        $(tag)          tag to attach to the rule name.
     524define def_pass_subdir
     525pass_$(pass)$(tag)::
     526        $(QUIET)$$(MAKE) -C $(subdir) -f $$(notdir $$(firstword $$(wildcard $$(addprefix $(subdir)/,$$(DEFAULT_MAKEFILE))))) pass_$(pass)
     527endef
     528
     529## Submakefile
     530# @param        $(pass)         Lowercase pass name.
     531# @param        $(PASS)         Uppercase pass name.
     532# @param        $(makefile) Makefile.
     533# @param        $(tag)          tag to attach to the rule name.
     534define def_pass_makefile
     535pass_$(pass)$(tag)::
     536        $(QUIET)$$(MAKE) -C $(patsubst %/,%,$(dir $(makefile))) -f $(notdir $(makefile)) pass_$(pass)
     537endef
     538
     539
     540## Execute a pass.
     541# @param        $(pass)         Lowercase pass name.
     542# @param        $(PASS)         Uppercase pass name.
     543define def_pass
     544$(eval SUBDIRS_$(PASS)          ?= $(SUBDIRS))
     545$(eval SUBDIRS_AFTER_$(PASS)    ?= $(SUBDIRS_AFTER))
     546$(eval MAKEFILES_BEFORE_$(PASS) ?= $(MAKEFILES_BEFORE))
     547$(eval MAKEFILES_AFTER_$(PASS)  ?= $(MAKEFILES_AFTER))
     548
     549$(eval tag:=_before)
     550$(foreach subdir,$(SUBDIRS_$(PASS)),$(eval $(def_pass_subdir)))
     551$(foreach makefile,$(MAKEFILES_BEFORE_$(PASS)),$(eval $(def_pass_makefile)))
     552
     553$(eval tag:=_after)
     554$(foreach subdir,$(SUBDIRS_AFTER_$(PASS)),$(eval $(def_pass_subdir)))
     555$(foreach makefile,$(MAKEFILES_AFTER_$(PASS)),$(eval $(def_pass_makefile)))
     556
     557.NOTPARALLEL: pass_$(pass)_before pass_$(pass)_after
     558.PHONY: pass_$(pass) pass_$(pass)_before pass_$(pass)_doit pass_$(pass)_after
     559pass_$(pass): \
     560        pass_$(pass)_before \
     561        pass_$(pass)_doit \
     562        pass_$(pass)_after
     563       
     564endef   
     565
     566
     567## PASS: needed
     568# This pass builds targets which are required for building the rest.
     569pass_needed_doit: $(_NEEDEDS)
     570pass := needed
     571PASS := NEEDED
     572$(eval $(def_pass))
     573
     574## PASS: libraries
     575# This pass builds library targets.
     576pass_libraries_doit: $(_LIBS) $(_IMPORT_LIBS) $(_OTHER_LIBRARIES)
     577pass := libraries
     578PASS := LIBRARIES
     579$(eval $(def_pass))
     580
     581## PASS: binaries
     582# This pass builds binary targets, i.e. programs, dlls, drivers and stuff.
     583pass_binaries_doit: $(_DLLS) $(_EXES) $(_KMODS) $(_OTHER_BINARIES)
     584pass := binaries
     585PASS := BINARIES
     586$(eval $(def_pass))
     587
     588## PASS: others
     589# This pass builds binary targets, i.e. programs, dlls, drivers and stuff.
     590pass_others_doit: $(_OTHERS)
     591pass := others
     592PASS := OTHERS
     593$(eval $(def_pass))
     594
     595## PASS: publish
     596# This pass installs the built entities to a sandbox area.
     597pass_publish_doit: publish
     598publish::
     599pass := publish
     600PASS := PUBLISH
     601SUBDIRS_PUBLISH         ?= $(sort $(SUBDIRS) $(SUBDIRS_LIBRARIES) $(SUBDIRS_BINARIES) $(SUBDIRS_OTHERS))
     602SUBDIRS_AFTER_PUBLISH   ?= $(sort $(SUBDIRS_AFTER) $(SUBDIRS_AFTER_LIBRARIES) $(SUBDIRS_AFTER_BINARIES) $(SUBDIRS_AFTER_OTHERS))
     603MAKEFILES_BEFORE_PUBLISH?= $(sort $(MAKEFILES_BEFORE) $(MAKEFILES_BEFORE_LIBRARIES) $(MAKEFILES_BEFORE_BINARIES) $(MAKEFILES_BEFORE_OTHERS))
     604MAKEFILES_AFTER_PUBLISH ?= $(sort $(MAKEFILES_AFTER) $(MAKEFILES_AFTER_LIBRARIES) $(MAKEFILES_AFTER_BINARIES) $(MAKEFILES_AFTER_OTHERS))
     605$(eval $(def_pass))
     606
     607## PASS: packing
     608# This pass processes custom packing rules.
     609pass_packing_doit: packing
     610packing::
     611pass := packing
     612PASS := PACKING
     613$(eval $(def_pass))
     614
     615## PASS: clean
     616# This pass removes all generated files.
     617pass_clean_doit:
     618        $(RM) -f $(_OUT_FILES) $(_OBJS) $(_DEPFILES) $(_DIRFILES)
     619pass := clean
     620PASS := CLEAN
     621$(eval $(def_pass))
     622clean: pass_clean
     623               
     624## PASS: nothing
     625# This pass just walks the tree.
     626pass_nothing_doit:
     627        $(call MSG_L1,Did nothing in $(CURDIR))
     628pass := nothing
     629PASS := NOTHING
     630$(eval $(def_pass))
     631nothing: pass_nothing
     632
     633               
     634                       
    494635#
    495636# THE MAIN RULES
    496637#
    497 all_recursive:
    498 
    499 
    500 objects: $(_OBJS)
    501         echo "dbg: _OBJS = $(_OBJS)"
    502 
    503 libraries: $(_LIBS)
    504         echo "dbg: _LIBS = $(_LIBS)"
    505 
    506 programs: $(_EXES)
    507         echo "dbg: _EXES = $(_EXES)"
     638all_recursive: $(foreach pass,$(PASSES),pass_$(pass))
     639
     640# misc shortcuts.
     641target:    needed libraries binaries others
     642objects:   $(_OBJS)
     643programs:  $(_EXES)
     644dlls:      $(_DLLS)     
     645kernelmodules: $(_KMODS)
    508646
    509647
  • trunk/kBuild/header.kmk

    r73 r75  
    244244#
    245245# Message macros.
    246 #                                       
     246#                       
     247       
    247248ifndef BUILD_QUIET
     249ifdef BUILD_DEBUG
     250BUILD_VERBOSE := 9
     251endif
    248252MSG_L1          = @echo "kBuild: $1"
    249253ifdef BUILD_VERBOSE
    250254MSG_L2          = @echo "kBuild: $1"
    251 else
     255QUIET           :=
     256else
     257QUIET           := @
    252258MSG_L2          =
    253259endif
     
    258264endif
    259265else
     266QUIET           :=
    260267MSG_L1          =
    261268MSG_L2      =
  • trunk/kBuild/tools/GCC.kmk

    r74 r75  
    7878        $(TOOL_GCC_CC) -c\
    7979                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    80                 -Wp,-MT,$(dep) -Wp,-MD,$$@\
     80                -Wp,-MD,$(dep) -Wp,-MT,$$@ \
    8181                -o $$@\
    8282                $(PATH_CURRENT)/$(source)               
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