1 # $Id: Makefile 51 2008-03-20 15:51:17Z michalsc $
3 FILES
:= bootstrap of1275 support menu elf gpr
6 all: depend ..
/bin
/bootloader
8 ..
/bin
/bootloader
: $(foreach f
, $(FILES
), $(TARGETDIR
)/$(f
).o
)
9 @if
[ ! -d ..
/bin
]; then mkdir ..
/bin
; fi
10 @echo
"Linking kernel"
11 @
$(LD
) -N
-e bootstrap
-T ldscript.lds
-o
$@
$(foreach f
, $(FILES
), $(TARGETDIR
)/$(f
).o
)
14 # @$(STRIP) -R.note -R.comment --strip-unneeded "$@"
17 @if
[ ! -d
"$(TARGETDIR)" ]; then mkdir .obj
; fi
18 @echo
-n
"Compiling $< "
19 @if
$(CC
) $(CFLAGS
) -DVERSION
=\"`svn info --xml |grep revision=\" | head -n 1 | sed -e 's|[^"]*"||' -e 's|"[^"]*||'`\" $(INCLUDES
) -c
$< -o
$@
; then echo
"done"; else echo
"failed"; exit
1; fi
22 @if
[ ! -d
$(TARGETDIR
) ]; then mkdir
$(TARGETDIR
); fi
23 @echo
"Make depend $<"
24 @
$(CC
) $(CFLAGS
) -DVERSION
=\"`svn info --xml |grep revision=\" | head -n 1 | sed -e 's|[^"]*"||' -e 's|"[^"]*||'`\" $(INCLUDES
) -MM
$< > $@.
$$$$; \
25 sed
's#^.*\.o:#$(TARGETDIR)/&#' < $@.
$$$$ | sed
's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@
; rm -f
$@.
$$$$
30 depend
: $(foreach f
, $(FILES
), $(TARGETDIR
)/$(f
).d
)
32 -include $(foreach f
, $(FILES
), $(TARGETDIR
)/$(f
).d
)