- Timestamp:
- May 31, 2004 8:05:15 AM (21 years ago)
- Location:
- trunk/kBuild
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/config.kmk
r72 r75 30 30 # 31 31 32 ifdef skipme32 ifdef rewrite_me 33 33 34 34 .ifndef __KBLD_config_kMk_ -
trunk/kBuild/footer.kmk
r74 r75 35 35 # all targets. 36 36 ALL_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 := 37 45 38 46 # all of a type … … 48 56 endef 49 57 $(foreach target, $(ALL_TARGETS), $(eval _OBJS_$(target) := )) 50 51 # misc52 type :=53 58 54 59 … … 362 367 _OBJS += $(_OBJS_$(target)) 363 368 _LIBS += $(lib) 369 _OUT_FILES += $(lib) 364 370 endef 365 371 … … 448 454 _OBJS += $(_OBJS_$(target)) 449 455 _EXES += $(exe) 456 _OUT_FILES += $(exe) 450 457 endef 451 458 … … 481 488 # Directories. 482 489 # 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)))) 484 492 485 493 define def_createdir … … 492 500 $(foreach dirfile,$(_DIRFILES),$(eval $(def_createdir))) 493 501 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. 513 PASSES ?= needed libraries binaries others publish 514 515 ## Proritized list of the default makefile when walking subdirectories. 516 # The user can overload this list. 517 DEFAULT_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. 524 define def_pass_subdir 525 pass_$(pass)$(tag):: 526 $(QUIET)$$(MAKE) -C $(subdir) -f $$(notdir $$(firstword $$(wildcard $$(addprefix $(subdir)/,$$(DEFAULT_MAKEFILE))))) pass_$(pass) 527 endef 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. 534 define def_pass_makefile 535 pass_$(pass)$(tag):: 536 $(QUIET)$$(MAKE) -C $(patsubst %/,%,$(dir $(makefile))) -f $(notdir $(makefile)) pass_$(pass) 537 endef 538 539 540 ## Execute a pass. 541 # @param $(pass) Lowercase pass name. 542 # @param $(PASS) Uppercase pass name. 543 define 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 559 pass_$(pass): \ 560 pass_$(pass)_before \ 561 pass_$(pass)_doit \ 562 pass_$(pass)_after 563 564 endef 565 566 567 ## PASS: needed 568 # This pass builds targets which are required for building the rest. 569 pass_needed_doit: $(_NEEDEDS) 570 pass := needed 571 PASS := NEEDED 572 $(eval $(def_pass)) 573 574 ## PASS: libraries 575 # This pass builds library targets. 576 pass_libraries_doit: $(_LIBS) $(_IMPORT_LIBS) $(_OTHER_LIBRARIES) 577 pass := libraries 578 PASS := LIBRARIES 579 $(eval $(def_pass)) 580 581 ## PASS: binaries 582 # This pass builds binary targets, i.e. programs, dlls, drivers and stuff. 583 pass_binaries_doit: $(_DLLS) $(_EXES) $(_KMODS) $(_OTHER_BINARIES) 584 pass := binaries 585 PASS := BINARIES 586 $(eval $(def_pass)) 587 588 ## PASS: others 589 # This pass builds binary targets, i.e. programs, dlls, drivers and stuff. 590 pass_others_doit: $(_OTHERS) 591 pass := others 592 PASS := OTHERS 593 $(eval $(def_pass)) 594 595 ## PASS: publish 596 # This pass installs the built entities to a sandbox area. 597 pass_publish_doit: publish 598 publish:: 599 pass := publish 600 PASS := PUBLISH 601 SUBDIRS_PUBLISH ?= $(sort $(SUBDIRS) $(SUBDIRS_LIBRARIES) $(SUBDIRS_BINARIES) $(SUBDIRS_OTHERS)) 602 SUBDIRS_AFTER_PUBLISH ?= $(sort $(SUBDIRS_AFTER) $(SUBDIRS_AFTER_LIBRARIES) $(SUBDIRS_AFTER_BINARIES) $(SUBDIRS_AFTER_OTHERS)) 603 MAKEFILES_BEFORE_PUBLISH?= $(sort $(MAKEFILES_BEFORE) $(MAKEFILES_BEFORE_LIBRARIES) $(MAKEFILES_BEFORE_BINARIES) $(MAKEFILES_BEFORE_OTHERS)) 604 MAKEFILES_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. 609 pass_packing_doit: packing 610 packing:: 611 pass := packing 612 PASS := PACKING 613 $(eval $(def_pass)) 614 615 ## PASS: clean 616 # This pass removes all generated files. 617 pass_clean_doit: 618 $(RM) -f $(_OUT_FILES) $(_OBJS) $(_DEPFILES) $(_DIRFILES) 619 pass := clean 620 PASS := CLEAN 621 $(eval $(def_pass)) 622 clean: pass_clean 623 624 ## PASS: nothing 625 # This pass just walks the tree. 626 pass_nothing_doit: 627 $(call MSG_L1,Did nothing in $(CURDIR)) 628 pass := nothing 629 PASS := NOTHING 630 $(eval $(def_pass)) 631 nothing: pass_nothing 632 633 634 494 635 # 495 636 # THE MAIN RULES 496 637 # 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)" 638 all_recursive: $(foreach pass,$(PASSES),pass_$(pass)) 639 640 # misc shortcuts. 641 target: needed libraries binaries others 642 objects: $(_OBJS) 643 programs: $(_EXES) 644 dlls: $(_DLLS) 645 kernelmodules: $(_KMODS) 508 646 509 647 -
trunk/kBuild/header.kmk
r73 r75 244 244 # 245 245 # Message macros. 246 # 246 # 247 247 248 ifndef BUILD_QUIET 249 ifdef BUILD_DEBUG 250 BUILD_VERBOSE := 9 251 endif 248 252 MSG_L1 = @echo "kBuild: $1" 249 253 ifdef BUILD_VERBOSE 250 254 MSG_L2 = @echo "kBuild: $1" 251 else 255 QUIET := 256 else 257 QUIET := @ 252 258 MSG_L2 = 253 259 endif … … 258 264 endif 259 265 else 266 QUIET := 260 267 MSG_L1 = 261 268 MSG_L2 = -
trunk/kBuild/tools/GCC.kmk
r74 r75 78 78 $(TOOL_GCC_CC) -c\ 79 79 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ 80 -Wp,-M T,$(dep) -Wp,-MD,$$@\80 -Wp,-MD,$(dep) -Wp,-MT,$$@ \ 81 81 -o $$@\ 82 82 $(PATH_CURRENT)/$(source)
Note:
See TracChangeset
for help on using the changeset viewer.