aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-05-21 00:37:46 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-05-21 11:44:57 +0200
commit70d11e6f3deb0bcf190c37adc7b8c87c5888510d (patch)
tree018fc7daa39b957fef7deb92157878049588a29b /Makefile
parentc3773639dbec70a109e5eddc6a729196356ecce1 (diff)
downloadqboot-70d11e6f3deb0bcf190c37adc7b8c87c5888510d.zip
qboot-70d11e6f3deb0bcf190c37adc7b8c87c5888510d.tar.gz
qboot-70d11e6f3deb0bcf190c37adc7b8c87c5888510d.tar.bz2
compute dependencies automatically
getting serious... Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4e41822..4149ef7 100644
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,11 @@ obj-y = $(obj16-y) entry.o main.o string.o printf.o cstart.o fw_cfg.o
obj-y += linuxboot.o
all-y = bios.bin
+all: $(all-y)
-CFLAGS := -O2 -Wall -g
+CFLAGS := -O2 -g
+BIOS_CFLAGS += $(autodepend-flags) -Wall
BIOS_CFLAGS += -m32
BIOS_CFLAGS += -march=i386
BIOS_CFLAGS += -mregparm=3
@@ -14,7 +16,9 @@ BIOS_CFLAGS += -ffreestanding
BIOS_CFLAGS += -Iinclude
$(obj16-y): BIOS_CFLAGS += -include code16gcc.h
-all: $(all-y)
+dummy := $(shell mkdir -p .deps)
+autodepend-flags = -MMD -MF .deps/cc-$(patsubst %/,%,$(dir $*))-$(notdir $*).d
+-include .deps/*.d
.PRECIOUS: %.o
%.o: %.c
@@ -30,3 +34,4 @@ bios.bin: bios.bin.elf
clean:
rm -f $(obj-y) $(all-y) bios.bin.elf
+ rm -rf .deps