[llvmlinux] [PATCH 1/2] Put state files in ${STATEDIR}

Daniel Sanders daniel.sanders at imgtec.com
Tue Aug 18 16:03:45 UTC 2015


Signed-off-by: Daniel Sanders <daniel.sanders at imgtec.com>
---
 arch/all/all.mk                    | 48 +++++++++++++++++++-------------------
 arch/all/quilt.mk                  |  6 ++---
 targets/beaglebone/Makefile        |  4 ++--
 targets/cubieboard/Makefile        |  8 +++----
 targets/for-linus/Makefile         |  6 ++---
 targets/for-russel/Makefile        |  6 ++---
 targets/i586/Makefile              |  6 ++---
 targets/ifc6410-linaro/Makefile    |  6 ++---
 targets/ifc6410/Makefile           |  6 ++---
 targets/malta/Makefile             | 16 ++++++-------
 targets/msm/Makefile               |  4 ++--
 targets/nexus4/Makefile            |  4 ++--
 targets/nexus5/Makefile            |  4 ++--
 targets/nexus7/Makefile            |  4 ++--
 targets/panda-linaro/Makefile      |  8 +++----
 targets/rpi/Makefile               |  4 ++--
 targets/rpi2/Makefile              |  4 ++--
 targets/template/Makefile          |  4 ++--
 targets/vexpress/Makefile          | 32 ++++++++++++-------------
 targets/vexpress64/Makefile        |  8 +++----
 targets/x86_64-linux-next/Makefile | 12 +++++-----
 targets/x86_64/Makefile            | 12 +++++-----
 targets/x86_64_tiny/Makefile       | 12 +++++-----
 23 files changed, 112 insertions(+), 112 deletions(-)

diff --git a/arch/all/all.mk b/arch/all/all.mk
index ab488b9..526651d 100644
--- a/arch/all/all.mk
+++ b/arch/all/all.mk
@@ -314,8 +314,8 @@ kernel-raze::
 	@$(call leavestate,${STATEDIR},*)
 
 #############################################################################
-kernel-fetch: state/kernel-fetch
-state/kernel-fetch: ${SHARED_KERNEL} state/prep
+kernel-fetch: ${STATEDIR}/kernel-fetch
+${STATEDIR}/kernel-fetch: ${SHARED_KERNEL} ${STATEDIR}/prep
 	@$(call banner,Cloning kernel...)
 	@mkdir -p ${SRCDIR}
 	@[ -z "${KERNEL_BRANCH}" ] || $(call echo,Checking out kernel branch...)
@@ -331,8 +331,8 @@ state/kernel-fetch: ${SHARED_KERNEL} state/prep
 	$(call state,$@,kernel-patch)
 
 #############################################################################
-kernel-patch: state/kernel-patch
-state/kernel-patch: state/kernel-fetch state/kernel-quilt
+kernel-patch: ${STATEDIR}/kernel-patch
+${STATEDIR}/kernel-patch: ${STATEDIR}/kernel-fetch ${STATEDIR}/kernel-quilt
 	@$(call banner,Patching kernel...)
 	@echo ${PATCHDIR}
 	$(call patches_dir,${PATCHDIR},${KERNELDIR}/patches)
@@ -341,7 +341,7 @@ state/kernel-patch: state/kernel-fetch state/kernel-quilt
 	$(call state,$@,kernel-configure)
 
 #############################################################################
-kernel-unpatch: state/kernel-fetch state/kernel-quilt
+kernel-unpatch: ${STATEDIR}/kernel-fetch ${STATEDIR}/kernel-quilt
 	@$(call banner,Unpatching kernel...)
 	@$(call unpatch,${KERNELDIR})
 	@$(call optional_gitreset,${KERNELDIR})
@@ -368,8 +368,8 @@ kernel-patch-status-leftover:
 	@$(call patch_series_status_leftover,${PATCHDIR})
 
 #############################################################################
-kernel-configure: state/kernel-configure
-state/kernel-configure: state/kernel-patch ${TMPFS_MOUNT} ${KERNEL_CFG} ${STATE_CLANG_TOOLCHAIN} ${STATE_TOOLCHAIN}
+kernel-configure: ${STATEDIR}/kernel-configure
+${STATEDIR}/kernel-configure: ${STATEDIR}/kernel-patch ${TMPFS_MOUNT} ${KERNEL_CFG} ${STATE_CLANG_TOOLCHAIN} ${STATE_TOOLCHAIN}
 	@make -s build-dep-check
 	@$(call banner,Configuring kernel...)
 	@mkdir -p ${KERNEL_BUILD}
