aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 2 insertions, 38 deletions
diff --git a/Makefile b/Makefile
index 924c62ee4d61..86b66cf85ced 100644
--- a/Makefile
+++ b/Makefile
@@ -968,7 +968,7 @@ endif
968prepare2: prepare3 outputmakefile 968prepare2: prepare3 outputmakefile
969 969
970prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ 970prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
971 include/asm include/config/auto.conf 971 include/config/auto.conf
972 $(cmd_crmodverdir) 972 $(cmd_crmodverdir)
973 973
974archprepare: prepare1 scripts_basic 974archprepare: prepare1 scripts_basic
@@ -980,42 +980,6 @@ prepare0: archprepare FORCE
980# All the preparing.. 980# All the preparing..
981prepare: prepare0 981prepare: prepare0
982 982
983# The asm symlink changes when $(ARCH) changes.
984# Detect this and ask user to run make mrproper
985# If asm is a stale symlink (point to dir that does not exist) remove it
986define check-symlink
987 set -e; \
988 if [ -L include/asm ]; then \
989 asmlink=`readlink include/asm | cut -d '-' -f 2`; \
990 if [ "$$asmlink" != "$(SRCARCH)" ]; then \
991 echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \
992 echo " set ARCH or save .config and run 'make mrproper' to fix it"; \
993 exit 1; \
994 fi; \
995 test -e $$asmlink || rm include/asm; \
996 elif [ -d include/asm ]; then \
997 echo "ERROR: $@ is a directory but a symlink was expected";\
998 exit 1; \
999 fi
1000endef
1001
1002# We create the target directory of the symlink if it does
1003# not exist so the test in check-symlink works and we have a
1004# directory for generated filesas used by some architectures.
1005define create-symlink
1006 if [ ! -L include/asm ]; then \
1007 $(kecho) ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \
1008 if [ ! -d include/asm-$(SRCARCH) ]; then \
1009 mkdir -p include/asm-$(SRCARCH); \
1010 fi; \
1011 ln -fsn asm-$(SRCARCH) $@; \
1012 fi
1013endef
1014
1015include/asm: FORCE
1016 $(Q)$(check-symlink)
1017 $(Q)$(create-symlink)
1018
1019# Generate some files 983# Generate some files
1020# --------------------------------------------------------------------------- 984# ---------------------------------------------------------------------------
1021 985
@@ -1184,7 +1148,7 @@ CLEAN_FILES += vmlinux System.map \
1184 1148
1185# Directories & files removed with 'make mrproper' 1149# Directories & files removed with 'make mrproper'
1186MRPROPER_DIRS += include/config usr/include include/generated 1150MRPROPER_DIRS += include/config usr/include include/generated
1187MRPROPER_FILES += .config .config.old include/asm .version .old_version \ 1151MRPROPER_FILES += .config .config.old .version .old_version \
1188 include/linux/autoconf.h include/linux/version.h \ 1152 include/linux/autoconf.h include/linux/version.h \
1189 include/linux/utsrelease.h \ 1153 include/linux/utsrelease.h \
1190 Module.symvers Module.markers tags TAGS cscope* 1154 Module.symvers Module.markers tags TAGS cscope*