From 07603eeda42f4c208abdd8f5743c3707c7f2a1a1 Mon Sep 17 00:00:00 2001 From: jakegoodwin Date: Sat, 18 Feb 2023 23:06:22 -0800 Subject: [PATCH] hacked at makefile to run tests --- Makefile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 2676f1b..2419a92 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,6 @@ #MCU = atmega2560 #MCU = attiny85 MCU = atmega328p -#F_CPU = 1000000UL F_CPU = 14745600UL BAUD = 9600UL ## Also try BAUD = 19200 or 38400 if you're feeling lucky. @@ -57,7 +56,7 @@ AVRDUDE = avrdude ## The name of your project (without the .c) # TARGET = blinkLED ## Or name it automatically after the enclosing directory -TARGET = $(DEBUG_DIR)/$(lastword $(subst /, ,$(CURDIR))) +TARGET = $(lastword $(subst /, ,$(CURDIR))) # Object files: will find all .c/.h files in current directory # and in LIBDIR. If you have any other (sub-)directories with code, @@ -85,7 +84,7 @@ TARGET_ARCH = -mmcu=$(MCU) ## Explicit pattern rules: ## To make .o files from .c files %.o: %.c $(HEADERS) Makefile - $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $(DEBUG_DIR)/$@ $<; + $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $<; $(TARGET).elf: $(OBJECTS) $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $(DEBUG_DIR)/$@ @@ -94,10 +93,10 @@ $(TARGET).elf: $(OBJECTS) $(OBJCOPY) -j .text -j .data -O ihex $(DEBUG_DIR)/$< $(DEBUG_DIR)/$@ %.eeprom: %.elf - $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $(DEBUG_DIR)$< $(DEBUG_DIR)/$@ + $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $(DEBUG_DIR)/$< $(DEBUG_DIR)/$@ %.lst: %.elf - $(OBJDUMP) -S $(DEBUG_DIR)$< > $(DEBUG_DIR)/$@ + $(OBJDUMP) -S $(DEBUG_DIR)/$< > $(DEBUG_DIR)/$@ ## These targets don't have files named after them .PHONY: all disassemble disasm eeprom size clean squeaky_clean flash fuses @@ -136,7 +135,7 @@ squeaky_clean: ########## Flashing code to AVR using avrdude ########## ##########------------------------------------------------------########## -flash: $(TARGET).hex +flash: $(DEBUG_DIR)/$(TARGET).hex $(AVRDUDE) -c $(PROGRAMMER_TYPE) -p $(MCU) $(PROGRAMMER_ARGS) -U flash:w:$< ## An alias