avr/sk9822/Makefile

24 lines
742 B
Makefile

MCU=attiny85
CHIP_SELECT=AVR_ATtiny85
F_CPU=8000000
CFLAGS=-O -finline-functions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=${F_CPU} -std=gnu99 -D__${CHIP_SELECT}__=1
LINKFLAGS=-mmcu=${MCU}
OBJECTS= main.o \
sk9822.o
.SUFFIXES: .c .o .h
%.o: %.c %.h
${GCC}/bin/avr-gcc ${CFLAGS} ${AVR}/avr/include -I../base/include/ -o $@ -c $<
main: main.o sk9822.o
# ${GCC}/bin/avr-gcc ${CFLAGS} -I../base/include/ -E -o main.E src/main.c
# ${GCC}/bin/avr-gcc ${CFLAGS} -I../base/include/ -S -o main.S src/main.c
${GCC}/bin/avr-gcc ${CFLAGS} ${LINKFLAGS} -I../base/include/ -o main.elf main.o sk9822.o
${OBJCOPY} -O ihex main.elf main.hex
clean:
rm *.o make.elf main.hex main.S main.E