avr/sk9822/Makefile

29 lines
1.0 KiB
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
# /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
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
echo ${GCC}
${GCC}/bin/avr-gcc ${CFLAGS} ${LINKFLAGS} -I../base/include/ -o main.elf main.o sk9822.o
${OBJCOPY} -O ihex main.elf main.hex
%.o: %.c %.h
${GCC}/bin/avr-gcc ${CFLAGS} -I../base/include/ -o $@ -c $<
clean:
rm *.o make.elf main.hex main.S main.E