kern

diff Makefile @ 7:611b2d66420b

segment descriptors
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 16 Feb 2011 07:26:03 +0200
parents a9176938bce1
children b11a86695493
line diff
     1.1 --- a/Makefile	Thu Jan 13 20:24:10 2011 +0200
     1.2 +++ b/Makefile	Wed Feb 16 07:26:03 2011 +0200
     1.3 @@ -1,6 +1,7 @@
     1.4  # collect all of our C and assembly source files
     1.5  csrc = $(wildcard src/*.c) $(wildcard src/klibc/*.c)
     1.6  asmsrc = $(wildcard src/*.S) $(wildcard src/klibc/*.S)
     1.7 +dep = $(asmsrc:.S=.d) $(csrc:.c=.d)
     1.8  
     1.9  # each source file will generate one object file
    1.10  obj = $(asmsrc:.S=.o) $(csrc:.c=.o)
    1.11 @@ -20,6 +21,18 @@
    1.12  $(bin): $(obj)
    1.13  	ld -melf_i386 -o $@ -Ttext 0x100000 -e kentry $(obj)
    1.14  
    1.15 +-include $(dep)
    1.16 +
    1.17 +%.d: %.c
    1.18 +	@$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@
    1.19 +
    1.20 +%.d: %.S
    1.21 +	@$(CPP) $(ASFLAGS) -MM -MT $(@:.d=.o) $< >$@
    1.22 +
    1.23  .PHONY: clean
    1.24  clean:
    1.25  	rm -f $(obj) $(bin)
    1.26 +
    1.27 +.PHONY: cleandep
    1.28 +cleandep:
    1.29 +	rm -f $(dep)