Cleanup of the Makefiles
authorMichel Pollet <buserror@gmail.com>
Mon, 14 Dec 2009 20:54:27 +0000 (20:54 +0000)
committerMichel Pollet <buserror@gmail.com>
Mon, 14 Dec 2009 20:54:27 +0000 (20:54 +0000)
General cleanup, updated comments

Signed-off-by: Michel Pollet <buserror@gmail.com>
Makefile.common
simavr/Makefile
tests/Makefile

index 77b1ad3..0949fb8 100644 (file)
@@ -40,26 +40,32 @@ AVR_INC := ${AVR_ROOT}
 AVR := avr-
 endif
 
+# The code is compiled "optimized" to the max.
+# 
+# The wierd "-Wl,--undefined=_mmcu,--section-start=.mmcu=0x910000"
+# is used to tell the linker not to discard the .mmcu section,
+# otherwise the --gc-sections will delete it.
+
 %.hex: %.axf
-               @${AVR}objcopy -j .text -j .data -O ihex ${<} ${@}
+       @${AVR}objcopy -j .text -j .data -O ihex ${<} ${@}
 
 %.s: %.axf
-               @${AVR}objdump -j .text -j .data -j .bss -d  ${<} > ${@}
+       @${AVR}objdump -j .text -j .data -j .bss -d  ${<} > ${@}
 
-# --mcall-prologues 
+# --mcall-prologues can be used here, but messes up debugging a little
 %.axf: %.c 
-               @echo AVR-CC ${<}
-               @part=${<} ; part=$${part/_*}; \
-               ${AVR}gcc -Wall -gdwarf-2 -Os -std=gnu99 \
-                               -mmcu=$$part \
-                               -DF_CPU=8000000 \
-                               -fno-inline-small-functions \
-                               -ffunction-sections -fdata-sections \
-                               -Wl,--relax,--gc-sections \
-                               -Wl,--undefined=_mmcu,--section-start=.mmcu=0x910000 \
-                               -I../include -I../../include \
-                               ${<} -o ${@}
-               @${AVR}size ${@}|sed '1d'
+       @echo AVR-CC ${<}
+       @part=${<} ; part=$${part/_*}; \
+       ${AVR}gcc -Wall -gdwarf-2 -Os -std=gnu99 \
+                       -mmcu=$$part \
+                       -DF_CPU=8000000 \
+                       -fno-inline-small-functions \
+                       -ffunction-sections -fdata-sections \
+                       -Wl,--relax,--gc-sections \
+                       -Wl,--undefined=_mmcu,--section-start=.mmcu=0x910000 \
+                       -I../include -I../../include \
+                       ${<} -o ${@}
+       @${AVR}size ${@}|sed '1d'
 
 OBJ = obj
 
@@ -69,7 +75,7 @@ ${OBJ}/%.o: %.c
        @echo CC $<
 
 ${OBJ}: 
-       mkdir -p ${OBJ}
+       @mkdir -p ${OBJ}
 
 # include the dependency files generated by gcc, if any
 -include ${wildcard ${OBJ}/*.d}
index ab80a90..713fd76 100644 (file)
@@ -25,16 +25,15 @@ cores_o = ${patsubst cores/%.c, obj/%.o, ${cores}}
 sim            = ${wildcard sim/sim_*.c} ${wildcard sim/avr_*.c}
 sim_o  = ${patsubst sim/%.c, obj/%.o, ${sim}}
 
-VPATH  = .
-VPATH  += cores
+VPATH  = cores
 VPATH  += sim
 
-IPATH  = .
-IPATH  += sim
+IPATH  = sim
 IPATH  += ../../shared
 IPATH  += ../include
-IPATH  += /opt/local/include
 
+# Thats for MacPorts libelf
+IPATH  += /opt/local/include
 LFLAGS = -L/opt/local/lib/
 
 all:   obj libsimavr.a ${target}
index 900ad75..68db33c 100644 (file)
@@ -3,11 +3,6 @@
 # And compile it into an ELF binary.
 # It also disassemble it for debugging purposes.
 # 
-# The code is compiled "optimized" to the max.
-# 
-# The wierd "-Wl,--undefined=_mmcu,--section-start=.mmcu=0x910000"
-# is used to tell the linker not to discard the .mmcu section,
-# otherwise the --gc-sections will delete it.
 # 
 #      Copyright 2008, 2009 Michel Pollet <buserror@gmail.com>
 #