Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
F_CPU = 16000000UL
CC = /usr/bin/avr-gcc
CFLAGS = -g -Os -Wall -mcall-prologues -mmcu=atmega88
CFLAGS += -DF_CPU=$(F_CPU)
OBJ2HEX = /usr/bin/avr-objcopy
UISP = /usr/bin/avrdude
TARGET = main


main.hex : main.obj
$(OBJ2HEX) -R .eeprom -O ihex main.obj main.hex

main.obj : main.o ir.o
$(CC) $(CFLAGS) main.o ir.o -o main.obj

ir.o : IR_Receiver.cpp IR_Receiver.h
$(CC) $(CFLAGS) IR_Receiver.cpp -c -o ir.o

main.o : IR_Receiver_Test.cpp
$(CC) $(CFLAGS) IR_Receiver_Test.cpp -c -o main.o

prog : $(TARGET).hex
@echo 'progaem'
$(UISP) -c usbasp -p m8 -U flash:w:$(TARGET).hex:a

clean :
rm -f *.hex *.obj *.o

#%.obj : %.o
# $(CC) $(CFLAGS) $< -o $@
#$@ — имя цели (%.obj)
#$< — имя зависимости (%.o)

#%.hex : %.obj
# $(OBJ2HEX) -R .eeprom -O ihex $< $@