X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=Makefile;h=9c316e9d018ce6802af03b7d5ef848f68228e44c;hb=a8cf9c5a3ffd1601872d1ab14c5be00fde29209c;hp=b50c722ca3a9288ea392058e2a560ceb94e2a464;hpb=90dbff72670979df5250254eef7a5721a2d15801;p=oweals%2Fbusybox.git diff --git a/Makefile b/Makefile index b50c722ca..9c316e9d0 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 1 -PATCHLEVEL = 13 +PATCHLEVEL = 28 SUBLEVEL = 0 -EXTRAVERSION = +EXTRAVERSION = .git NAME = Unnamed # *DOCUMENTATION* @@ -168,6 +168,7 @@ ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := $(shell grep ^CONFIG_CROSS_COMPILER_PREFIX .config 2>/dev/null) CROSS_COMPILE := $(subst CONFIG_CROSS_COMPILER_PREFIX=,,$(CROSS_COMPILE)) CROSS_COMPILE := $(subst ",,$(CROSS_COMPILE)) +#") endif # SUBARCH tells the usermode build what the underlying arch is. That is set @@ -296,6 +297,7 @@ NM = $(CROSS_COMPILE)nm STRIP = $(CROSS_COMPILE)strip OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump +PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config AWK = awk GENKSYMS = scripts/genksyms/genksyms DEPMOD = /sbin/depmod @@ -357,6 +359,20 @@ scripts_basic: # To avoid any implicit rule to kick in, define an empty command. scripts/basic/%: scripts_basic ; +# This target generates Kbuild's and Config.in's from *.c files +PHONY += gen_build_files +gen_build_files: $(wildcard $(srctree)/*/*.c) $(wildcard $(srctree)/*/*/*.c) + $(Q)$(srctree)/scripts/gen_build_files.sh $(srctree) $(objtree) + +# bbox: we have helpers in applets/ +# we depend on scripts_basic, since scripts/basic/fixdep +# must be built before any other host prog +PHONY += applets_dir +applets_dir: scripts_basic gen_build_files + $(Q)$(MAKE) $(build)=applets + +applets/%: applets_dir ; + PHONY += outputmakefile # outputmakefile generates a Makefile in the output directory, if using a # separate output directory. This allows convenient use of make in the @@ -418,7 +434,12 @@ ifeq ($(config-targets),1) -include $(srctree)/arch/$(ARCH)/Makefile export KBUILD_DEFCONFIG -config %config: scripts_basic outputmakefile FORCE +config: scripts_basic outputmakefile gen_build_files FORCE + $(Q)mkdir -p include + $(Q)$(MAKE) $(build)=scripts/kconfig $@ + $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease + +%config: scripts_basic outputmakefile gen_build_files FORCE $(Q)mkdir -p include $(Q)$(MAKE) $(build)=scripts/kconfig $@ $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease @@ -431,9 +452,9 @@ else ifeq ($(KBUILD_EXTMOD),) # Additional helpers built in scripts/ # Carefully list dependencies so we do not try to build scripts twice -# in parrallel +# in parallel PHONY += scripts -scripts: scripts_basic include/config/MARKER +scripts: gen_build_files scripts_basic include/config/MARKER $(Q)$(MAKE) $(build)=$(@) scripts_basic: include/autoconf.h @@ -444,7 +465,7 @@ core-y := \ libs-y := \ archival/ \ - archival/libunarchive/ \ + archival/libarchive/ \ console-tools/ \ coreutils/ \ coreutils/libcoreutils/ \ @@ -494,9 +515,11 @@ include $(srctree)/Makefile.flags # with it and forgot to run make oldconfig. # If kconfig.d is missing then we are probarly in a cleaned tree so # we execute the config step to be sure to catch updated Kconfig files -include/autoconf.h: .kconfig.d .config +include/autoconf.h: .kconfig.d .config $(wildcard $(srctree)/*/*.c) $(wildcard $(srctree)/*/*/*.c) | gen_build_files $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig +include/usage.h: gen_build_files + else # Dummy target needed, because used as prerequisite include/autoconf.h: ; @@ -529,7 +552,7 @@ export INSTALL_PATH ?= /boot # # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory # relocations required by build roots. This is not defined in the -# makefile but the arguement can be passed to make if needed. +# makefile but the argument can be passed to make if needed. # MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) @@ -587,7 +610,8 @@ quiet_cmd_busybox__ ?= LINK $@ "$(LDFLAGS) $(EXTRA_LDFLAGS)" \ "$(core-y)" \ "$(libs-y)" \ - "$(LDLIBS)" + "$(LDLIBS)" \ + && $(srctree)/scripts/generate_BUFSIZ.sh --post include/common_bufsiz.h # Generate System.map quiet_cmd_sysmap = SYSMAP @@ -796,7 +820,7 @@ ifneq ($(KBUILD_MODULES),) $(Q)rm -f $(MODVERDIR)/* endif -archprepare: prepare1 scripts_basic +archprepare: prepare1 scripts_basic applets_dir prepare0: archprepare FORCE $(Q)$(MAKE) $(build)=. @@ -820,13 +844,16 @@ export CPPFLAGS_busybox.lds += -P -C -U$(ARCH) # Split autoconf.h into include/linux/config/* quiet_cmd_gen_bbconfigopts = GEN include/bbconfigopts.h - cmd_gen_bbconfigopts = $(srctree)/scripts/mkconfigs > include/bbconfigopts.h + cmd_gen_bbconfigopts = $(srctree)/scripts/mkconfigs include/bbconfigopts.h include/bbconfigopts_bz2.h +quiet_cmd_gen_common_bufsiz = GEN include/common_bufsiz.h + cmd_gen_common_bufsiz = $(srctree)/scripts/generate_BUFSIZ.sh include/common_bufsiz.h quiet_cmd_split_autoconf = SPLIT include/autoconf.h -> include/config/* cmd_split_autoconf = scripts/basic/split-include include/autoconf.h include/config #bbox# piggybacked generation of few .h files include/config/MARKER: scripts/basic/split-include include/autoconf.h $(call cmd,split_autoconf) $(call cmd,gen_bbconfigopts) + $(call cmd,gen_common_bufsiz) @touch $@ # Generate some files @@ -941,10 +968,15 @@ CLEAN_FILES += busybox busybox_unstripped* busybox.links \ # Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include2 MRPROPER_FILES += .config .config.old include/asm .version .old_version \ + include/NUM_APPLETS.h \ + include/common_bufsiz.h \ include/autoconf.h \ include/bbconfigopts.h \ + include/bbconfigopts_bz2.h \ include/usage_compressed.h \ include/applet_tables.h \ + include/applets.h \ + include/usage.h \ applets/usage \ .kernelrelease Module.symvers tags TAGS cscope* \ busybox_old @@ -969,7 +1001,7 @@ clean: archclean $(clean-dirs) PHONY += doc-clean doc-clean: rm-files := docs/busybox.pod \ - docs/BusyBox.html docs/BusyBox.1 docs/BusyBox.txt + docs/BusyBox.html docs/busybox.1 docs/BusyBox.txt doc-clean: $(call cmd,rmfiles) @@ -986,6 +1018,8 @@ $(mrproper-dirs): mrproper: clean archmrproper $(mrproper-dirs) $(call cmd,rmdirs) $(call cmd,rmfiles) + @find . -name Config.src | sed 's/.src$$/.in/' | xargs -r rm -f + @find . -name Kbuild.src | sed 's/.src$$//' | xargs -r rm -f # distclean # @@ -1014,7 +1048,7 @@ rpm: FORCE # Brief documentation of the typical targets used # --------------------------------------------------------------------------- -boards := $(wildcard $(srctree)/arch/$(ARCH)/configs/*_defconfig) +boards := $(wildcard $(srctree)/configs/*_defconfig) boards := $(notdir $(boards)) -include $(srctree)/Makefile.help @@ -1103,15 +1137,6 @@ clean: $(clean-dirs) -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ -type f -print | xargs rm -f -help: - @echo ' Building external modules.' - @echo ' Syntax: make -C path/to/kernel/src M=$$PWD target' - @echo '' - @echo ' modules - default target, build the module(s)' - @echo ' modules_install - install the module' - @echo ' clean - remove generated files in module directory only' - @echo '' - # Dummies... PHONY += prepare scripts prepare: ; @@ -1145,24 +1170,7 @@ endif ALLSOURCE_ARCHS := $(ARCH) define all-sources - ( find $(__srctree) $(RCS_FIND_IGNORE) \ - \( -name include -o -name arch \) -prune -o \ - -name '*.[chS]' -print; \ - for ARCH in $(ALLSOURCE_ARCHS) ; do \ - find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \ - -name '*.[chS]' -print; \ - done ; \ - find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \ - -name '*.[chS]' -print; \ - find $(__srctree)include $(RCS_FIND_IGNORE) \ - \( -name config -o -name 'asm-*' \) -prune \ - -o -name '*.[chS]' -print; \ - for ARCH in $(ALLINCLUDE_ARCHS) ; do \ - find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \ - -name '*.[chS]' -print; \ - done ; \ - find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ - -name '*.[chS]' -print ) + ( find -regex '.*\.[ch]$$' ) endef quiet_cmd_cscope-file = FILELST cscope.files @@ -1266,9 +1274,13 @@ endif $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) # Modules -/ %/: prepare scripts FORCE +%/: prepare scripts FORCE $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) +/: prepare scripts FORCE + $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ + $(build)=$(build-dir) + %.ko: prepare scripts FORCE $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) $(@:.ko=.o)