Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/Makefile
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/Makefile
r1772 r2725 1 1 VERSION = 1 2 PATCHLEVEL = 72 PATCHLEVEL = 18 3 3 SUBLEVEL = 3 4 EXTRAVERSION = -rPBREV4 EXTRAVERSION = 5 5 NAME = Unnamed 6 6 … … 142 142 export srctree objtree VPATH TOPDIR 143 143 144 145 # SUBARCH tells the usermode build what the underlying arch is. That is set146 # first, and if a usermode build is happening, the "ARCH=um" on the command147 # line overrides the setting of ARCH below. If a native build is happening,148 # then ARCH is assigned, getting whatever value it gets normally, and149 # SUBARCH is subsequently ignored.150 151 SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \152 -e s/arm.*/arm/ -e s/sa110/arm/ \153 -e s/s390x/s390/ -e s/parisc64/parisc/ \154 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )155 144 156 145 # Cross compiling and selecting different set of gcc/bin-utils … … 173 162 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile 174 163 175 ARCH ?= $(SUBARCH) 176 CROSS_COMPILE ?= 164 CROSS_COMPILE ?= 165 # bbox: we may have CONFIG_CROSS_COMPILER_PREFIX in .config, 166 # and it has not been included yet... thus using an awkward syntax. 167 ifeq ($(CROSS_COMPILE),) 168 CROSS_COMPILE := $(shell grep ^CONFIG_CROSS_COMPILER_PREFIX .config 2>/dev/null) 169 CROSS_COMPILE := $(subst CONFIG_CROSS_COMPILER_PREFIX=,,$(CROSS_COMPILE)) 170 CROSS_COMPILE := $(subst ",,$(CROSS_COMPILE)) 171 #") 172 endif 173 174 # SUBARCH tells the usermode build what the underlying arch is. That is set 175 # first, and if a usermode build is happening, the "ARCH=um" on the command 176 # line overrides the setting of ARCH below. If a native build is happening, 177 # then ARCH is assigned, getting whatever value it gets normally, and 178 # SUBARCH is subsequently ignored. 179 180 ifneq ($(CROSS_COMPILE),) 181 SUBARCH := $(shell echo $(CROSS_COMPILE) | cut -d- -f1) 182 else 183 SUBARCH := $(shell uname -m) 184 endif 185 SUBARCH := $(shell echo $(SUBARCH) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ 186 -e s/arm.*/arm/ -e s/sa110/arm/ \ 187 -e s/s390x/s390/ -e s/parisc64/parisc/ \ 188 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ ) 189 190 ARCH ?= $(SUBARCH) 177 191 178 192 # Architecture as present in compile.h … … 303 317 # Needed to be compatible with the O= option 304 318 CFLAGS := $(CFLAGS) 319 # Added only to final link stage of busybox binary 320 CFLAGS_busybox := $(CFLAGS_busybox) 305 321 CPPFLAGS := $(CPPFLAGS) 306 322 AFLAGS := $(AFLAGS) … … 342 358 # To avoid any implicit rule to kick in, define an empty command. 343 359 scripts/basic/%: scripts_basic ; 360 361 # This target generates Kbuild's and Config.in's from *.c files 362 PHONY += gen_build_files 363 gen_build_files: $(wildcard $(srctree)/*/*.c) $(wildcard $(srctree)/*/*/*.c) 364 $(Q)$(srctree)/scripts/gen_build_files.sh $(srctree) $(objtree) 365 366 # bbox: we have helpers in applets/ 367 # we depend on scripts_basic, since scripts/basic/fixdep 368 # must be built before any other host prog 369 PHONY += applets_dir 370 applets_dir: scripts_basic gen_build_files 371 $(Q)$(MAKE) $(build)=applets 372 373 applets/%: applets_dir ; 344 374 345 375 PHONY += outputmakefile … … 362 392 363 393 no-dot-config-targets := clean mrproper distclean \ 364 cscope TAGS tags help %docs check% 394 cscope TAGS tags help %docs 395 #bbox# check% is removed from above 365 396 366 397 config-targets := 0 … … 403 434 export KBUILD_DEFCONFIG 404 435 405 config %config: scripts_basic outputmakefile FORCE 436 config: scripts_basic outputmakefile gen_build_files FORCE 437 $(Q)mkdir -p include 438 $(Q)$(MAKE) $(build)=scripts/kconfig $@ 439 $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease 440 441 %config: scripts_basic outputmakefile gen_build_files FORCE 406 442 $(Q)mkdir -p include 407 443 $(Q)$(MAKE) $(build)=scripts/kconfig $@ … … 416 452 # Additional helpers built in scripts/ 417 453 # Carefully list dependencies so we do not try to build scripts twice 418 # in par rallel454 # in parallel 419 455 PHONY += scripts 420 scripts: scripts_basic include/config/MARKER456 scripts: gen_build_files scripts_basic include/config/MARKER 421 457 $(Q)$(MAKE) $(build)=$(@) 422 458 … … 429 465 libs-y := \ 430 466 archival/ \ 431 archival/lib unarchive/ \467 archival/libarchive/ \ 432 468 console-tools/ \ 433 469 coreutils/ \ … … 438 474 findutils/ \ 439 475 init/ \ 440 ipsvd/ \441 476 libbb/ \ 442 477 libpwdgrp/ \ 443 478 loginutils/ \ 479 mailutils/ \ 444 480 miscutils/ \ 445 481 modutils/ \ … … 447 483 networking/libiproute/ \ 448 484 networking/udhcp/ \ 485 printutils/ \ 449 486 procps/ \ 450 487 runit/ \ … … 453 490 sysklogd/ \ 454 491 util-linux/ \ 492 util-linux/volume_id/ \ 455 493 456 494 endif # KBUILD_EXTMOD … … 477 515 # If kconfig.d is missing then we are probarly in a cleaned tree so 478 516 # we execute the config step to be sure to catch updated Kconfig files 479 include/autoconf.h: .kconfig.d .config 517 include/autoconf.h: .kconfig.d .config $(wildcard $(srctree)/*/*.c) $(wildcard $(srctree)/*/*/*.c) | gen_build_files 480 518 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig 519 520 include/usage.h: gen_build_files 481 521 482 522 else … … 489 529 # This allow a user to issue only 'make' to build a kernel including modules 490 530 # Defaults busybox but it is usually overridden in the arch makefile 491 all: busybox 531 all: busybox doc 492 532 493 533 -include $(srctree)/arch/$(ARCH)/Makefile … … 496 536 #bbox# NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) 497 537 CHECKFLAGS += $(NOSTDINC_FLAGS) 498 499 # warn about C99 declaration after statement500 CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)501 502 # disable pointer signedness warnings in gcc 4.0503 CFLAGS += $(call cc-option,-Wno-pointer-sign,)504 538 505 539 # Default kernel image to build when no specific target is given. … … 569 603 # May be overridden by arch/$(ARCH)/Makefile 570 604 quiet_cmd_busybox__ ?= LINK $@ 571 cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(LDFLAGS) \ 572 -o $@ -Wl,-Map -Wl,$@.map \ 573 -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ 574 -Wl,--start-group $(busybox-all) -Wl,--end-group \ 575 $(LDLIBS) 605 cmd_busybox__ ?= $(srctree)/scripts/trylink \ 606 "$@" \ 607 "$(CC)" \ 608 "$(CFLAGS) $(CFLAGS_busybox)" \ 609 "$(LDFLAGS) $(EXTRA_LDFLAGS)" \ 610 "$(core-y)" \ 611 "$(libs-y)" \ 612 "$(LDLIBS)" 576 613 577 614 # Generate System.map … … 685 722 $(Q)$(STRIP) -s --remove-section=.note --remove-section=.comment \ 686 723 busybox_unstripped -o $@ 724 # strip is confused by PIE executable and does not set exec bits 725 $(Q)chmod a+x $@ 687 726 endif 688 727 … … 728 767 # Other SCMs can edit scripts/setlocalversion and add the appropriate 729 768 # checks as needed. 730 ifdef CONFIG_LOCALVERSION_AUTO769 ifdef _BB_DISABLED_CONFIG_LOCALVERSION_AUTO 731 770 _localver-auto = $(shell $(CONFIG_SHELL) \ 732 771 $(srctree)/scripts/setlocalversion $(srctree)) … … 780 819 endif 781 820 782 archprepare: prepare1 scripts_basic 821 archprepare: prepare1 scripts_basic applets_dir 783 822 784 823 prepare0: archprepare FORCE … … 804 843 # Split autoconf.h into include/linux/config/* 805 844 quiet_cmd_gen_bbconfigopts = GEN include/bbconfigopts.h 806 cmd_gen_bbconfigopts = $(srctree)/scripts/mkconfigs > include/bbconfigopts.h845 cmd_gen_bbconfigopts = $(srctree)/scripts/mkconfigs include/bbconfigopts.h include/bbconfigopts_bz2.h 807 846 quiet_cmd_split_autoconf = SPLIT include/autoconf.h -> include/config/* 808 847 cmd_split_autoconf = scripts/basic/split-include include/autoconf.h include/config … … 841 880 # Modules 842 881 843 ifdef CONFIG_MODULES882 ifdef _BB_DISABLED_CONFIG_MODULES 844 883 845 884 # By default, build modules as well … … 917 956 918 957 # Directories & files removed with 'make clean' 919 CLEAN_DIRS += $(MODVERDIR) 920 CLEAN_FILES += busybox* System.map .kernelrelease \ 958 CLEAN_DIRS += $(MODVERDIR) _install 0_lib 959 CLEAN_FILES += busybox busybox_unstripped* busybox.links \ 960 System.map .kernelrelease \ 921 961 .tmp_kallsyms* .tmp_version .tmp_busybox* .tmp_System.map 922 962 … … 927 967 include/bbconfigopts.h \ 928 968 include/usage_compressed.h \ 929 .kernelrelease Module.symvers tags TAGS cscope* 969 include/applet_tables.h \ 970 applets/usage \ 971 .kernelrelease Module.symvers tags TAGS cscope* \ 972 busybox_old 930 973 931 974 # clean - Delete most, but leave enough to build external modules … … 943 986 $(call cmd,rmfiles) 944 987 @find . $(RCS_FIND_IGNORE) \ 945 988 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ 946 989 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ 947 990 -type f -print | xargs rm -f 991 992 PHONY += doc-clean 993 doc-clean: rm-files := docs/busybox.pod \ 994 docs/BusyBox.html docs/busybox.1 docs/BusyBox.txt 995 doc-clean: 996 $(call cmd,rmfiles) 948 997 949 998 # mrproper - Delete all generated files, including .config … … 960 1009 $(call cmd,rmdirs) 961 1010 $(call cmd,rmfiles) 1011 @find -name Config.src | sed 's/.src$$/.in/' | xargs -r rm -f 1012 @find -name Kbuild.src | sed 's/.src$$//' | xargs -r rm -f 962 1013 963 1014 # distclean … … 967 1018 distclean: mrproper 968 1019 @find $(srctree) $(RCS_FIND_IGNORE) \ 969 1020 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ 970 1021 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ 971 -o -name '.*.rej' -o -size 0 \1022 -o -name '.*.rej' -o -name '*.tmp' -o -size 0 \ 972 1023 -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ 973 1024 -type f -print | xargs rm -f … … 1073 1124 $(call cmd,rmdirs) 1074 1125 @find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \ 1075 1126 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ 1076 1127 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ 1077 1128 -type f -print | xargs rm -f … … 1240 1291 1241 1292 # Modules 1242 /%/: prepare scripts FORCE1293 %/: prepare scripts FORCE 1243 1294 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ 1244 1295 $(build)=$(build-dir) 1296 /: prepare scripts FORCE 1297 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ 1298 $(build)=$(build-dir) 1299 1245 1300 %.ko: prepare scripts FORCE 1246 1301 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
Note:
See TracChangeset
for help on using the changeset viewer.