+ rm -f $@
+ echo "%_topdir $(HOME)" >> $@
+ echo "%_tmppath $(HOME)/tmp" >> $@
+ echo "%__spec_install_pre %{___build_pre}" >> $@
+ ./getrpmmacros.sh >> $@
+
+### this utility allows to extract various info from a spec file
+### and to define them in makefiles
+# use the C code where it works as it's the original one, use the python code otherwise
+spec2make: spec2make.c
+ $(CC) -g -Wall $< -o $@ -lrpm -lrpmbuild -lrpmio -lpopt || ln -s spec2make.py $@
+
+### run spec2make on the spec file and include the result
+# usage: spec2make package
+# with old rpms (f8&c5) and too recent specfiles (the kernel), we need a patch to spec2make
+# so when <package-NEEDSPECK2MAKEHACK is set, we run spec2make with the --hack flag
+define target_mk
+MAKE/$(1).mk: $($(1).specpath) spec2make .rpmmacros
+ mkdir -p MAKE
+ ./spec2make $($(1).spec2makeflags) $($(1)-RPMFLAGS) $($(1).specpath) $(1) > MAKE/$(1).mk || { rm MAKE/$(1).mk; exit 1; }
+endef
+
+$(foreach package,$(ALL),$(eval $(call target_mk,$(package))))
+
+# stores env variables in a file
+# this is done at stage1. later run won't get confused
+STATIC_VARS=PLDISTRO PLDISTROTAGS build-GITPATH PERSONALITY MAILTO BASE WEBPATH TESTBUILDURL WEBROOT
+# find out names for variables set on the command line
+define assigned_varname
+$(if $(findstring =,$(1)),$(firstword $(subst =, ,$(1))) )
+endef
+ASSIGNED=$(filter-out stage1 stage1iter,$(foreach flag,$(MAKEFLAGS),$(call assigned_varname,$(flag))))
+SAVED_VARS=$(sort $(STATIC_VARS) $(ASSIGNED))
+envfrompreviousrun.mk:
+ @echo "# do not edit" > $@
+ @$(foreach var,$(SAVED_VARS),echo "$(var):=$($(var))" >> $@ ;)
+ @echo "# do not edit" > aliases
+ @echo -n "alias m=\"make " >> aliases
+ @$(foreach var,$(SAVED_VARS),echo -n " $(var)=$($(var))" >> aliases ;)
+ @echo "\"" >> aliases
+ @echo "alias m1=\"m stage1=true\"" >> aliases
+
+envfrompreviousrun: envfrompreviousrun.mk
+.PHONY: envfrompreviousrun
+
+# always refresh this
+all: envfrompreviousrun
+
+#################### regular make
+
+define stage2_variables
+### devel dependencies
+$(1).rpmbuild = $(RPMBUILD) $($(1)-RPMFLAGS)
+$(1).all-local-devel-rpm-paths := $(foreach rpm,$($(1)-LOCAL-DEVEL-RPMS) $($(1)-LOCAL-DEVEL-RPMS-CRUCIAL),$($(rpm).rpm-path))
+$(1).depend-devel-packages := $(sort $(foreach rpm,$($(1)-LOCAL-DEVEL-RPMS),$($(rpm).package)))
+ALL-STOCK-DEVEL-RPMS += $($(1)-LOCAL-DEVEL-RPMS)
+endef
+
+$(foreach package,$(ALL),$(eval $(call stage2_variables,$(package))))
+ALL-STOCK-DEVEL-RPMS := $(sort $(ALL-STOCK-DEVEL-RPMS))
+
+
+### pack sources into tarballs
+ALLTARBALLS:= $(foreach package, $(ALL), $($(package).tarballs))
+tarballs: $(ALLTARBALLS)
+ @echo $(words $(ALLTARBALLS)) source tarballs OK
+.PHONY: tarballs
+
+SOURCES/%.tar.bz2: SOURCES/%
+ tar chpjf $@ -C SOURCES $*
+
+SOURCES/%.tar.gz: SOURCES/%
+ tar chpzf $@ -C SOURCES $*
+
+SOURCES/%.tgz: SOURCES/%
+ tar chpzf $@ -C SOURCES $*
+
+##
+URLS/%: url=$(subst @colon@,:,$(subst @slash@,/,$(notdir $@)))
+URLS/%: basename=$(notdir $(url))
+URLS/%:
+ echo curl $(url) -o SOURCES/$(basename)
+ touch $@
+
+### the directory SOURCES/<package>-<version> is made
+# with a (set of) copy -rl from MODULES/<module>
+# the former is $(package.source)
+ALLSOURCES:=$(foreach package, $(ALL), $($(package).source))
+# so that make does not use the rule below directly for creating the tarball files
+.SECONDARY: $(ALLSOURCES)
+
+sources: $(ALLSOURCES)
+ @echo $(words $(ALLSOURCES)) versioned source trees OK
+.PHONY: sources
+
+# argument is a package
+# do things differently if multiple modules are mentioned (sigh..)
+define target_copy_link_modules_sources
+$($(1).source): $(foreach module,$($(1)-MODULES),MODULES/$(module))
+ $(if $(word 2,$($(1)-MODULES)),\
+ mkdir -p $($(1).source) && $(foreach module,$($(1)-MODULES), cp -rl MODULES/$(module) $($(1).source)/$(module);) ,\
+ mkdir -p SOURCES && cp -rl MODULES/$($(1)-MODULES) $($(1).source))
+endef
+
+$(foreach package,$(ALL),$(eval $(call target_copy_link_modules_sources,$(package))))
+
+### code extraction
+ALLMODULES:=$(foreach module, $(ALL.modules), MODULES/$(module))
+.SECONDARY: $(ALLMODULES)
+modules: $(ALLMODULES)
+ @echo $(words $(ALLMODULES)) modules OK "(fetched from scm)"
+.PHONY: modules
+
+### source rpms
+ALLSRPMS:=$(foreach package,$(ALL),$($(package).srpm))
+srpms: $(ALLSRPMS)
+ @echo $(words $(ALLSRPMS)) source rpms OK
+.PHONY: srpms
+
+#################### manage build requirements
+# default values
+RPMYUM-INSTALL-LOCAL := rpm --force -Uvh
+RPMYUM-INSTALL-STOCK := yum -y install
+# uninstall -- cannot force rpm -e
+# need to ignore result, kernel-headers cannot be uninstalled as glibc depends on it
+RPMYUM-UNINSTALL-STOCK := rpm -e
+
+### these macro handles the LOCAL-DEVEL-RPMS and LOCAL-DEVEL-RPMS-CRUCIAL tags for a given package
+# before building : rpm-install LOCAL-DEVEL-RPMS
+define rpmyum_install_local_rpms
+ $(if $($(1).all-local-devel-rpm-paths), echo "Installing for $(1)-LOCAL-DEVEL-RPMS" ; $(RPMYUM-INSTALL-LOCAL) $($(1).all-local-devel-rpm-paths))
+endef
+
+# install stock rpms if defined
+define rpmyum_install_stock_rpms
+ $(if $($(1)-STOCK-DEVEL-RPMS), echo "Installing for $(1)-STOCK-DEVEL-RPMS" ; $(RPMYUM-INSTALL-STOCK) $($(1)-STOCK-DEVEL-RPMS) || true)
+endef
+
+define rpmyum_uninstall_stock_rpms
+ -$(if $($(1)-STOCK-DEVEL-RPMS), echo "Unstalling for $(1)-STOCK-DEVEL-RPMS" ; $(RPMYUM-UNINSTALL-STOCK) $($(1)-STOCK-DEVEL-RPMS) || true)
+endef
+
+# similar for debians
+# gdebi acts like yum localinstall; gdebi-core should be mentioned in develdeb.pkgs
+DPKGAPT-INSTALL-LOCAL := gdebi
+DPKGAPT-INSTALL-STOCK := apt-get -y install
+DPKGAPT-UNINSTALL-STOCK := echo WARNING uninstalling stock debs not implemented
+
+define dpkgapt_install_local_debs
+ $(if $($(1)-LOCAL-DEVEL-DEBS), echo "Installing for $(1)-LOCAL-DEVEL-DEBS" ; $(foreach debname,$($(1)-LOCAL-DEVEL-DEBS),$(DPKGAPT-INSTALL-LOCAL) $(wildcard DEBIAN/$(debname)_*.deb);))
+endef
+
+define dpkgapt_install_stock_debs
+ $(if $($(1)-STOCK-DEVEL-DEBS), echo "Installing for $(1)-STOCK-DEVEL-DEBS" ; $(DPKGAPT-INSTALL-STOCK) $($(1)-STOCK-DEVEL-DEBS) || true)
+endef
+
+define dpkgapt_uninstall_stock_debs
+ -$(if $($(1)-STOCK-DEVEL-DEBS), echo "Unstalling for $(1)-STOCK-DEVEL-DEBS" ; $(DPKGAPT-UNINSTALL-STOCK) $($(1)-STOCK-DEVEL-DEBS) || true)
+endef
+
+
+####################
+# usage: target_source_rpm package
+define target_source_rpm
+ifeq "$($(1)-BUILD-FROM-SRPM)" ""
+$($(1).srpm): $($(1).specpath) .rpmmacros $($(1).tarballs)
+ mkdir -p BUILD SRPMS tmp
+ @(echo -n "XXXXXXXXXXXXXXX -- BEG SRPM $(1) (using SOURCES) " ; date)
+ $(call rpmyum_install_stock_rpms,$(1))
+ $(call rpmyum_install_local_rpms,$(1))
+ $($(1).rpmbuild) -bs $($(1).specpath)
+ $(call rpmyum_uninstall_stock_rpms,$(1))
+ @(echo -n "XXXXXXXXXXXXXXX -- END SRPM $(1) " ; date)
+else
+$($(1).srpm): $($(1).specpath) .rpmmacros $($(1).source)
+ mkdir -p BUILD SRPMS tmp
+ @(echo -n "XXXXXXXXXXXXXXX -- BEG SRPM $(1) (using make srpm) " ; date)
+ $(call rpmyum_install_stock_rpms,$(1))
+ $(call rpmyum_install_local_rpms,$(1))
+ make -C $($(1).source) srpm SPECFILE=$(HOME)/$($(1).specpath) EXPECTED_SRPM=$(notdir $($(1).srpm)) && \
+ rm -f SRPMS/$(notdir $($(1).srpm)) && \
+ ln $($(1).source)/$(notdir $($(1).srpm)) SRPMS/$(notdir $($(1).srpm))
+ $(call rpmyum_uninstall_stock_rpms,$(1))
+ @(echo -n "XXXXXXXXXXXXXXX -- END SRPM $(1) " ; date)
+endif
+endef
+
+$(foreach package,$(ALL),$(eval $(call target_source_rpm,$(package))))
+
+### binary rpms are made from source rpm
+ALLRPMS:=$(foreach package,$(ALL),$($(package).rpms))
+# same as above, mention $(ALL) and not $(ALLRPMS)
+rpms: $(ALLRPMS)
+ @echo $(words $(ALLRPMS)) binary rpms OK
+.PHONY: rpms
+
+# use tmp dirs when building binary rpm so make remains idempotent
+# otherwise SOURCES/ or SPEC gets touched again - which leads to rebuilding
+RPM-USE-TMP-DIRS = --define "_sourcedir $(HOME)/tmp" --define "_specdir $(HOME)/tmp"
+RPM-USE-COMPILE-DIRS = --define "_sourcedir $(HOME)/COMPILE" --define "_specdir $(HOME)/COMPILE"
+
+# usage: build_binary_rpm package
+# xxx hacky - invoke createrepo if DEPEND-FILES mentions RPMS/yumgroups.xml
+define target_binary_rpm
+$($(1).rpms): $($(1).srpm)
+ mkdir -p RPMS tmp
+ @(echo -n "XXXXXXXXXXXXXXX -- BEG RPM $(1) " ; date)
+ $(if $(findstring RPMS/yumgroups.xml,$($(1)-DEPEND-FILES)), $(createrepo) , )
+ $(call rpmyum_install_stock_rpms,$(1))
+ $(call rpmyum_install_local_rpms,$(1))
+ $($(1).rpmbuild) --rebuild $(RPM-USE-TMP-DIRS) $($(1).srpm)
+ $(call rpmyum_uninstall_stock_rpms,$(1))
+ @(echo -n "XXXXXXXXXXXXXXX -- END RPM $(1) " ; date)
+# for manual use only - in case we need to investigate the results of an rpmbuild
+$(1)-compile: $($(1).srpm)
+ mkdir -p COMPILE tmp
+ @(echo -n "XXXXXXXXXXXXXXX -- BEG compile $(1) " ; date)
+ $(if $(findstring RPMS/yumgroups.xml,$($(1)-DEPEND-FILES)), $(createrepo) , )
+ $(call rpmyum_install_stock_rpms,$(1))
+ $(call rpmyum_install_local_rpms,$(1))
+ $($(1).rpmbuild) --recompile $(RPM-USE-TMP-DIRS) $($(1).srpm)
+ $(call rpmyum_uninstall_stock_rpms,$(1))
+ @(echo -n "XXXXXXXXXXXXXXX -- END compile $(1) " ; date)
+.PHONY: $(1)-compile
+endef
+
+$(foreach package,$(ALL),$(eval $(call target_binary_rpm,$(package))))
+### shorthand target
+# e.g. make proper -> does propers rpms
+# usage shorthand_target package
+define target_shorthand
+$(1): $($(1).rpms)
+.PHONY: $(1)
+$(1)-spec: $($(1)-SPEC)
+.PHONY: $(1)-spec
+$(1)-mk: $($(1)-MK)
+.PHONY: $(1)-mk
+$(1)-tarball: $($(1).tarballs)
+.PHONY: $(1)-tarball
+.PHONY: $(1)-source
+$(1)-source: $($(1).source)
+$(1)-rpms: $($(1).rpms)
+.PHONY: $(1)-rpms
+$(1)-srpm: $($(1).srpm)
+.PHONY: $(1)-srpm
+endef
+
+$(foreach package,$(ALL),$(eval $(call target_shorthand,$(package))))
+
+### file dependencies
+define package_depends_on_file
+$(1):$(2)
+$($(1).srpm):$(2)
+endef
+
+define target_dependfiles
+$(foreach file,$($(1)-DEPEND-FILES),$(eval $(call package_depends_on_file,$(1),$(file))))
+endef
+
+$(foreach package,$(ALL),$(eval $(call target_dependfiles,$(package))))
+
+### package dependencies
+define package_depends_on_package
+$(1):$(2)
+$(1):$($(2).rpms)
+$($(1).srpm):$($(2).rpms)
+endef
+
+define target_depends
+$(foreach package,$($(1)-DEPEND-PACKAGES) $($(1).depend-devel-packages),$(eval $(call package_depends_on_package,$(1),$(package))))
+endef
+
+$(foreach package,$(ALL),$(eval $(call target_depends,$(package))))
+
+####################
+# debian meta-target
+ALL-DEBIAN := $(foreach target,$(ALL),$(target)-debian)
+debian: $(ALL-DEBIAN)
+
+####################
+# very rough for now (one module per package), targets only sfa for now
+# the general idea here is, changing the specfile (for version number and all) is enough, and this
+# gets passed to "make debian" in the module
+# PREFIX: at one point we had passed PREFIX=/usr to this 'make debian'
+# however it turned out we could manage this some other way (see manifold)
+# so I'm reverting to simplicity
+define target_debian
+$(1)-debian: $(1)-tarball
+ $(call dpkgapt_install_local_debs,$(1))
+ $(call dpkgapt_install_stock_debs,$(1))
+ mkdir -p DEBIAN/$(1)
+ rsync -a MODULES/$($(1).module)/ DEBIAN/$(1)/
+ make -C DEBIAN/$(1) "RPMTARBALL=$(HOME)/$($(1).tarballs)" "RPMVERSION=$($(1).rpm-version)" "RPMRELEASE=$($(1).rpm-release)" "RPMNAME=$($(1).rpm-name)" debian
+ $(call dpkgapt_uninstall_stock_debs,$(1))
+endef
+
+$(foreach package,$(ALL),$(eval $(call target_debian,$(package))))
+
+### clean target
+# usage: target_clean package
+define target_clean
+$(1)-clean-modules:
+ $(foreach module,$($(1)-MODULES),rm -rf MODULES/$(module);)
+.PHONY: $(1)-clean-modules
+CLEANS += $(1)-clean-modules
+$(1)-clean-source:
+ rm -rf $($(1).source)
+.PHONY: $(1)-clean-source
+CLEANS += $(1)-clean-source
+$(1)-clean-tarball:
+ rm -rf $($(1).tarballs)
+.PHONY: $(1)-clean-tarball
+CLEANS += $(1)-clean-tarball
+$(1)-clean-build:
+ rm -rf BUILD/$(notdir $($(1).source))
+CLEANS += $(1)-clean-build
+$(1)-clean-rpms:
+ rm -rf $($(1).rpms)
+.PHONY: $(1)-clean-rpms
+CLEANS += $(1)-clean-rpms
+$(1)-clean-srpm:
+ rm -rf $($(1).srpm)
+.PHONY: $(1)-clean-srpm
+CLEANS += $(1)-clean-srpm
+$(1)-clean-debian:
+ rm -rf DEBIAN/$(1)
+.PHONY: $(1)-clean-srpm
+CLEANS += $(1)-clean-srpm
+$(1)-codeclean: $(1)-clean-source $(1)-clean-tarball $(1)-clean-build $(1)-clean-rpms $(1)-clean-srpm $(1)-clean-debian
+$(1)-clean: $(1)-clean-modules $(1)-codeclean
+.PHONY: $(1)-codeclean $(1)-clean
+$(1)-clean-spec:
+ rm -rf $($(1).specpath)
+.PHONY: $(1)-clean-spec
+$(1)-clean-make:
+ rm -rf MAKE/$(1).mk
+.PHONY: $(1)-clean-make
+$(1)-distclean: $(1)-distclean1 $(1)-distclean2
+$(1)-distclean1: $(1)-clean-spec $(1)-clean-make
+$(1)-distclean2: $(1)-clean
+.PHONY: $(1)-distclean $(1)-distclean1 $(1)-distclean2
+endef
+
+$(foreach package,$(ALL),$(eval $(call target_clean,$(package))))
+
+### clean precisely
+clean:
+ $(MAKE) $(CLEANS)
+.PHONY: clean
+
+clean-help:
+ @echo Available clean targets
+ @echo $(CLEANS)
+
+### brute force clean
+distclean1:
+ rm -rf envfrompreviousrun.mk .rpmmacros spec2make header.spec SPECS MAKE $(DISTCLEANS)
+distclean2:
+ rm -rf MODULES SOURCES BUILD BUILDROOT RPMS SRPMS DEBIAN tmp
+distclean: distclean1 distclean2
+.PHONY: distclean1 distclean2 distclean
+
+develclean:
+ -$(RPMYUM-UNINSTALL-STOCK) $(ALL-STOCK-DEVEL-RPMS)
+
+####################
+# gather build information for the 'About' page
+# when run from crontab, INIT_CWD not properly set (says /root ..)
+# so, the nightly build passes BASE here
+# also store BASE in .base for any post-processing purposes
+myplc-release:
+ @echo 'Creating myplc-release'
+ rm -f $@
+ echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx build info" >> $@
+ $(MAKE) --no-print-directory version-build >> $@
+ echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx svn info" >> $@
+ $(MAKE) --no-print-directory version-tags >> $@
+ echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx rpm info" >> $@
+ $(MAKE) --no-print-directory version-rpms >> $@
+ @echo $(BASE) > .base
+
+version-build:
+ @echo -n 'Build build-date: ' ; date '+%Y.%m.%d'
+ @echo -n 'Build build-time: ' ; date '+%H:%M-%Z'
+ @echo -n 'Build build-hostname: ' ; hostname
+ @echo "Build build-base: $(BASE)"
+ @echo "Build planetlab-distro: $(PLDISTRO)"
+ @echo "Build planetlab-tags: $(PLDISTROTAGS)"
+ @echo "Build target-arch: $(HOSTARCH)"
+ @echo "Build target-distro: $(DISTRO)"
+ @echo "Build target-distroname: $(DISTRONAME)"
+ @echo "Build target-release: $(RELEASE)"
+ @echo "Build target-personality: $(PERSONALITY)"
+
+####################
+# for a given module
+VFORMAT="%30s := %s\n"
+define print_tag_target
+$(1)-version-tag:
+ @$(if $($(1)-SVNPATH),\
+ printf $(VFORMAT) $(1)-SVNPATH "$($(1)-SVNPATH)",\
+ printf $(VFORMAT) $(1)-GITPATH "$($(1)-GITPATH)" )
+endef
+
+$(foreach module,$(ALL.modules), $(eval $(call print_tag_target,$(module))))
+
+version-tags: $(foreach module, $(ALL.modules), $(module)-version-tag)
+
+RFORMAT="%20s :: version=%s release=%s\n"
+define rpm_version_target
+$(1)-version-rpm:
+ @printf $(RFORMAT) $($(1).rpm-name) $($(1).rpm-version) $($(1).rpm-release)
+version-rpms: $(1)-version-rpm
+endef
+
+$(foreach package,$(sort $(ALL)), $(eval $(call rpm_version_target,$(package))))
+
+versions: myplc-release version-build version-tags version-rpms
+.PHONY: versions version-build version-rpms version-tags
+
+#################### package info
+PKGKEYS := tarballs source srpm rpms rpmnames rpm-release rpm-name rpm-version rpm-subversion
+%-pkginfo: package=$(subst -pkginfo,,$@)
+%-pkginfo:
+ @$(foreach key,$(PKGKEYS),echo "$(package).$(key)=$($(package).$(key))";)
+## rpm info
+RPMKEYS := rpm-path package
+%-rpminfo: rpm=$(subst -rpminfo,,$@)
+%-rpminfo:
+ @$(foreach key,$(RPMKEYS),echo "$(rpm).$(key)=$($(rpm).$(key))";)
+
+#################### various lists - designed to run with stage1=true
+info-packages:
+ @$(foreach package,$(ALL), echo package=$(package) ref_module=$($(package).module) modules=$($(package)-MODULES) rpmnames=$($(package).rpmnames); )
+
+info-modules:
+ @$(foreach module,$(ALL.modules), echo module=$(module) \
+ $(if $($(module)-SVNPATH),svnpath=$($(module)-SVNPATH),gitpath=$($(module)-GITPATH)) ; )
+
+info-branches:
+ @$(foreach module,$(ALL.modules), \
+ $(if $($(module)-BRANCH),echo module=$(module) branch=$($(module)-BRANCH);))
+
+module-tools:
+ @$(foreach module,$(ALL.modules), \
+ $(if $($(module)-GITPATH), \
+ $(if $($(module)-BRANCH), \
+ echo $(module):$($(module)-BRANCH); , \
+ echo $(module); ), \
+ $(if $($(module)-BRANCH), \
+ echo $(module):$($(module)-BRANCH); , \
+ echo $(module); )))
+
+info: info-packages info-modules info-branches
+
+.PHONY: info info-packages info-modules info-branches module-tools
+
+show-multi-modules:
+ @$(foreach package,$(ALL),$(if $(subst x1,,x$(words $($(package)-MODULES))), echo p=$(package) mods=$($(package)-MODULES) ;))
+.PHONY: show-multi-modules
+####################
+help:
+ @echo "********** Run make in two stages:"
+ @echo ""
+ @echo "make stage1=true PLDISTRO=onelab"
+ @echo " -> extracts all spec files in SPECS/ and mk files in MAKE/"
+ @echo " as well as save PLDISTRO for subsequent runs"
+ @echo ""
+ @echo "********** Then you can use the following targets"
+ @echo 'make'
+ @echo " rebuilds everything"
+ @echo 'make util-vserver'
+ @echo " makes the RPMS related to util-vserver"
+ @echo " equivalent to 'make util-vserver-rpms'"
+ @echo ""
+ @echo "********** Or, vertically - step-by-step for a given package"
+ @echo 'make util-vserver-source'
+ @echo " creates source link in SOURCES/util-vserver-<version>"
+ @echo 'make util-vserver-tarball'
+ @echo " creates source tarball in SOURCES/util-vserver-<version>.<tarextension>"
+ @echo 'make util-vserver-srpm'
+ @echo " build source rpm in SRPMS/"
+ @echo 'make util-vserver-rpms'
+ @echo " build rpm(s) in RPMS/"
+ @echo ""
+ @echo "********** Or, horizontally, reach a step for all known packages"
+ @echo 'make sources'
+ @echo 'make tarballs'
+ @echo 'make srpms'
+ @echo 'make rpms'
+ @echo ""
+ @echo "********** Manual targets"
+ @echo "make package-compile"
+ @echo " The regular process uses rpmbuild --rebuild, that performs"
+ @echo " a compilation directory cleanup upon completion. If you need to investigate"
+ @echo " the intermediate compilation directory, use the -compile targets"
+ @echo "********** Cleaning examples"
+ @echo "make clean"
+ @echo " removes the files made by make"
+ @echo "make distclean"
+ @echo " brute-force cleaning, removes entire directories - requires a new stage1"
+ @echo "make develclean"
+ @echo " rpm-uninstalls all devel packages installed during build"
+ @echo ""
+ @echo "make iptables-distclean"
+ @echo " deep clean for a given package"
+ @echo "make iptables-codeclean"
+ @echo " run this if you've made a local/manual change in the MODULES area for iptables"
+ @echo ""
+ @echo "make util-vserver-clean"
+ @echo " removes codebase, source, tarball, build, rpm and srpm for util-vserver"
+ @echo "make util-vserver-clean-modules"
+ @echo " and so on for source, tarball, build, rpm and srpm"
+ @echo ""
+ @echo "********** Info examples"
+ @echo "make ++ALL"
+ @echo " Displays the value of a given variable (here ALL)"
+ @echo " with only a single plus sign only the value is displayed"
+ @echo "make info"
+ @echo " is equivalent to make packages modules branches"
+ @echo " provides various info on these objects"
+ @echo "make ulogd-pkginfo"
+ @echo " Displays know attributes of a package"
+ @echo "make kernel-devel-rpminfo"
+ @echo " Displays know attributes of an rpm"
+ @echo "make stage1=true PLDISTROTAGS=planetlab-tags-4.2.mk packages modules branches module-tools"
+ @echo " Lists mentioned items - module-tools is used in modules.update"
+ @echo ""
+ @echo "********** Known pakages are"
+ @echo "$(ALL)"
+
+#################### convenience, for debugging only
+# make +foo : prints the value of $(foo)
+# make ++foo : idem but verbose, i.e. foo=$(foo)
+++%: varname=$(subst +,,$@)
+++%:
+ @echo "$(varname)=$($(varname))"
++%: varname=$(subst +,,$@)
++%:
+ @echo "$($(varname))"