Merge pull request #129 from jschleic/patch-1
Improve Makefile to rebuild on upload
This commit is contained in:
commit
012855c6d1
1 changed files with 6 additions and 6 deletions
|
|
@ -127,11 +127,11 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||||
|
|
||||||
|
|
||||||
# Default target.
|
# Default target.
|
||||||
all: applet_files build sizeafter
|
all: build sizeafter
|
||||||
|
|
||||||
build: elf hex
|
build: elf hex
|
||||||
|
|
||||||
applet_files: $(TARGET).pde
|
applet/$(TARGET).cpp: $(TARGET).pde
|
||||||
# Here is the "preprocessing".
|
# Here is the "preprocessing".
|
||||||
# It creates a .cpp file based with the same name as the .pde file.
|
# It creates a .cpp file based with the same name as the .pde file.
|
||||||
# On top of the new .cpp file comes the WProgram.h header.
|
# On top of the new .cpp file comes the WProgram.h header.
|
||||||
|
|
@ -155,7 +155,7 @@ upload: applet/$(TARGET).hex
|
||||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
|
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
|
||||||
|
|
||||||
|
|
||||||
# Display size of file.
|
# Display size of file.
|
||||||
HEXSIZE = $(SIZE) --target=$(FORMAT) applet/$(TARGET).hex
|
HEXSIZE = $(SIZE) --target=$(FORMAT) applet/$(TARGET).hex
|
||||||
ELFSIZE = $(SIZE) applet/$(TARGET).elf
|
ELFSIZE = $(SIZE) applet/$(TARGET).elf
|
||||||
sizebefore:
|
sizebefore:
|
||||||
|
|
@ -198,8 +198,8 @@ extcoff: $(TARGET).elf
|
||||||
.elf.sym:
|
.elf.sym:
|
||||||
$(NM) -n $< > $@
|
$(NM) -n $< > $@
|
||||||
|
|
||||||
# Link: create ELF output file from library.
|
# Link: create ELF output file from library.
|
||||||
applet/$(TARGET).elf: $(TARGET).pde applet/core.a
|
applet/$(TARGET).elf: applet/core.a applet/$(TARGET).cpp
|
||||||
$(CC) $(ALL_CFLAGS) -Wl,--gc-sections -o $@ applet/$(TARGET).cpp -L. applet/core.a $(LDFLAGS)
|
$(CC) $(ALL_CFLAGS) -Wl,--gc-sections -o $@ applet/$(TARGET).cpp -L. applet/core.a $(LDFLAGS)
|
||||||
|
|
||||||
applet/core.a: $(OBJ)
|
applet/core.a: $(OBJ)
|
||||||
|
|
@ -244,4 +244,4 @@ depend:
|
||||||
>> $(MAKEFILE); \
|
>> $(MAKEFILE); \
|
||||||
$(CC) -M -mmcu=$(MCU) $(CDEFS) $(CINCS) $(SRC) $(ASRC) >> $(MAKEFILE)
|
$(CC) -M -mmcu=$(MCU) $(CDEFS) $(CINCS) $(SRC) $(ASRC) >> $(MAKEFILE)
|
||||||
|
|
||||||
.PHONY: all build elf hex eep lss sym program coff extcoff clean depend applet_files sizebefore sizeafter
|
.PHONY: all build elf hex eep lss sym program coff extcoff clean depend sizebefore sizeafter
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue