avr/sk9822/Makefile

29 lines
1.0 KiB
Makefile
Raw Normal View History

2022-05-07 23:49:54 +00:00
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
2022-05-08 00:16:20 +00:00
# /nix/store/fymsi5yk07jvcbdaka6nfhx6s2a7kgpi-avr-stage-final-gcc-debug-wrapper-10.3.0/bin/avr-gcc -O -finline-functions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -std=gnu99 -D__AVR_ATtiny85__=1 -mmcu=attiny85 -I../base/include/ -E -o main.E src/main.c
2022-05-07 23:49:54 +00:00
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
2022-05-08 00:16:20 +00:00
echo ${GCC}
2022-05-07 23:49:54 +00:00
${GCC}/bin/avr-gcc ${CFLAGS} ${LINKFLAGS} -I../base/include/ -o main.elf main.o sk9822.o
${OBJCOPY} -O ihex main.elf main.hex
2022-05-08 00:16:20 +00:00
%.o: %.c %.h
${GCC}/bin/avr-gcc ${CFLAGS} -I../base/include/ -o $@ -c $<
2022-05-07 23:49:54 +00:00
clean:
rm *.o make.elf main.hex main.S main.E