Lines splitted and status messages are commends

All lines longer than 80 characteres were splitted in a lot of little ones;
All status messages now have a hash (#) in the beginning, so you can
  paste the entire output of the Makefile in a shell script and it'll run
  without problems.
Esse commit está contido em:
Álvaro Justen aka Turicas
2011-10-11 02:45:39 -03:00
commit 77dca16ccb
+30 -15
Ver Arquivo
@@ -56,48 +56,63 @@ CORE_CPP_FILES=HardwareSerial main Print Tone WMath WString
all: clean compile upload all: clean compile upload
clean: clean:
@echo '*** Cleaning...' @echo '# *** Cleaning...'
rm -rf "$(TMP_DIR)" rm -rf "$(TMP_DIR)"
compile: compile:
@echo '*** Compiling...' @echo '# *** Compiling...'
mkdir $(TMP_DIR) mkdir $(TMP_DIR)
echo '#include "WProgram.h"' > "$(TMP_DIR)/$(SKETCH_NAME).cpp" echo '#include "WProgram.h"' > "$(TMP_DIR)/$(SKETCH_NAME).cpp"
cat $(SKETCH_NAME) >> "$(TMP_DIR)/$(SKETCH_NAME).cpp" cat $(SKETCH_NAME) >> "$(TMP_DIR)/$(SKETCH_NAME).cpp"
@#$(CPP) -MM -mmcu=$(MCU) -DF_CPU=$(DF_CPU) $(INCLUDE) $(CPP_FLAGS) "$(TMP_DIR)/$(SKETCH_NAME).cpp" -MF "$(TMP_DIR)/$(SKETCH_NAME).d" -MT "$(TMP_DIR)/$(SKETCH_NAME).o"
$(CPP) -c -mmcu=$(MCU) -DF_CPU=$(DF_CPU) $(INCLUDE) $(CPP_FLAGS) "$(TMP_DIR)/$(SKETCH_NAME).cpp" -o "$(TMP_DIR)/$(SKETCH_NAME).o"
@#Arduino core .c dependecies: @#$(CPP) -MM -mmcu=$(MCU) -DF_CPU=$(DF_CPU) $(INCLUDE) \
# $(CPP_FLAGS) "$(TMP_DIR)/$(SKETCH_NAME).cpp" \
# -MF "$(TMP_DIR)/$(SKETCH_NAME).d" \
# -MT "$(TMP_DIR)/$(SKETCH_NAME).o"
@#Compiling the sketch file:
$(CPP) -c -mmcu=$(MCU) -DF_CPU=$(DF_CPU) $(INCLUDE) \
$(CPP_FLAGS) "$(TMP_DIR)/$(SKETCH_NAME).cpp" \
-o "$(TMP_DIR)/$(SKETCH_NAME).o"
@#Compiling Arduino core .c dependecies:
for core_c_file in ${CORE_C_FILES}; do \ for core_c_file in ${CORE_C_FILES}; do \
$(CC) -c -mmcu=$(MCU) -DF_CPU=$(DF_CPU) $(INCLUDE) \ $(CC) -c -mmcu=$(MCU) -DF_CPU=$(DF_CPU) $(INCLUDE) \
$(CC_FLAGS) $(ARDUINO_CORE)/$$core_c_file.c \ $(CC_FLAGS) $(ARDUINO_CORE)/$$core_c_file.c \
-o $(TMP_DIR)/$$core_c_file.o; \ -o $(TMP_DIR)/$$core_c_file.o; \
done done
@#Arduino core .cpp dependecies: @#Compiling Arduino core .cpp dependecies:
for core_cpp_file in ${CORE_CPP_FILES}; do \ for core_cpp_file in ${CORE_CPP_FILES}; do \
$(CPP) -c -mmcu=$(MCU) -DF_CPU=$(DF_CPU) $(INCLUDE) \ $(CPP) -c -mmcu=$(MCU) -DF_CPU=$(DF_CPU) $(INCLUDE) \
$(CPP_FLAGS) $(ARDUINO_CORE)/$$core_cpp_file.cpp \ $(CPP_FLAGS) $(ARDUINO_CORE)/$$core_cpp_file.cpp \
-o $(TMP_DIR)/$$core_cpp_file.o; \ -o $(TMP_DIR)/$$core_cpp_file.o; \
done done
@#TODO: compile libraries here @#TODO: compile external libraries here
@#TODO: use .d files to track dependencies and compile them -> change .c by -MM and use -MF to generate .d @#TODO: use .d files to track dependencies and compile them
@# change .c by -MM and use -MF to generate .d
$(CC) -mmcu=$(MCU) -lm -Wl,--gc-sections -Os -o $(TMP_DIR)/$(SKETCH_NAME).elf $(TMP_DIR)/*.o $(CC) -mmcu=$(MCU) -lm -Wl,--gc-sections -Os \
$(AVR_OBJCOPY) -O ihex -R .eeprom $(TMP_DIR)/$(SKETCH_NAME).elf $(TMP_DIR)/$(SKETCH_NAME).hex -o $(TMP_DIR)/$(SKETCH_NAME).elf $(TMP_DIR)/*.o
@echo '*** Compiled successfully! \o/' $(AVR_OBJCOPY) -O ihex -R .eeprom \
$(TMP_DIR)/$(SKETCH_NAME).elf \
$(TMP_DIR)/$(SKETCH_NAME).hex
@echo '# *** Compiled successfully! \o/'
reset: reset:
@echo '*** Resetting...' @echo '# *** Resetting...'
stty --file $(PORT) hupcl stty --file $(PORT) hupcl
sleep 0.1 sleep 0.1
stty --file $(PORT) -hupcl stty --file $(PORT) -hupcl
upload: upload:
@echo '*** Uploading...' @echo '# *** Uploading...'
$(AVRDUDE) -q -V -p $(MCU) -C $(AVRDUDE_CONF) -c $(BOARD_TYPE) -b $(BAUD_RATE) -P $(PORT) -U flash:w:$(TMP_DIR)/$(SKETCH_NAME).hex:i $(AVRDUDE) -q -V -p $(MCU) -C $(AVRDUDE_CONF) -c $(BOARD_TYPE) \
@echo '*** Done - enjoy your sketch!' -b $(BAUD_RATE) -P $(PORT) \
-U flash:w:$(TMP_DIR)/$(SKETCH_NAME).hex:i
@echo '# *** Done - enjoy your sketch!'