<commit_before>#General compiler and linker stuff
CC=avr-gcc#which compiler to use
CFLAGS=-Os -g -std=gnu99 -Wall -ffunctions-sections -fdata-sections#compiler flags to use
OBJCOPY=avr-objcopy#what version of objcopy to use to change formats
TARGET_ARCH=-mmcu=$(MCU)#compiler flag for target uC name come from MCU below
LDFLAGS=-Wl,-Map,$(TARGET).map -Wl,--gc-sections#linker flags

#Project files and output
SRC=main.c#source files
TARGET=Blink#name of output
OBJECTS=#object files to include

#Chip and project global definitions
MCU=atmega328p#compiler name of target chip
F_CPU=1000000UL#uC clock
BAUD=9600UL#uC baud
CPPFLAGS=-DF_CPU$(F_CPU) -DBAUD$(BAUD) -I#Flags

#Flashing options
FLASHMETHOD=arduino#name of programmer in avrdude
FLASHPORT=/dev/ttyACM0#what port avrdude should use
FLASHBAUD=19200#baudrate that avrdude will flash at
CHIP=m328p#avrdude name of target chip

#Rules
all: flash

flash: hex
	avrdude -c $(FLASHMETHOD) -P $(FLASHPORT) -b $(FLASHBAUD) -p $(CHIP) -U flash:w:$(TARGET).hex

hex: elf
	$(OBJCOPY) -j .text -j .data -O ihex $(TARGET).elf $(TARGET).hex

elf: $(OBJECTS) $(SRC)
	$(CC) $(LDFLAGS) $(TARGET_ARCH) $^ -o $(TARGET).elf

clean:
	rm -f $(TARGET).elf $(TARGET).hex $(TARGET).map<commit_msg>added size and various changes<commit_after>#General compiler and linker stuff
CC=avr-gcc#which compiler to use
CFLAGS=-O$(OPT) -g -std=gnu99 -Wall -ffunctions-sections -fdata-sections#compiler flags to use
OBJCOPY=avr-objcopy#what version of objcopy to use to change formats
TARGET_ARCH=-mmcu=$(MCU)#compiler flag for target uC name come from MCU below
LDFLAGS=-Wl,-Map,$(TARGET).map -Wl,--gc-sections#linker flags
OPT=s#s,0,1,2,3

#Project files and output
SRC=main.c#source files
TARGET=Blink#name of output
OBJECTS=#object files to include
INC=#extra directories to search for headers
INC_PARAMS=$(foreach d, $(INC), -I$d)#prepends a -I to each item in INC

#Chip and project global definitions
MCU=atmega328p#compiler name of target chip
F_CPU=1000000UL#uC clock
BAUD=9600UL#uC baud
CPPFLAGS=-DF_CPU$(F_CPU) -DBAUD$(BAUD) -I#Flags

#Flashing options
FLASHMETHOD=arduino#linuxgpio #name of programmer in avrdude
FLASHPORT=/dev/ttyACM0#what port avrdude should use
FLASHBAUD=19200#baudrate that avrdude will flash at
CHIP=m328p#avrdude name of target chip

#Rules
all: flash

flash: hex
	avrdude -c $(FLASHMETHOD) -P $(FLASHPORT) -b $(FLASHBAUD) -p $(CHIP) -U flash:w:$(TARGET).hex

hex: elf
	$(OBJCOPY) -j .text -j .data -O ihex $(TARGET).elf $(TARGET).hex

elf: $(OBJECTS) $(SRC)
	$(CC) $(CFLAGS) $(INC) $(LDFLAGS) $(TARGET_ARCH) $^ -o $(TARGET).elf

clean:
	rm -f $(TARGET).elf $(TARGET).hex $(TARGET).map
	
size: hex
	avr-size -B -x -t $(TARGET).hex
{'fraction_non_alphanumeric': 0.13412816691505217, 'fraction_numerical': 0.020119225037257823, 'mean_word_length': 5.377672209026128, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '889919', 'n_tokens_mistral': 1048, 'n_tokens_neox': 973, 'n_words': 299}