-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add make variables to Makefiles on
test
+ I want to build using a specific avr-gcc binary.
- Loading branch information
1 parent
b60238b
commit c90595c
Showing
3 changed files
with
33 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
stdcxx=c++17 | ||
mcu=atmega328p | ||
|
||
CXX=avr-g++ | ||
CC=avr-gcc | ||
OBJCOPY=avr-objcopy | ||
OBJDUMP=avr-objdump | ||
INCLUDE=-I../../include | ||
CXXFLAGS=-std=$(stdcxx) -mmcu=$(mcu) -Wall -Os $(INCLUDE) | ||
|
||
all: pins.diff regs.diff | ||
|
||
%.diff: pins.hex expected_pins.hex regs.hex expected_regs.hex | ||
diff pins.hex expected_pins.hex > pins.diff | ||
diff regs.hex expected_regs.hex > regs.diff | ||
|
||
%.hex: %.o | ||
avr-objcopy -O ihex $< $@ | ||
|
||
%.s: %.o | ||
avr-objdump -d $< > $@ | ||
%.s: %.cpp | ||
$(CXX) $(CXXFLAGS) -S $^ | ||
|
||
%.o: %.cpp | ||
avr-g++ -std=$(stdcxx) -Os -mmcu=$(mcu) -Wall -I../../include -c $< | ||
%.hex: %.o | ||
$(OBJCOPY) -j .text -j .data -O ihex $< $@ | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f *.hex *.o *.s *.diff | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
stdcxx=c++17 | ||
mcu=attiny13a | ||
|
||
CXX=avr-g++ | ||
CC=avr-gcc | ||
OBJCOPY=avr-objcopy | ||
OBJDUMP=avr-objdump | ||
INCLUDE=-I../../include | ||
CXXFLAGS=-std=$(stdcxx) -mmcu=$(mcu) -Wall -Os $(INCLUDE) | ||
|
||
all: pins.diff regs.diff | ||
|
||
%.diff: pins.hex expected_pins.hex regs.hex expected_regs.hex | ||
diff pins.hex expected_pins.hex > pins.diff | ||
diff regs.hex expected_regs.hex > regs.diff | ||
|
||
%.hex: %.o | ||
avr-objcopy -O ihex $< $@ | ||
|
||
%.s: %.o | ||
avr-objdump -d $< > $@ | ||
%.s: %.cpp | ||
$(CXX) $(CXXFLAGS) -S $^ | ||
|
||
%.o: %.cpp | ||
avr-g++ -std=$(stdcxx) -Os -mmcu=$(mcu) -Wall -I../../include -c $< | ||
%.hex: %.o | ||
$(OBJCOPY) -j .text -j .data -O ihex $< $@ | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f *.hex *.o *.s *.diff | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters