1.1 --- a/Makefile Fri Jun 05 19:34:16 2015 +0200
1.2 +++ b/Makefile Fri Jun 05 22:58:44 2015 +0200
1.3 @@ -39,10 +39,12 @@
1.4 DUMP = $(PAYLOAD:.bin=.dump)
1.5 MAP = $(PAYLOAD:.bin=.map)
1.6
1.7 +# Ordering of objects is important and cannot be left to replacement rules.
1.8 +
1.9 SRC1 = head1.S stage1.c board-nanonote.c
1.10 SRC2 = head2.S stage2.c board-nanonote.c
1.11 -OBJ1 = $(filter %.o,$(SRC1:.c=.o) $(SRC1:.S=.o))
1.12 -OBJ2 = $(filter %.o,$(SRC2:.c=.o) $(SRC2:.S=.o))
1.13 +OBJ1 = head1.o stage1.o board-nanonote.o
1.14 +OBJ2 = head2.o stage2.o board-nanonote.o
1.15 OBJ = $(OBJ1) $(OBJ2)
1.16
1.17 .PHONY: all clean distclean
1.18 @@ -50,7 +52,7 @@
1.19 all: $(PAYLOAD)
1.20
1.21 clean:
1.22 - rm -f $(OBJ) $(TARGET) $(PAYLOAD) $(DUMP) $(MAP) #System.map
1.23 + rm -f $(OBJ) $(TARGET) $(PAYLOAD) $(DUMP) *.map
1.24
1.25 distclean: clean
1.26 echo "Nothing else to clean."
1.27 @@ -59,7 +61,7 @@
1.28 $(OBJCOPY) -O binary $(@:.bin=.elf) $@+
1.29 $(OBJDUMP) -D $(@:.bin=.elf) > $(@:.bin=.dump)
1.30 $(OBJDUMP) -h $(@:.bin=.elf) > $(@:.bin=.map)
1.31 - #$(NM) -n $< > System.map
1.32 + $(NM) -n $< > System-$(@:.bin=.map)
1.33 chmod -x $@+
1.34 mv -f $@+ $@
1.35