@@ -388,31 +388,31 @@ state/kernel-configure: state/kernel-patch ${TMPFS_MOUNT} ${KERNEL_CFG} ${STATE_
 	$(call state,$@,kernel-build)
 
 #############################################################################
-kernel-allyesconfig kernel-allmodconfig: kernel-%: state/kernel-configure
+kernel-allyesconfig kernel-allmodconfig: kernel-%: ${STATEDIR}/kernel-configure
 	(cd ${KERNELDIR} && echo "" | make ${KERNEL_ENV} ${MAKE_FLAGS} $*)
 
 #############################################################################
-kernel-menuconfig: state/kernel-configure
+kernel-menuconfig: ${STATEDIR}/kernel-configure
 	@make -C ${KERNELDIR} ${KERNEL_ENV} ${MAKE_FLAGS} menuconfig
 	@$(call leavestate,${STATEDIR},kernel-build)
 
-kernel-cmpconfig: state/kernel-configure
+kernel-cmpconfig: ${STATEDIR}/kernel-configure
 	diff -Nau ${KERNEL_CFG} ${KERNEL_BUILD}/.config
 
-kernel-cpconfig: state/kernel-configure
+kernel-cpconfig: ${STATEDIR}/kernel-configure
 	@cp -v ${KERNEL_BUILD}/.config ${KERNEL_CFG}
 
 #############################################################################
-kernel-cscope: state/kernel-configure
+kernel-cscope: ${STATEDIR}/kernel-configure
 	@make -C ${KERNELDIR} ${KERNEL_ENV} ${MAKE_FLAGS} cscope
 cscope:
 	@(cd ${KERNELDIR}; cscope)
-kernel-tags: state/kernel-configure
+kernel-tags: ${STATEDIR}/kernel-configure
 	make -C ${KERNELDIR} ${KERNEL_ENV} ${MAKE_FLAGS} tags
 
 #############################################################################
-kernel-gcc-configure: state/kernel-gcc-configure
-state/kernel-gcc-configure: state/kernel-patch ${TMPFS_MOUNT} ${KERNEL_CFG} ${STATE_TOOLCHAIN}
+kernel-gcc-configure: ${STATEDIR}/kernel-gcc-configure
+${STATEDIR}/kernel-gcc-configure: ${STATEDIR}/kernel-patch ${TMPFS_MOUNT} ${KERNEL_CFG} ${STATE_TOOLCHAIN}
 	@make -s build-dep-check
 	@$(call banner,Configuring gcc kernel...)
 	@mkdir -p ${KERNELGCC_BUILD}
@@ -421,12 +421,12 @@ state/kernel-gcc-configure: state/kernel-patch ${TMPFS_MOUNT} ${KERNEL_CFG} ${ST
 	$(call state,$@,kernel-gcc-build)
 
 #############################################################################
-kernel-gcc-allyesconfig: state/kernel-gcc-configure
+kernel-gcc-allyesconfig: ${STATEDIR}/kernel-gcc-configure
 	(cd ${KERNELDIR} && echo "" | ${KERNELGCC_ENV} make ${MAKE_FLAGS} allyesconfig)
 
 #############################################################################
-kernel-build:: state/kernel-build
-state/kernel-build: state/kernel-configure
+kernel-build:: ${STATEDIR}/kernel-build
+${STATEDIR}/kernel-build: ${STATEDIR}/kernel-configure
 	@[ -d ${KERNEL_BUILD} ] || ($(call leavestate,${STATEDIR},kernel-configure) && ${MAKE} kernel-configure)
 	@$(MAKE) kernel-quilt-link-patches
 	@$(call banner,Building kernel with clang...)
@@ -441,8 +441,8 @@ state/kernel-build: state/kernel-configure
 	$(call state,$@,done)
 
 #############################################################################
-kernel-gcc-build: state/kernel-gcc-build
-state/kernel-gcc-build: state/kernel-gcc-configure
+kernel-gcc-build: ${STATEDIR}/kernel-gcc-build
+${STATEDIR}/kernel-gcc-build: ${STATEDIR}/kernel-gcc-configure
 	@[ -d ${KERNELGCC_BUILD} ] || ($(call leavestate,${STATEDIR},kernel-gcc-configure) && ${MAKE} kernel-gcc-configure)
 	@$(MAKE) kernel-quilt-link-patches
 	@$(call banner,Building kernel with gcc...)
@@ -462,21 +462,21 @@ kernel-gcc-build-pristine:
 	@$(MAKE) kernel-unpatch NO_PATCH=1 series kernel-gcc-build
 
 #############################################################################
-kernel-scan-build: ${STATE_CLANG_TOOLCHAIN} ${STATE_TOOLCHAIN} state/kernel-configure
+kernel-scan-build: ${STATE_CLANG_TOOLCHAIN} ${STATE_TOOLCHAIN} ${STATEDIR}/kernel-configure
 	@$(call assert_found_in_path,ccc-analyzer,"(prebuilt and native clang doesn't always provide ccc-analyzer)")
 	@$(eval CHECKER := ${SCAN_BUILD} ${SCAN_BUILD_FLAGS})
 	@$(call banner,Enabling clang static analyzer: ${CHECKER})
 	${MAKE} CHECKER="${CHECKER}" CC=ccc-analyzer kernel-build
 
 #############################################################################
-kernel-check-build: ${STATE_CLANG_TOOLCHAIN} ${STATE_TOOLCHAIN} state/kernel-configure
+kernel-check-build: ${STATE_CLANG_TOOLCHAIN} ${STATE_TOOLCHAIN} ${STATEDIR}/kernel-configure
 	@$(eval CHECK_VARS := C=1 CHECK=${CLANG} CHECKFLAGS=--analyze)
 	@$(call banner,Enabling clang static analyzer as you go: ${CLANG} --analyze)
 	${MAKE} CHECK_VARS="${CHECK_VARS}" kernel-build
 
 #############################################################################
 kernel-build-force kernel-gcc-build-force: %-force:
-	@rm -f state/$*
+	@rm -f ${STATEDIR}/$*
 	${MAKE} $*
 
 ##############################################################################
@@ -516,7 +516,7 @@ kernel-shared-sync:
 	@$(call git,${SHARED_KERNEL},fetch origin +refs/heads/*:refs/heads/*)
 
 #############################################################################
-kernel-sync: state/kernel-fetch kernel-clean kernel-shared-sync
+kernel-sync: ${STATEDIR}/kernel-fetch kernel-clean kernel-shared-sync
 	@$(call banner,Syncing kernel...)
 	@$(call check_llvmlinux_commit,${CONFIG})
 	-@$(call gitabort,${KERNELDIR})
diff --git a/arch/all/quilt.mk b/arch/all/quilt.mk
index 23fd51c..995da36 100644
--- a/arch/all/quilt.mk
+++ b/arch/all/quilt.mk
@@ -149,7 +149,7 @@ ignore_if_empty = perl -ne '{chomp; print "$$_\n" unless -z "${1}/$$_"}'
 
 ##############################################################################
 # Generate git log cache file
-${KERNEL_LOG_CACHE}: state/kernel-fetch ${KERNELDIR}/.git
+${KERNEL_LOG_CACHE}: ${STATEDIR}/kernel-fetch ${KERNELDIR}/.git
 	@mkdir -p $(dir $@)
 	@cd ${KERNELDIR} ; \
 	if [ -f $@ ] ; then \
@@ -271,9 +271,9 @@ ${KERNEL_PATCHES_TAR}: kernel-quilt-link-patches
 	@$(call banner,Created $@)
 
 ##############################################################################
-QUILT_STATE	= state/kernel-quilt
+QUILT_STATE	= ${STATEDIR}/kernel-quilt
 kernel-quilt: ${QUILT_STATE}
-${QUILT_STATE}: state/prep state/kernel-fetch 
+${QUILT_STATE}: ${STATEDIR}/prep ${STATEDIR}/kernel-fetch
 	@$(MAKE) ${QUILTRC} kernel-quilt-link-patches
 	@$(call banner,Quilted kernel...)
 	$(call state,$@,kernel-patch)
diff --git a/targets/beaglebone/Makefile b/targets/beaglebone/Makefile
index 250eccc..68f8622 100644
--- a/targets/beaglebone/Makefile
+++ b/targets/beaglebone/Makefile
@@ -53,8 +53,8 @@ KERNEL_PATCH_DIR	+= ${PATCHDIR} ${PATCHDIR}/${KERNEL_REPO_PATCHES}
 
 include ${CONFIG}
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
diff --git a/targets/cubieboard/Makefile b/targets/cubieboard/Makefile
index c5b3e6a..fcfaf57 100644
--- a/targets/cubieboard/Makefile
+++ b/targets/cubieboard/Makefile
@@ -100,8 +100,8 @@ ${KERNEL_CFG}: initramfs
 	sed -i -e 's/CONFIG_DEVTMPFS_MOUNT/#CONFIG_DEVTMPFS_MOUNT/' $@
 
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
@@ -116,7 +116,7 @@ parse-qemulog:
 
 # Create the generic initramfs, add in the kernel modules, then create the cpio
 # Allwinner config does not have module support enabled
-test2: state/prep ${QEMUSTATE}/qemu-build state/kernel-build initramfs-unpacked
+test2: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${STATEDIR}/kernel-build initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
 	@rm -f ${INITRAMFS}
@@ -124,7 +124,7 @@ test2: state/prep ${QEMUSTATE}/qemu-build state/kernel-build initramfs-unpacked
 	../../test/qemu/install/bin/qemu-system-arm -M ${BOARD} -kernel ${KERNEL_BUILD}/${ZIMAGE} -serial stdio -append "console=ttyS0 rw root=/dev/ram0 rdinit=/init" -dtb ${KERNEL_BUILD}/${KERNEL_DTB} -display none
 
 # Allwinner config does not have module support enabled
-test2-gcc: state/prep ${QEMUSTATE}/qemu-build ${KERNELGCCDTB_IMG} initramfs-unpacked
+test2-gcc: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${KERNELGCCDTB_IMG} initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
 	@rm -f ${INITRAMFS}
diff --git a/targets/for-linus/Makefile b/targets/for-linus/Makefile
index 037071a..cd53c3f 100644
--- a/targets/for-linus/Makefile
+++ b/targets/for-linus/Makefile
@@ -68,8 +68,8 @@ GIT_SEND_EMAIL_OPTS += -cc pageexec at freemail.hu
 endif
 
 #############################################################################
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
@@ -105,7 +105,7 @@ kernel-patch-for-linus-series:
 
 #############################################################################
 # Create the generic initramfs, add in the kernel modules, then create the cpio
-test: state/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
+test: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib/modules
 	(cd ${KERNEL_BUILD} && make V=0 INSTALL_MOD_PATH=${INITBUILDFSDIR} modules_install 2>&1 > /dev/null)
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
diff --git a/targets/for-russel/Makefile b/targets/for-russel/Makefile
index a7b87e3..fc25d0a 100644
--- a/targets/for-russel/Makefile
+++ b/targets/for-russel/Makefile
@@ -48,8 +48,8 @@ TARGETS+= clean mrproper
 .PHONY: prep clean mrproper
 
 #############################################################################
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
@@ -85,7 +85,7 @@ kernel-patch-for-russel-series:
 
 #############################################################################
 # Create the generic initramfs, add in the kernel modules, then create the cpio
-test: state/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
+test: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib/modules
 	(cd ${KERNEL_BUILD} && make V=0 INSTALL_MOD_PATH=${INITBUILDFSDIR} modules_install 2>&1 > /dev/null)
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
diff --git a/targets/i586/Makefile b/targets/i586/Makefile
index 035ceb5..6bf281d 100644
--- a/targets/i586/Makefile
+++ b/targets/i586/Makefile
@@ -55,8 +55,8 @@ KERNEL_PATCH_DIR += ${PATCHDIR}/${KERNEL_REPO_PATCHES}
 TARGETS+= clean mrproper test test2
 .PHONY: test test2 fetch-initrd prep clean mrproper
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
@@ -68,6 +68,6 @@ mrproper: clean kernel-mrproper kernel-gcc-mrproper tmp-mrproper
 	@rm -rf ${LOGDIR}/*
 	@$(call banner,Very Clean)
 
-test: ${QEMUSTATE}/qemu-build initramfs state/kernel-build
+test: ${QEMUSTATE}/qemu-build initramfs ${STATEDIR}/kernel-build
 	@$(call qemu,${BOARD},${KERNELDIR},768,/dev/ram0,init=/init,-initrd initramfs.img)
 
diff --git a/targets/ifc6410-linaro/Makefile b/targets/ifc6410-linaro/Makefile
index 83238b5..c4504be 100644
--- a/targets/ifc6410-linaro/Makefile
+++ b/targets/ifc6410-linaro/Makefile
@@ -61,8 +61,8 @@ include ${CONFIG}
 TARGETS+= kernel-autopatch clean mrproper
 .PHONY: kernel-copy clean mrproper
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
@@ -74,7 +74,7 @@ mrproper: clean kernel-mrproper kernel-gcc-mrproper tmp-mrproper
 	@rm -rf ${LOGDIR}/*
 	@$(call banner,Very Clean)
 
-${KERNELDTB_IMG}: state/kernel-build
+${KERNELDTB_IMG}: ${STATEDIR}/kernel-build
 	cat ${KERNELDIR}/fixup.bin ${KERNEL_BUILD}/${ZIMAGE} ${KERNEL_BUILD}/${KERNEL_DTB} > $@
 
 # See http://mydragonboard.org/2013/forcing-ifc6410-into-fastboot/
diff --git a/targets/ifc6410/Makefile b/targets/ifc6410/Makefile
index ca7fd80..272fec3 100644
--- a/targets/ifc6410/Makefile
+++ b/targets/ifc6410/Makefile
@@ -62,8 +62,8 @@ include ${CONFIG}
 TARGETS+= kernel-autopatch clean mrproper
 .PHONY: kernel-copy clean mrproper
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
@@ -75,7 +75,7 @@ mrproper: clean kernel-mrproper kernel-gcc-mrproper tmp-mrproper
 	@rm -rf ${LOGDIR}/*
 	@$(call banner,Very Clean)
 
-${KERNELDTB_IMG}: state/kernel-build 
+${KERNELDTB_IMG}: ${STATEDIR}/kernel-build 
 	cat ${TARGETDIR}/test/fixup.bin ${KERNEL_BUILD}/${ZIMAGE} ${KERNEL_BUILD}/${KERNEL_DTB} > $@
 
 # See http://mydragonboard.org/2013/forcing-ifc6410-into-fastboot/
diff --git a/targets/malta/Makefile b/targets/malta/Makefile
index 28b7d77..ce1601f 100644
--- a/targets/malta/Makefile
+++ b/targets/malta/Makefile
@@ -59,8 +59,8 @@ include ${ARCHDIR}/${ARCH}/${ARCH}.mk
 include ${CONFIG}
 
 KERNEL_PATCH_DIR	+= ${PATCHDIR} ${PATCHDIR}/${KERNEL_REPO_PATCHES}
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
@@ -80,19 +80,19 @@ initramfs-unpacked::
 	tar -C initramfs-overlay -c -z -f initramfs-overlay.tar.gz .
 	tar -C ${INITBUILDFSDIR} -x -z -f initramfs-overlay.tar.gz
 
-test-gcc: state/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
+test-gcc: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
 	$(call qemu_mips,${BOARD},${KERNELGCC_BUILD}/vmlinux,256,/dev/ram0,rw,-initrd ${INITRAMFS} -net none)
 
-test: state/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
+test: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
 	$(call qemu_mips,${BOARD},${KERNEL_BUILD}/vmlinux,256,/dev/ram0,rw,-initrd ${INITRAMFS} -net none)
 
-test-gdb: state/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
+test-gdb: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
 	( $(call qemu_mips,${BOARD},${KERNEL_BUILD}/vmlinux,256,/dev/ram0,rw console=ttyS0 debug user_debug=-1 earlyprintk initcall.debug,-initrd ${INITRAMFS} -net none -s -S) &)
 	@(echo "set output-radix 16" > .gdbinit ; echo "target remote localhost:1234" >> .gdbinit )
 	(${CROSS_GDB} ${KERNEL_BUILD}/vmlinux)
 	(killall -s 9 qemu-system-mips)
 
-test-qemu-debug: state/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
+test-qemu-debug: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
 	( $(call qemu_mips,${BOARD},${KERNEL_BUILD}/vmlinux,256,/dev/ram0,rw console=ttyS0 earlyprintk initcall.debug ,-initrd ${INITRAMFS} -net none -D qemulog.log -d in_asm,op,int,exec,cpu,) & )
 	( sleep 20 && killall -s 9 qemu-system-mips ) || exit 0
 	grep ^0x qemulog.log > debugaddr.log
@@ -101,11 +101,11 @@ test-qemu-debug: state/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
 	for i in `tac addresses.log` ; do addr2line -f -p -e ${KERNEL_BUILD}/vmlinux $$i >> a2l.log ; done
 
 kernel-gcc-test:: test-gcc-boot-poweroff
-test-gcc-boot-poweroff: state/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
+test-gcc-boot-poweroff: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
 	$(call qemu_mips,${BOARD},${KERNELGCC_BUILD}/vmlinux,256,/dev/ram0,rw POWEROFF,-initrd ${INITRAMFS} -net none)
 
 kernel-test:: test-boot-poweroff
-test-boot-poweroff: state/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
+test-boot-poweroff: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${INITRAMFS} buildroot-build
 	$(call qemu_mips,${BOARD},${KERNEL_BUILD}/vmlinux,256,/dev/ram0,rw POWEROFF,-initrd ${INITRAMFS} -net none)
 
 clean: kernel-clean kernel-gcc-clean ${BOARD}-clean
diff --git a/targets/msm/Makefile b/targets/msm/Makefile
index 35781de..fc008d3 100644
--- a/targets/msm/Makefile
+++ b/targets/msm/Makefile
@@ -51,8 +51,8 @@ include ${CONFIG}
 TARGETS+= kernel-autopatch clean mrproper
 .PHONY: kernel-copy clean mrproper
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
diff --git a/targets/nexus4/Makefile b/targets/nexus4/Makefile
index 5e48593..e7a77d6 100644
--- a/targets/nexus4/Makefile
+++ b/targets/nexus4/Makefile
@@ -51,8 +51,8 @@ KERNEL_PATCH_DIR	+= ${TARGETDIR}/patches
 TARGETS+= check-dups kernel-autopatch clean mrproper
 .PHONY: kernel-copy clean mrproper
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR} ${TARGETDIR}/patches
 	$(call state,$@)
diff --git a/targets/nexus5/Makefile b/targets/nexus5/Makefile
index 7bec92b..5212338 100644
--- a/targets/nexus5/Makefile
+++ b/targets/nexus5/Makefile
@@ -51,8 +51,8 @@ KERNEL_PATCH_DIR	+= ${TARGETDIR}/patches
 TARGETS+= check-dups kernel-autopatch clean mrproper
 .PHONY: kernel-copy clean mrproper
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR} ${TARGETDIR}/patches
 	$(call state,$@)
diff --git a/targets/nexus7/Makefile b/targets/nexus7/Makefile
index 1e3c37f..47438ad 100644
--- a/targets/nexus7/Makefile
+++ b/targets/nexus7/Makefile
@@ -51,8 +51,8 @@ KERNEL_PATCH_DIR	+= ${TARGETDIR}/patches
 TARGETS+= check-dups kernel-autopatch clean mrproper
 .PHONY: kernel-copy clean mrproper
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR} ${TARGETDIR}/patches
 	$(call state,$@)
diff --git a/targets/panda-linaro/Makefile b/targets/panda-linaro/Makefile
index ae37fcc..25885c8 100644
--- a/targets/panda-linaro/Makefile
+++ b/targets/panda-linaro/Makefile
@@ -52,8 +52,8 @@ KERNEL_PATCH_DIR+= ${TARGETDIR}/patches
 TARGETS+= check-dups kernel-autopatch clean mrproper
 .PHONY: kernel-copy clean mrproper
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR} ${TARGETDIR}/patches
 	$(call state,$@)
@@ -89,10 +89,10 @@ ${INITRAMIMG}:
 
 KERNELDTB_IMG = ${TMPDIR}/kernel_dtb.img
 KERNELGCCDTB_IMG = ${TMPDIR}/kernelgcc_dtb.img
-${KERNELDTB_IMG}: state/kernel-build
+${KERNELDTB_IMG}: ${STATEDIR}/kernel-build
 	@$(call check-tmpfs,${KERNELDIR},${KERNEL_BUILD},kernel-mrproper $^)
 	cat ${KERNEL_BUILD}/${ZIMAGE} ${KERNEL_BUILD}/${KERNEL_DTB} > $@
-${KERNELGCCDTB_IMG}: state/kernel-gcc-build
+${KERNELGCCDTB_IMG}: ${STATEDIR}/kernel-gcc-build
 	@$(call check-tmpfs,${KERNELGCC},${KERNELGCC_BUILD},kernel-gcc-mrproper $^)
 	cat ${KERNELGCC_BUILD}/${ZIMAGE} ${KERNELGCC_BUILD}/${KERNEL_DTB} > $@
 
diff --git a/targets/rpi/Makefile b/targets/rpi/Makefile
index d4284df..3e85a5f 100644
--- a/targets/rpi/Makefile
+++ b/targets/rpi/Makefile
@@ -54,8 +54,8 @@ KERNEL_PATCH_DIR+= ${TARGETDIR}/patches
 include ${CONFIG}
 
 KERNEL_PATCH_DIR+= ${PATCHDIR} ${PATCHDIR}/${KERNEL_REPO_PATCHES}
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
diff --git a/targets/rpi2/Makefile b/targets/rpi2/Makefile
index e6aa500..cb48abc 100644
--- a/targets/rpi2/Makefile
+++ b/targets/rpi2/Makefile
@@ -48,8 +48,8 @@ KERNEL_PATCH_DIR+= ${TARGETDIR}/patches
 include ${CONFIG}
 
 KERNEL_PATCH_DIR+= ${PATCHDIR} ${PATCHDIR}/${KERNEL_REPO_PATCHES}
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
diff --git a/targets/template/Makefile b/targets/template/Makefile
index 5b5edd8..38e7155 100644
--- a/targets/template/Makefile
+++ b/targets/template/Makefile
@@ -67,8 +67,8 @@ include ${ARCHDIR}/${ARCH}/${ARCH}.mk
 include ${CONFIG}
 
 KERNEL_PATCH_DIR	+= ${PATCHDIR} ${PATCHDIR}/${KERNEL_REPO_PATCHES}
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
diff --git a/targets/vexpress/Makefile b/targets/vexpress/Makefile
index a68948e..ed7354a 100644
--- a/targets/vexpress/Makefile
+++ b/targets/vexpress/Makefile
@@ -98,14 +98,14 @@ vexpress-help:
 	@echo "* make clean		- Remove most built files"
 	@echo "* make mrproper		- Remove all downloaded and built files"
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
 
-#fetch-initrd: state/fetch-initrd
-#state/fetch-initrd:
+#fetch-initrd: ${STATEDIR}/fetch-initrd
+#${STATEDIR}/fetch-initrd:
 #	rm -f arm-test-0.2.tar.gz
 #	wget -nd -c "http://wiki.qemu.org/download/arm-test-0.2.tar.gz"
 #	tar -xzvf arm-test-0.2.tar.gz
@@ -115,42 +115,42 @@ INITRAMIMG	= ${TMPDIR}/initramfs.img
 ${INITRAMIMG}:
 	$(call get_prebuilt, $@)
 
-# state/fetch-initrd
-test: state/prep ${QEMUSTATE}/qemu-build state/kernel-build ${INITRAMIMG} buildroot-build
+# ${STATEDIR}/fetch-initrd
+test: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${STATEDIR}/kernel-build ${INITRAMIMG} buildroot-build
 	$(call qemu_arm_dtb,${BOARD},${KERNEL_BUILD}/${ZIMAGE},${KERNEL_BUILD}/${KERNEL_DTB},768,/dev/ram0,rw,-initrd ${INITRAMIMG} -net none -sd ${BUILDROOT_IMG})
 
-test-debug: state/prep state/kernel-build ${QEMUSTATE}/qemu-build ${INITRAMIMG}
+test-debug: ${STATEDIR}/prep ${STATEDIR}/kernel-build ${QEMUSTATE}/qemu-build ${INITRAMIMG}
 	$(call qemu_arm_dtb,${BOARD},${KERNEL_BUILD}/${ZIMAGE},${KERNEL_BUILD}/${KERNEL_DTB},256,/dev/ram0,rw,-initrd ${INITRAMIMG} -net none -D qemulog.log -d in_asm,op,int,exec,cpu,cpu_reset)
 
 parse-qemulog:
 	( rm a2llog ; for i in `cat qemulog.log | tail -n 500 | grep ^0x | cut -d":" -f1` ; do echo -n "$$i " >> a2llog ; addr2line -f -p -e src/linux/vmlinux $$i >> a2llog ; done )
 	( cat a2llog | more )
 
-# state/fetch-initrd
+# ${STATEDIR}/fetch-initrd
 kernel-test test-kill:: test-boot-poweroff
-test-boot-poweroff: state/prep state/kernel-build ${QEMUSTATE}/qemu-build ${INITRAMIMG}
+test-boot-poweroff: ${STATEDIR}/prep ${STATEDIR}/kernel-build ${QEMUSTATE}/qemu-build ${INITRAMIMG}
 	( $(call qemu_arm_dtb,${BOARD},${KERNEL_BUILD}/${ZIMAGE},${KERNEL_BUILD}/${KERNEL_DTB},256,/dev/ram0,rw,-initrd ${INITRAMIMG} -net none ) \
 		| tee ${TMPDIR}/qemu_log ) &
 	( sleep 10 && killall -s 9 qemu-system-arm ) || exit 0
 	@grep -a "SUCCESS" ${TMPDIR}/qemu_log
 
 kernel-gcc-test test-gcc-kill:: test-gcc-boot-poweroff
-test-gcc-boot-poweroff: state/prep state/kernel-gcc-build ${QEMUSTATE}/qemu-build ${INITRAMIMG}
+test-gcc-boot-poweroff: ${STATEDIR}/prep ${STATEDIR}/kernel-gcc-build ${QEMUSTATE}/qemu-build ${INITRAMIMG}
 	( $(call qemu_arm_dtb,${BOARD},${KERNELGCC_BUILD}/${ZIMAGE},${KERNELGCC_BUILD}/${KERNEL_DTB},256,/dev/ram0,ramdisk_size=65536 rw POWEROFF,-initrd ${INITRAMIMG} -net none) \
 		| tee ${TMPDIR}/qemu_gcc_log ) &
 	( sleep 10 && killall -s 9 qemu-system-arm ) || exit 0
 	@grep -a "SUCCESS" ${TMPDIR}/qemu_gcc_log
 
 # Create the generic initramfs, add in the kernel modules, then create the cpio
-test2: state/prep ${QEMUSTATE}/qemu-build ${KERNEL_BUILD}/${ZIMAGE},${KERNEL_BUILD}/${KERNEL_DTB} initramfs-unpacked
+test2: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${KERNEL_BUILD}/${ZIMAGE},${KERNEL_BUILD}/${KERNEL_DTB} initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib
 	(cd ${KERNELDIR} && ${KERNEL_ENV} make INSTALL_MOD_PATH=${INITBUILDFSDIR} ARCH=arm modules_install)
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
 	@rm -f ${INITRAMFS}
 	@make ${INITRAMFS}
-	@$(call qemu_arm_dtb,${BOARD},state/kernel-build,256,/dev/ram0,rdinit=/init,-initrd ${INITRAMFS})
+	@$(call qemu_arm_dtb,${BOARD},${STATEDIR}/kernel-build,256,/dev/ram0,rdinit=/init,-initrd ${INITRAMFS})
 
-test2-gcc: state/prep ${QEMUSTATE}/qemu-build state/kernel-gcc-build initramfs-unpacked
+test2-gcc: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${STATEDIR}/kernel-gcc-build initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib
 	(cd ${KERNELGCC} && make INSTALL_MOD_PATH=${INITBUILDFSDIR} ARCH=arm modules_install)
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
@@ -167,10 +167,10 @@ VEXPRESS_IMG	= ${TMPDIR}/vexpress.img
 ${VEXPRESS_IMG}: ${VEXPRESS_IMG_GZ}
 	gzip -dc $< > $@
 
-test3: state/prep ${QEMUSTATE}/qemu-build state/kernel-build ${VEXPRESS_IMG}
+test3: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${STATEDIR}/kernel-build ${VEXPRESS_IMG}
 	$(call qemu_arm_dtb,${BOARD},${KERNEL_BUILD}/${ZIMAGE},${KERNEL_BUILD}/${KERNEL_DTB},256,/dev/mmcblk0p2,rootfstype=ext4 init=/bin/bash,-sd ${VEXPRESS_IMG}) ${NET}
 
-test3-gcc: state/prep ${QEMUSTATE}/qemu-build state/kernel-gcc-build ${VEXPRESS_IMG}
+test3-gcc: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${STATEDIR}/kernel-gcc-build ${VEXPRESS_IMG}
 	@$(call qemu_arm_dtb,${BOARD},${KERNELGCC_BUILD}/${ZIMAGE},${KERNELGCC_BUILD}/${KERNEL_DTB},256,/dev/mmcblk0p2,rootfstype=ext4 init=/bin/bash,-sd ${VEXPRESS_IMG}) ${NET}
 
 BUILDROOT_IMG	= ${TMPDIR}/sd-rootfs-squashfs.img
@@ -178,7 +178,7 @@ ${BUILDROOT_IMG}: buildroot-build
 	@$(call banner,Building SD card for buildroot rootfs)
 	$(call buildroot-sdcard,images/rootfs.squashfs,$@)
 
-test4: state/prep ${QEMUSTATE}/qemu-build state/kernel-build ${BUILDROOT_IMG}
+test4: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${STATEDIR}/kernel-build ${BUILDROOT_IMG}
 	$(call qemu_arm_dtb,${BOARD},${KERNEL_BUILD}/${ZIMAGE},${KERNEL_BUILD}/${KERNEL_DTB},256,/dev/ram0,ramdisk_size=64M rw POWEROFF,-initrd ${BUILDROOT_CPIO}) ${NET}
 #	$(call qemu_arm_dtb,${BOARD},${KERNEL_BUILD}/${ZIMAGE},${KERNEL_BUILD}/${KERNEL_DTB},256,/dev/mtdblock1,rootfstype=squashfs rootwait init=/bin/bash,-sd ${BUILDROOT_IMG}) ${NET}
 
diff --git a/targets/vexpress64/Makefile b/targets/vexpress64/Makefile
index 55a98c7..03cb087 100644
--- a/targets/vexpress64/Makefile
+++ b/targets/vexpress64/Makefile
@@ -72,8 +72,8 @@ include ${CONFIG}
 
 #export CFLAGS_KERNEL += -mllvm -print-call-graph
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
@@ -102,13 +102,13 @@ aarch64-kernel.config:  ${KERNEL_CFG}
 ${KERNEL_CFG}: aarch64-kernel.config-proto ${AARCH64INITRD}
 	cat aarch64-kernel.config-proto | sed -e "s#PATH_TO_INITRD#${AARCH64INITRD}#" > $@
 
-kernel-test test:: state/prep ${QEMUSTATE}/qemu-build kernel-build
+kernel-test test:: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build kernel-build
 	( ${TOPDIR}/test/qemu/install/bin/qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt -nographic -smp 1 -m 2048 -kernel ${IMAGE} --append "rdinit=/sbin/init console=ttyAMA0" \
 		| tee ${TMPDIR}/qemu_log ) &
 	( sleep 60 && killall -s 9 qemu-system-aarch64 ) || exit 0
 	@grep -a "root at genericarmv8:" ${TMPDIR}/qemu_log && echo SUCCESS
 
-kernel-gcc-test test-gcc:: state/prep ${QEMUSTATE}/qemu-build kernel-gcc-build
+kernel-gcc-test test-gcc:: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build kernel-gcc-build
 	( ${TOPDIR}/test/qemu/install/bin/qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt -nographic -smp 1 -m 2048 -kernel ${GCCIMAGE} --append "rdinit=/sbin/init console=ttyAMA0" \
 		| tee ${TMPDIR}/qemu_gcc_log ) &
 	( sleep 60 && killall -s 9 qemu-system-aarch64 ) || exit 0
diff --git a/targets/x86_64-linux-next/Makefile b/targets/x86_64-linux-next/Makefile
index 9aad883..8723d0c 100644
--- a/targets/x86_64-linux-next/Makefile
+++ b/targets/x86_64-linux-next/Makefile
@@ -56,8 +56,8 @@ KERNEL_PATCH_DIR += ${PATCHDIR}/${KERNEL_REPO_PATCHES}
 TARGETS+= clean mrproper test test2
 .PHONY: test test2 fetch-initrd prep clean mrproper test
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
@@ -78,10 +78,10 @@ ${INITRAMFS}.clang: initramfs-unpacked
 	mv ${INITRAMFS} ${INITRAMFS}.clang
 
 # Create the generic initramfs, add in the kernel modules, then create the cpio
-test: state/prep ${QEMUSTATE}/qemu-build ${INITRAMFS}.clang
+test: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${INITRAMFS}.clang
 	$(call qemu,${BOARD},${KERNEL_BUILD}/arch/x86/boot/bzImage,512,/dev/ram0,rw console=ttyS0 earlyprintk ,-initrd ${INITRAMFS}.clang -net none )
 
-test-gdb: state/prep ${QEMUSTATE}/qemu-build ${INITRAMFS}.clang
+test-gdb: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${INITRAMFS}.clang
 	$(call qemu,${BOARD},${KERNEL_BUILD}/arch/x86/boot/bzImage,512,/dev/ram0,rw console=ttyS0 earlyprintk ,-initrd ${INITRAMFS}.clang -net none -s)
 
 test-qemu: ${INITRAMFS}.clang ${QEMUSTATE}/qemu-build
@@ -112,7 +112,7 @@ test-qemu-debug-parse: test-qemu-debug-kill
 test-qemu-smp:
 	$(call qemu,${BOARD},${KERNEL_BUILD}/arch/x86/boot/bzImage,2048,/dev/ram0,ramdisk_size=512000 rdinit=/init console=ttyS0 earlyprintk,-M q35 -cpu SandyBridge -smp 4 -initrd ${INITRAMFS}.clang)
 
-test-gcc:  state/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
+test-gcc:  ${STATEDIR}/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib/modules
 	(cd ${KERNEL_BUILD} && make V=0 INSTALL_MOD_PATH=${INITBUILDFSDIR} modules_install 2>&1 > /dev/null)
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
@@ -125,7 +125,7 @@ test-gcc-qemu:
 	$(call qemu,${BOARD},${KERNEL_BUILD}/arch/x86/boot/bzImage,2048,/dev/ram0,ramdisk_size=512000 rdinit=/init console=ttyS0 earlyprintk,-initrd ${INITRAMFS}.gcc)
 
 test-kill: test-boot-poweroff
-test-boot-poweroff: state/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
+test-boot-poweroff: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib/modules
 	(cd ${KERNEL_BUILD} && make V=0 INSTALL_MOD_PATH=${INITBUILDFSDIR} modules_install 2>&1 > /dev/null)
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
diff --git a/targets/x86_64/Makefile b/targets/x86_64/Makefile
index 332dfd5..a7b4272 100644
--- a/targets/x86_64/Makefile
+++ b/targets/x86_64/Makefile
@@ -55,8 +55,8 @@ include ${CONFIG}
 TARGETS+= clean mrproper test test2
 .PHONY: test test2 fetch-initrd prep clean mrproper test
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
@@ -77,11 +77,11 @@ ${INITRAMFS}.clang: initramfs-unpacked
 	mv ${INITRAMFS} ${INITRAMFS}.clang
 
 # Create the generic initramfs, add in the kernel modules, then create the cpio
-test: state/prep ${QEMUSTATE}/qemu-build ${INITRAMFS}.clang
+test: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${INITRAMFS}.clang
 	$(call qemu,${BOARD},${KERNEL_BUILD}/arch/x86/boot/bzImage,512,/dev/ram0,rw console=ttyS0 earlyprintk initcall.debug,-initrd ${INITRAMFS}.clang -net none )
 #	$(call qemu,${BOARD},${KERNEL_BUILD}/arch/x86/boot/bzImage,2048,/dev/ram0,ramdisk_size=512000 rdinit=/init console=ttyS0 earlyprintk,-initrd ${INITRAMFS}.clang -curses)
 
-test-gdb: state/prep ${QEMUSTATE}/qemu-build ${INITRAMFS}.clang
+test-gdb: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build ${INITRAMFS}.clang
 	( $(call qemu,${BOARD},${KERNEL_BUILD}/arch/x86/boot/bzImage,512,/dev/ram0,rw console=ttyS0 debug user_debug=-1 earlyprintk initcall.debug,-initrd ${INITRAMFS}.clang -net none -s -S) &)
 	@(echo "set output-radix 16" > .gdbinit ; echo "target remote localhost:1234" >> .gdbinit )
 	(gdb ${KERNEL_BUILD}/vmlinux)
@@ -104,7 +104,7 @@ test-qemu-debug: ${INITRAMFS}.clang
 test-qemu-smp:
 	$(call qemu,${BOARD},${KERNEL_BUILD}/arch/x86/boot/bzImage,2048,/dev/ram0,ramdisk_size=512000 rdinit=/init console=ttyS0 earlyprintk,-M q35 -cpu SandyBridge -smp 4 -initrd ${INITRAMFS}.clang)
 
-test-gcc:  state/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
+test-gcc:  ${STATEDIR}/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib/modules
 	(cd ${KERNEL_BUILD} && make V=0 INSTALL_MOD_PATH=${INITBUILDFSDIR} modules_install 2>&1 > /dev/null)
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
@@ -117,7 +117,7 @@ test-gcc-qemu:
 	$(call qemu,${BOARD},${KERNEL_BUILD}/arch/x86/boot/bzImage,2048,/dev/ram0,ramdisk_size=512000 rdinit=/init console=ttyS0 earlyprintk,-initrd ${INITRAMFS}.gcc)
 
 test-kill: test-boot-poweroff
-test-boot-poweroff: state/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
+test-boot-poweroff: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib/modules
 #	(cd ${KERNEL_BUILD} && make V=0 INSTALL_MOD_PATH=${INITBUILDFSDIR} modules_install 2>&1 > /dev/null)
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
diff --git a/targets/x86_64_tiny/Makefile b/targets/x86_64_tiny/Makefile
index 30114a2..d4a98fe 100644
--- a/targets/x86_64_tiny/Makefile
+++ b/targets/x86_64_tiny/Makefile
@@ -41,8 +41,8 @@ include ${CONFIG}
 TARGETS+= clean mrproper test test2
 .PHONY: test test2 fetch-initrd prep clean mrproper test
 
-prep: state/prep
-state/prep:
+prep: ${STATEDIR}/prep
+${STATEDIR}/prep:
 	$(MAKE) ${TMPDIR}
 	@mkdir -p ${LOGDIR}
 	$(call state,$@)
@@ -55,7 +55,7 @@ mrproper: clean kernel-mrproper kernel-gcc-mrproper tmp-mrproper
 	@$(call banner,Very Clean)
 
 # Create the generic initramfs, add in the kernel modules, then create the cpio
-test: state/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
+test: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib/modules
 #	(cd ${KERNEL_BUILD} && make V=0 INSTALL_MOD_PATH=${INITBUILDFSDIR} modules_install 2>&1 > /dev/null)
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
@@ -71,7 +71,7 @@ test-qemu:
 test-qemu-smp:
 	$(call qemu,${BOARD},${KERNEL_BUILD}/arch/x86/boot/bzImage,2048,/dev/ram0,ramdisk_size=512000 rdinit=/init console=ttyS0 earlyprintk,-M q35 -cpu SandyBridge -smp 4 -initrd ${INITRAMFS}.clang)
 
-test-gcc:  state/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
+test-gcc:  ${STATEDIR}/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib/modules
 	(cd ${KERNEL_BUILD} && make V=0 INSTALL_MOD_PATH=${INITBUILDFSDIR} modules_install 2>&1 > /dev/null)
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
@@ -84,7 +84,7 @@ test-gcc-qemu:
 	$(call qemu,${BOARD},${KERNEL_BUILD}/arch/x86/boot/bzImage,2048,/dev/ram0,ramdisk_size=512000 rdinit=/init console=ttyS0 earlyprintk,-initrd ${INITRAMFS}.gcc)
 
 test-kill: test-boot-poweroff
-test-boot-poweroff: state/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
+test-boot-poweroff: ${STATEDIR}/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib/modules
 #	(cd ${KERNEL_BUILD} && make V=0 INSTALL_MOD_PATH=${INITBUILDFSDIR} modules_install 2>&1 > /dev/null)
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
@@ -98,7 +98,7 @@ test-boot-poweroff: state/prep ${QEMUSTATE}/qemu-build initramfs-unpacked
 	@grep -a "SUCCESS" ${TMPDIR}/qemu_log
 
 test-kill-bot: test-boot-poweroff-bot
-test-boot-poweroff-bot: state/prep state/kernel-build ${QEMUSTATE}/qemu-build initramfs-unpacked
+test-boot-poweroff-bot: ${STATEDIR}/prep ${STATEDIR}/kernel-build ${QEMUSTATE}/qemu-build initramfs-unpacked
 	@rm -rf ${INITBUILDFSDIR}/lib/modules
 #	(cd ${KERNEL_BUILD} && make V=0 INSTALL_MOD_PATH=${INITBUILDFSDIR} modules_install 2>&1 > /dev/null)
 	mkdir -p ${INITBUILDFSDIR}/usr/lib
-- 
2.1.4



More information about the LLVMLinux mailing list