Fix a bunch of %lud and %lux
[akaros.git] / Makefile
index 575d1ee..5f5322e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -317,7 +317,7 @@ CFLAGS_KERNEL += -Wall -Wno-format -Wno-unused
 CFLAGS_KERNEL += -DROS_KERNEL 
 CFLAGS_KERNEL += -include include/generated/autoconf.h -include include/common.h
 ifeq ($(CONFIG_64BIT),y)
-CFLAGS_KERNEL += -m64
+CFLAGS_KERNEL += -m64 -g
 else
 CFLAGS_KERNEL += -m32 -gstabs
 endif
@@ -416,8 +416,25 @@ endif
 ext2_bdev_obj = $(OBJDIR)/kern/$(shell basename $(ext2-bdev)).o
 endif
 
-kern_initramfs_files := $(shell mkdir -p $(kfs-paths); \
-                          find $(kfs-paths))
+# a bit hacky: we want to make sure the directories exist, and error out
+# otherwise.  we also want to error out before the initramfs target, otherwise
+# we might not get the error (if initramfs files are all up to date).  the
+# trickiest thing here is that kfs-paths-check could be stale and require an
+# oldconfig.  running make twice should suffice.
+kfs-paths-check := $(shell for i in $(kfs-paths); do \
+                               if [ ! -d "$$i" ]; then \
+                                   echo "Can't find KFS directory $$i"; \
+                                      $(MAKE) -f $(srctree)/Makefile \
+                                                                          silentoldconfig > /dev/null; \
+                                   exit -1; \
+                               fi; \
+                           done; echo "ok")
+
+ifneq (ok,$(kfs-paths-check))
+$(error $(kfs-paths-check), try make one more time in case of stale configs)
+endif
+
+kern_initramfs_files := $(shell find $(kfs-paths))
 
 # Need to make an empty cpio, then append each kfs-path's contents
 $(kern_cpio) initramfs: $(kern_initramfs_files)