updated the makefile to create the build directory as needed.
This commit is contained in:
parent
50502e4d1c
commit
af08ced653
21
makefile
21
makefile
|
@ -1,9 +1,10 @@
|
|||
ASM=avra
|
||||
#INCLUDE=/opt/microchip/mplabx/v6.05/packs/Microchip/ATmega_DFP/3.0.158/avrasm/inc/m328pdef.inc
|
||||
INCLUDE=/opt/microchip/mplabx/v6.05/packs/Microchip/ATmega_DFP/3.0.158/avrasm/inc/
|
||||
SRC=./src/main.s
|
||||
OUT=./build/prog
|
||||
MAPFILE=./build/prog.map
|
||||
SRC=./src
|
||||
PROG=main
|
||||
OUT=./build
|
||||
MAPFILE=prog.map
|
||||
|
||||
F_CPU=1000000UL
|
||||
MCU=atmega328p
|
||||
|
@ -17,20 +18,22 @@ OBJDUMP = avr-objdump
|
|||
AVRSIZE = avr-size
|
||||
AVRDUDE = avrdude
|
||||
|
||||
PROG=./src/main.s.hex
|
||||
#PROG=${OUT}/main.asm.hex
|
||||
|
||||
all:
|
||||
${ASM} -I ${INCLUDE} ${SRC} -o ${OUT} -m ${MAPFILE}
|
||||
if [ -d ${OUT} ]; then return 0; else mkdir ${OUT}; fi
|
||||
${ASM} -I ${INCLUDE} ${SRC}/${PROG}.asm -I ${OUT}/${PROG}.hex -m ${OUT}/${MAPFILE}
|
||||
mv ${SRC}/*.hex ${OUT}
|
||||
mv ${SRC}/*.obj ${OUT}
|
||||
mv ${SRC}/*.cof ${OUT}
|
||||
|
||||
|
||||
flash: ${PROG}
|
||||
$(AVRDUDE) -c $(PROGRAMMER_TYPE) -p $(MCU) $(PROGRAMMER_ARGS) -U flash:w:$<
|
||||
|
||||
clean:
|
||||
if test -e ${SRC}.hex; then
|
||||
echo "cleaing hex files!";
|
||||
rm ${SRC}.hex;
|
||||
done;
|
||||
fi
|
||||
rm ${OUT}/*
|
||||
|
||||
flash_usbasp: PROGRAMMER_TYPE = usbasp
|
||||
flash_usbasp: PROGRAMMER_ARGS = # USBasp works with no further arguments
|
||||
|
|
Loading…
Reference in New Issue