allow srcdir == objdir to work
authorMathieu Lacage <mathieu.lacage@inria.fr>
Wed, 18 May 2011 00:13:45 +0200
changeset 46 e24d020aa31d
parent 45 532107bb1271
child 47 d1a7884e1de2
allow srcdir == objdir to work
Makefile
--- a/Makefile	Wed May 18 00:02:42 2011 +0200
+++ b/Makefile	Wed May 18 00:13:45 2011 +0200
@@ -79,7 +79,7 @@
 $(KCONFIG_CONFIG):
 	make -C $(SRCDIR)$(KERNEL_DIR) ARCH=sim KCONFIG_CONFIG=$(PWD)/$(KCONFIG_CONFIG) defconfig 
 $(AUTOCONF): generate-autoconf.py $(KCONFIG_CONFIG)
-	$^ > $@
+	./$^ > $@
 timeconst.h: $(KCONFIG_CONFIG)
 	perl $(SRCDIR)$(KERNEL_DIR)/kernel/timeconst.pl $(shell grep CONFIG_HZ= $(KCONFIG_CONFIG) | sed -e 's/CONFIG_HZ=\(\w\)/\1/g') > $@
 linker.lds: ./generate-linker-script.py
@@ -126,8 +126,8 @@
 	CWD=`pwd` && cd $(KERNEL_DIR) && git reset --hard $(KERNEL_VERSION) && cd $$CWD && rm -f .patch.ts
 ALL_OBJS=$(OBJS) $(KERNEL_LIB) $(modules) $(all-obj-for-clean)
 clean:
-	@for f in $(foreach m,$(modules),$($(m))); do rm -f $$f; done
-	@for f in $(ALL_OBJS); do rm -f $$f; done
+	@for f in $(foreach m,$(modules),$($(m))) timeconst.h config; do rm -f $$f 2>/dev/null; done
+	@for f in $(ALL_OBJS); do rm -f $$f; done 2>/dev/null
 	@rm -rf $(INSTALL_DIR)  linker.lds $(AUTOCONF) objs.mk 2>/dev/null
 
 $(KERNEL_LIB): $(AUTOCONF) objs.mk $(OBJS) linker.lds