one step closer to a functional makefile..
This commit is contained in:
parent
8463e39a4a
commit
11f2dafc4e
4 changed files with 41 additions and 16 deletions
|
@ -26,6 +26,31 @@ TERM=bash
|
||||||
############################################################################
|
############################################################################
|
||||||
# Below here nothing should be changed...
|
# Below here nothing should be changed...
|
||||||
|
|
||||||
|
LINKORDER=\
|
||||||
|
applet/Marlin.cpp.o \
|
||||||
|
applet/EEPROM.o \
|
||||||
|
applet/main.o \
|
||||||
|
applet/MarlinSerial.o \
|
||||||
|
applet/motion_control.o\
|
||||||
|
applet/pins_arduino.o\
|
||||||
|
applet/planner.o\
|
||||||
|
applet/Print.o\
|
||||||
|
applet/Sd2Card.o\
|
||||||
|
applet/SdBaseFile.o\
|
||||||
|
applet/SdFatUtil.o\
|
||||||
|
applet/SdFile.o\
|
||||||
|
applet/SdVolume.o\
|
||||||
|
applet/stepper.o\
|
||||||
|
applet/temperature.o\
|
||||||
|
applet/WInterrupts.o\
|
||||||
|
applet/wiring_analog.o\
|
||||||
|
applet/wiring_digital.o\
|
||||||
|
applet/wiring.o\
|
||||||
|
applet/wiring_pulse.o\
|
||||||
|
applet/wiring_shift.o\
|
||||||
|
applet/WMath.o
|
||||||
|
|
||||||
|
PDES=Marlin.pde ultralcd.pde watchdog.pde cardreader.pde
|
||||||
ARDUINO = $(INSTALL_DIR)/hardware/arduino/cores/arduino
|
ARDUINO = $(INSTALL_DIR)/hardware/arduino/cores/arduino
|
||||||
#
|
#
|
||||||
#~ AVR_TOOLS_PATH = $(INSTALL_DIR)/hardware/tools/avr/bin
|
#~ AVR_TOOLS_PATH = $(INSTALL_DIR)/hardware/tools/avr/bin
|
||||||
|
@ -67,18 +92,6 @@ CXXDEFS = -DF_CPU=$(BUILD_F_CPU) -DARDUINO=23
|
||||||
CINCS = -I$(ARDUINO) -I$(INSTALL_DIR)/libraries/LiquidCrystal/ -I$(INSTALL_DIR)/libraries/EEPROM/
|
CINCS = -I$(ARDUINO) -I$(INSTALL_DIR)/libraries/LiquidCrystal/ -I$(INSTALL_DIR)/libraries/EEPROM/
|
||||||
CXXINCS = -I$(ARDUINO)
|
CXXINCS = -I$(ARDUINO)
|
||||||
|
|
||||||
OBJECTS= applet/Marlin.cpp.o \
|
|
||||||
applet/EEPROM.o \
|
|
||||||
applet/pins_arduino.o \
|
|
||||||
applet/wiring_analog.o \
|
|
||||||
applet/wiring_pulse.o \
|
|
||||||
applet/main.o \
|
|
||||||
applet/Print.o \
|
|
||||||
applet/wiring_digital.o \
|
|
||||||
applet/wiring_shift.o \
|
|
||||||
applet/stepper.o \
|
|
||||||
applet/wiring.o \
|
|
||||||
applet/WMath.o
|
|
||||||
# Compiler flag to set the C Standard level.
|
# Compiler flag to set the C Standard level.
|
||||||
# c89 - "ANSI" C
|
# c89 - "ANSI" C
|
||||||
# gnu89 - c89 plus GCC extensions
|
# gnu89 - c89 plus GCC extensions
|
||||||
|
@ -141,6 +154,7 @@ MV = mv -f
|
||||||
# and then, match to corresponding rule somehow?
|
# and then, match to corresponding rule somehow?
|
||||||
# or leave this - and parse in rule (auth automatic variable $(@F))?
|
# or leave this - and parse in rule (auth automatic variable $(@F))?
|
||||||
# "Suffix Replacement"
|
# "Suffix Replacement"
|
||||||
|
CXXSRC+=MarlinSerial.cpp SdBaseFile.cpp stepper.cpp motion_control.cpp SdFatUtil.cpp temperature.cpp planner.cpp SdFile.cpp Sd2Card.cpp SdVolume.cpp
|
||||||
OBJ = $(SRC:.c=.o) $(CXXSRC:.cpp=.o) $(ASRC:.S=.o)
|
OBJ = $(SRC:.c=.o) $(CXXSRC:.cpp=.o) $(ASRC:.S=.o)
|
||||||
|
|
||||||
# added - OBJ list, transformed into applet/
|
# added - OBJ list, transformed into applet/
|
||||||
|
@ -204,7 +218,9 @@ applet_files: $(TARGET).pde
|
||||||
@echo ALL CXXLIBOBJ: $(CXXLIBOBJ)
|
@echo ALL CXXLIBOBJ: $(CXXLIBOBJ)
|
||||||
# echo '#include "WProgram.h"' > applet/$(TARGET).cpp
|
# echo '#include "WProgram.h"' > applet/$(TARGET).cpp
|
||||||
@echo "#include \"WProgram.h\"\nvoid setup();\nvoid loop();\n" > applet/$(TARGET).cpp
|
@echo "#include \"WProgram.h\"\nvoid setup();\nvoid loop();\n" > applet/$(TARGET).cpp
|
||||||
cat $(TARGET).pde >> applet/$(TARGET).cpp
|
##cat $(TARGET).pde >> applet/$(TARGET).cpp
|
||||||
|
cat ${PDES}>> applet/$(TARGET).cpp
|
||||||
|
cp *.cpp applet/
|
||||||
# no more need to cat main.cpp (v0022) - now it is compiled in
|
# no more need to cat main.cpp (v0022) - now it is compiled in
|
||||||
# cat $(ARDUINO)/main.cpp >> applet/$(TARGET).cpp
|
# cat $(ARDUINO)/main.cpp >> applet/$(TARGET).cpp
|
||||||
|
|
||||||
|
@ -265,7 +281,9 @@ applet/$(TARGET).elf: $(TARGET).pde applet/$(TARGET).cpp.o applet/core.a
|
||||||
# $(CC) $(ALL_CFLAGS) -o $@ applet/$(TARGET).cpp -L. applet/core.a $(LDFLAGS)
|
# $(CC) $(ALL_CFLAGS) -o $@ applet/$(TARGET).cpp -L. applet/core.a $(LDFLAGS)
|
||||||
# changed as in IDE v0022: link cpp obj files
|
# changed as in IDE v0022: link cpp obj files
|
||||||
@echo $$(tput bold)$$(tput setaf 2) $(CC) $$(tput sgr0) $(ALL_CFLAGS) $(CFINALF) -o $@ applet/$(TARGET).cpp.o $(CXXOBJ) -L. applet/core.a $(LDFLAGS)
|
@echo $$(tput bold)$$(tput setaf 2) $(CC) $$(tput sgr0) $(ALL_CFLAGS) $(CFINALF) -o $@ applet/$(TARGET).cpp.o $(CXXOBJ) -L. applet/core.a $(LDFLAGS)
|
||||||
$(CC) $(ALL_CFLAGS) $(CFINALF) -o $@ $OBJECTS -L. applet/core.a $(LDFLAGS)
|
echo ${OBJT}
|
||||||
|
#$(CC) $(ALL_CFLAGS) $(CFINALF) -o $@ applet/$(TARGET).cpp.o -L. applet/core.a $(LDFLAGS)
|
||||||
|
$(CC) $(ALL_CFLAGS) $(CFINALF) -o $@ ${LINKORDER} $(LDFLAGS)
|
||||||
#@$(CC) $(ALL_CFLAGS) $(CFINALF) -o $@ applet/*.o applet/$(TARGET).cpp.o $(CXXOBJ) -L. applet/core.a $(LDFLAGS)
|
#@$(CC) $(ALL_CFLAGS) $(CFINALF) -o $@ applet/*.o applet/$(TARGET).cpp.o $(CXXOBJ) -L. applet/core.a $(LDFLAGS)
|
||||||
|
|
||||||
# added: cpp.o depends on cpp (and .pde which generates it)
|
# added: cpp.o depends on cpp (and .pde which generates it)
|
||||||
|
|
|
@ -47,7 +47,6 @@ SdFile::SdFile(const char* path, uint8_t oflag) : SdBaseFile(path, oflag) {
|
||||||
int16_t SdFile::write(const void* buf, uint16_t nbyte) {
|
int16_t SdFile::write(const void* buf, uint16_t nbyte) {
|
||||||
return SdBaseFile::write(buf, nbyte);
|
return SdBaseFile::write(buf, nbyte);
|
||||||
}
|
}
|
||||||
#warning F_CPU
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
/** Write a byte to a file. Required by the Arduino Print class.
|
/** Write a byte to a file. Required by the Arduino Print class.
|
||||||
* \param[in] b the byte to be written.
|
* \param[in] b the byte to be written.
|
||||||
|
|
|
@ -151,5 +151,13 @@
|
||||||
|
|
||||||
void lcd_statuspgm(const char* message);
|
void lcd_statuspgm(const char* message);
|
||||||
|
|
||||||
|
char *ftostr3(const float &x);
|
||||||
|
char *itostr2(const uint8_t &x);
|
||||||
|
char *ftostr31(const float &x);
|
||||||
|
char *ftostr32(const float &x);
|
||||||
|
char *itostr31(const int &xx);
|
||||||
|
char *itostr3(const int &xx);
|
||||||
|
char *itostr4(const int &xx);
|
||||||
|
char *ftostr51(const float &x);
|
||||||
#endif //ULTRALCD
|
#endif //ULTRALCD
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ static char conv[8];
|
||||||
LiquidCrystal lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7
|
LiquidCrystal lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7
|
||||||
|
|
||||||
static unsigned long previous_millis_lcd=0;
|
static unsigned long previous_millis_lcd=0;
|
||||||
static long previous_millis_buttons=0;
|
//static long previous_millis_buttons=0;
|
||||||
|
|
||||||
|
|
||||||
#ifdef NEWPANEL
|
#ifdef NEWPANEL
|
||||||
|
|
Reference in a new issue