Index: trunk/Make.rules =================================================================== --- trunk/Make.rules (revision 1746) +++ trunk/Make.rules (revision 1747) @@ -141,13 +141,24 @@ || eval $$failcom; \ done + clean-dep: @if [ -f "$(OBJROOT)/Makedep" ];then echo "\t[RM] $(OBJROOT)/Makedep"; fi @rm -f $(OBJROOT)/Makedep + +FIND_IGNORE := \( -name .git -o -name .svn \) -prune -o -name Cconfig -o + +# clean: remove most generated files clean: clean-recursive clean-dep distclean: distclean-recursive clean-local clean-dep + @find . $(FIND_IGNORE) \ + \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ + -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ + -o -name '.*.rej' -o -size 0 \ + -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ + -type f -print | xargs rm -f clean-local: Index: trunk/Makefile =================================================================== --- trunk/Makefile (revision 1746) +++ trunk/Makefile (revision 1747) @@ -99,11 +99,15 @@ @gzip --best ${DISTFILE}.tar @mv ${DISTFILE}.tar.gz ${DISTFILE}.tgz -clean-local: clean-pkg-local +clean-local: + @if [ -d "$(SYMROOT)/package" ];then echo "\t[RMDIR] $(SYMROOT)/package"; fi @if [ -f "$(HEADER_VERSION)" ];then echo "\t[RM] $(HEADER_VERSION)"; fi @if [ -f "$(SRCROOT)/revision" ];then echo "\t[RM] $(SRCROOT)/revision"; fi - @rm -f $(HEADER_VERSION) $(SRCROOT)/revision + @rm -rf "$(SYMROOT)/package" $(HEADER_VERSION) $(SRCROOT)/revision +AUTOCONF_FILES = $(SRCROOT)/auto.conf $(SRCROOT)/autoconf.h \ + $(SRCROOT)/autoconf.inc $(SRCROOT)/.config $(SRCROOT)/.config.old + distclean-local: @if [ -d "$(OBJROOT)" ];then echo "\t[RMDIR] $(OBJROOT)"; fi @if [ -d "$(SYMROOT)" ];then echo "\t[RMDIR] $(SYMROOT)"; fi @@ -111,25 +115,33 @@ @if [ -d "$(SRCROOT)/i386/modules/module_includes" ];then \ echo "\t[RMDIR] $(SRCROOT)/i386/modules/module_includes"; \ fi - @if [ -f "$(SRCROOT)/auto.conf" ];then echo "\t[RM] $(SRCROOT)/auto.conf"; fi - @if [ -f "$(SRCROOT)/autoconf.h" ];then echo "\t[RM] $(SRCROOT)/autoconf.h"; fi - @if [ -f "$(SRCROOT)/autoconf.inc" ];then echo "\t[RM] $(SRCROOT)/autoconf.inc"; fi - + @for cfg in $(AUTOCONF_FILES); do if [ -f "$${cfg}" ];then echo "\t[RM] $${cfg}"; fi; done @rm -rf $(OBJROOT) $(SYMROOT) $(DSTROOT) \ $(SRCROOT)/i386/modules/module_includes \ - $(SRCROOT)/auto.conf \ - $(SRCROOT)/autoconf.h \ - $(SRCROOT)/autoconf.inc + $(AUTOCONF_FILES) pkg installer: all ${SRCROOT}/package/buildpkg.sh ${SYMROOT}/package -clean-pkg-local: - @if [ -d "$(SYMROOT)/package" ];then echo "\t[RMDIR] $(SYMROOT)/package"; fi - @rm -rf "$(SYMROOT)/package" +help: + @echo 'Configuration target:' + @echo ' config - Show configuration menu' + @echo + @echo 'Build targets:' + @echo ' all - Build all targets [DEFAULT]' + @echo ' dist - Build distribution tarball' + @echo ' pkg - Build installer package' + @echo + @echo 'Cleaning targets:' + @echo ' clean - Remove most generated files' + @echo ' distclean - Remove all generated files + config' +#@echo +# @echo 'Build options:' +# @echo 'make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' .PHONY: config .PHONY: clean .PHONY: image .PHONY: pkg .PHONY: installer +.PHONY: help