# Makefile for tank_top # default target when "make" is run w/o arguments all: tank_top.rom # compile game_of_life.c into game_of_life.o game_of_life.o: game_of_life.c game_of_life.h avr-gcc -c -g -O3 -Wall -mmcu=at90s8535 -I. game_of_life.c -o game_of_life.o # compile tank_top.c into tank_top.o tank_top.o: tank_top.c tank_top.h avr-gcc -c -g -O3 -Wall -mmcu=at90s8535 -I. tank_top.c -o tank_top.o # link up tank_top.o and game_of_life.o into tank_top.elf tank_top.elf: tank_top.o game_of_life.o avr-gcc tank_top.o game_of_life.o -Wl,-Map=tank_top.map,--cref -mmcu=at90s8535 -o tank_top.elf # copy ROM (FLASH) object out of tank_top.elf into tank_top.rom tank_top.rom: tank_top.elf avr-objcopy -O ihex tank_top.elf tank_top.rom # command to program chip (optional) (invoked by running "make install") install: uisp -v=1 -dprog=stk500 -dserial=/dev/cu.USA19H1b1P1.1 -dpart=ATmega16 --erase --upload --verify if="tank_top.rom" # command to clean up junk (no source files) (invoked by "make clean") clean: rm -f *.o *.rom *.elf *.map *~