backports: catch make in backport template directory
authorJohannes Berg <johannes.berg@intel.com>
Tue, 28 May 2013 20:33:14 +0000 (22:33 +0200)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Tue, 28 May 2013 22:10:39 +0000 (15:10 -0700)
Catch running make in the backport template directory by
checking for the .local-symbols file. If it isn't there
then we're in the input/template directory rather than in
an output tree, give the user a hint about it instead of
keeling over.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backport/Makefile

index 287b27de28483b91f71be62f944c0902eb1c86d3..421a4f65198bf2d4ce1bad38e7437239b60ffe79 100644 (file)
@@ -37,6 +37,18 @@ mrproper:
        @rm -f backport-include/backport/autoconf.h
 
 .DEFAULT:
+       @set -e ; test -f .local-symbols || (                                           \
+       echo "/--------------"                                                          ;\
+       echo "| You shouldn't run make in the backports tree, but only in"              ;\
+       echo "| the generated output. This here is only the skeleton code"              ;\
+       echo "| copied into the output directory. To use the backport system"           ;\
+       echo "| from scratch, go into the top-level directory and run"                  ;\
+       echo "| ./gentree.py /path/to/linux-next/ /tmp/output"                          ;\
+       echo "| and then make menuconfig/... in the output directory. See"              ;\
+       echo "| ./gentree.py --help"                                                    ;\
+       echo "| for more options."                                                      ;\
+       echo "\\--"                                                                     ;\
+       false)
        @set -e ; test -f $(KERNEL_CONFIG) || (                                         \
        echo "/--------------"                                                          ;\
        echo "| Your kernel headers are incomplete/not installed."                      ;\