From 995d50998c42efeaef0095769178ac061e25cf3c Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 5 May 2023 18:23:01 +0200 Subject: try different compiler flags --- zumo/makefile | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) (limited to 'zumo/makefile') diff --git a/zumo/makefile b/zumo/makefile index c388a28..08c01d7 100644 --- a/zumo/makefile +++ b/zumo/makefile @@ -2,33 +2,58 @@ PORT = /dev/ttyUSB0 C++ = avr-g++ CC = avr-gcc -LD = avr-ld +LD = avr-gcc RM = rm -f MCU = atmega32u4 TARGET = main SRCS += main.cpp -CFLAGS += -mcall-prologues -CFLAGS += -mmcu=$(MCU) -CFLAGS += -Os -CFLAGS += -g -CFLAGS += -Wl,-gc-sections -CFLAGS += -Wl,-relax +C_CPP_FLAGS += -mmcu=$(MCU) +C_CPP_FLAGS += -Wl,-gc-sections +SHARED_FLAGS += -Os + +C_CPP_FLAGS += -mcall-prologues +C_CPP_FLAGS += -g +C_CPP_FLAGS += -Wl,-relax +C_CPP_FLAGS += -MMD +C_CPP_FLAGS += -ffunction-sections +C_CPP_FLAGS += -fdata-sections + +LFLAGS += -flto +LFLAGS += -fuse-linker-plugin +LFLAGS += -lc -lm +# LFLAGS += -L/usr/avr/lib/avr5/ -L/usr/lib/gcc/avr/12.2.0/avr5 -lgcc -lm -lc -latmega32u4 +# LFLAGS += -flto -fuse-linker-plugin -mmcu=atmega32u4 -Wl,--gc-sections -Os -lc -lm + + +CFLAGS += -fno-fat-lto-objects +# CFLAGS += -std=gnu11 + +CPPFLAGS += -fpermissive +CPPFLAGS += -fno-exceptions +CPPFLAGS += -fno-threadsafe-statics +CPPFLAGS += -fno-devirtualize +# CPPFLAGS += -std=gnu++11 + + +LFLAGS += $(SHARED_FLAGS) +CFLAGS += $(C_CPP_FLAGS) $(SHARED_FLAGS) +CPPFLAGS += $(C_CPP_FLAGS) $(SHARED_FLAGS) include zumo.mk OBJS := $(patsubst %.c,%.o, $(SRCS)) OBJS := $(patsubst %.cpp,%.o, $(OBJS)) -MAKEFLAGS += -j4 +MAKEFLAGS += -j .PHONY: all clean flash all: $(TARGET).hex %.o: %.cpp - $(C++) $(CFLAGS) -o $@ -c $< + $(C++) $(CPPFLAGS) -o $@ -c $< %.o: %.c $(CC) $(CFLAGS) -o $@ -c $< -- cgit v1.2.3 From ba4cc491d546767fbb344d279d216cfb5ea0cc1f Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 21 May 2023 14:07:37 +0200 Subject: remove custom build system from zumo folder (not worth) --- .gitmodules | 27 -------------- zumo/.gitignore | 4 --- zumo/lib/ArduinoCore-avr | 1 - zumo/lib/fastgpio-arduino | 1 - zumo/lib/pololu-buzzer-arduino | 1 - zumo/lib/pololu-hd44780-arduino | 1 - zumo/lib/pololu-menu-arduino | 1 - zumo/lib/pololu-oled-arduino | 1 - zumo/lib/pushbutton-arduino | 1 - zumo/lib/usb-pause-arduino | 1 - zumo/lib/zumo-32u4-arduino-library | 1 - zumo/makefile | 74 -------------------------------------- zumo/zumo.mk | 73 ------------------------------------- 13 files changed, 187 deletions(-) delete mode 100644 .gitmodules delete mode 160000 zumo/lib/ArduinoCore-avr delete mode 160000 zumo/lib/fastgpio-arduino delete mode 160000 zumo/lib/pololu-buzzer-arduino delete mode 160000 zumo/lib/pololu-hd44780-arduino delete mode 160000 zumo/lib/pololu-menu-arduino delete mode 160000 zumo/lib/pololu-oled-arduino delete mode 160000 zumo/lib/pushbutton-arduino delete mode 160000 zumo/lib/usb-pause-arduino delete mode 160000 zumo/lib/zumo-32u4-arduino-library delete mode 100644 zumo/makefile delete mode 100644 zumo/zumo.mk (limited to 'zumo/makefile') diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index a60d698..0000000 --- a/.gitmodules +++ /dev/null @@ -1,27 +0,0 @@ -[submodule "zumo/lib/zumo-32u4-arduino-library"] - path = zumo/lib/zumo-32u4-arduino-library - url = https://github.com/pololu/zumo-32u4-arduino-library -[submodule "zumo/lib/fastgpio-arduino"] - path = zumo/lib/fastgpio-arduino - url = https://github.com/pololu/fastgpio-arduino -[submodule "zumo/lib/pushbutton-arduino"] - path = zumo/lib/pushbutton-arduino - url = https://github.com/pololu/pushbutton-arduino -[submodule "zumo/lib/ArduinoCore-avr"] - path = zumo/lib/ArduinoCore-avr - url = https://github.com/arduino/ArduinoCore-avr -[submodule "zumo/lib/usb-pause-arduino"] - path = zumo/lib/usb-pause-arduino - url = https://github.com/pololu/usb-pause-arduino -[submodule "zumo/lib/pololu-buzzer-arduino"] - path = zumo/lib/pololu-buzzer-arduino - url = https://github.com/pololu/pololu-buzzer-arduino -[submodule "zumo/lib/pololu-hd44780-arduino"] - path = zumo/lib/pololu-hd44780-arduino - url = https://github.com/pololu/pololu-hd44780-arduino -[submodule "zumo/lib/pololu-menu-arduino"] - path = zumo/lib/pololu-menu-arduino - url = https://github.com/pololu/pololu-menu-arduino -[submodule "zumo/lib/pololu-oled-arduino"] - path = zumo/lib/pololu-oled-arduino - url = https://github.com/pololu/pololu-oled-arduino diff --git a/zumo/.gitignore b/zumo/.gitignore index 888e905..e45f7a2 100644 --- a/zumo/.gitignore +++ b/zumo/.gitignore @@ -1,6 +1,2 @@ -main *.o -*.hex -compile_commands.json -.cache pidtest diff --git a/zumo/lib/ArduinoCore-avr b/zumo/lib/ArduinoCore-avr deleted file mode 160000 index 42fa4a1..0000000 --- a/zumo/lib/ArduinoCore-avr +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 42fa4a1ea1b1b11d1cc0a60298e529d37f9d14bd diff --git a/zumo/lib/fastgpio-arduino b/zumo/lib/fastgpio-arduino deleted file mode 160000 index 5853c59..0000000 --- a/zumo/lib/fastgpio-arduino +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5853c593b07730e632127570279e7dea06de1af3 diff --git a/zumo/lib/pololu-buzzer-arduino b/zumo/lib/pololu-buzzer-arduino deleted file mode 160000 index 20ef7b7..0000000 --- a/zumo/lib/pololu-buzzer-arduino +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 20ef7b734814a7c5e9f02f54a2cdd41729759d51 diff --git a/zumo/lib/pololu-hd44780-arduino b/zumo/lib/pololu-hd44780-arduino deleted file mode 160000 index 0a35789..0000000 --- a/zumo/lib/pololu-hd44780-arduino +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0a35789a58ca92ca6f69b63fbc269959b2d18584 diff --git a/zumo/lib/pololu-menu-arduino b/zumo/lib/pololu-menu-arduino deleted file mode 160000 index 8970b8d..0000000 --- a/zumo/lib/pololu-menu-arduino +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8970b8db6e4e80b1c0e95172a87a35410bf593bf diff --git a/zumo/lib/pololu-oled-arduino b/zumo/lib/pololu-oled-arduino deleted file mode 160000 index e6b83b6..0000000 --- a/zumo/lib/pololu-oled-arduino +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e6b83b6c181962ffb98f99a4a4c3fd7cbf7e6707 diff --git a/zumo/lib/pushbutton-arduino b/zumo/lib/pushbutton-arduino deleted file mode 160000 index 442884e..0000000 --- a/zumo/lib/pushbutton-arduino +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 442884e004859ff550d5c0cae70033d7d568fc21 diff --git a/zumo/lib/usb-pause-arduino b/zumo/lib/usb-pause-arduino deleted file mode 160000 index 3f76e48..0000000 --- a/zumo/lib/usb-pause-arduino +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3f76e486460bb351f9738c86595f22db2da34c51 diff --git a/zumo/lib/zumo-32u4-arduino-library b/zumo/lib/zumo-32u4-arduino-library deleted file mode 160000 index f4dfe05..0000000 --- a/zumo/lib/zumo-32u4-arduino-library +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f4dfe054e23176ba445748b4b91f463701e7eb76 diff --git a/zumo/makefile b/zumo/makefile deleted file mode 100644 index 08c01d7..0000000 --- a/zumo/makefile +++ /dev/null @@ -1,74 +0,0 @@ -PORT = /dev/ttyUSB0 - -C++ = avr-g++ -CC = avr-gcc -LD = avr-gcc -RM = rm -f - -MCU = atmega32u4 -TARGET = main -SRCS += main.cpp - -C_CPP_FLAGS += -mmcu=$(MCU) -C_CPP_FLAGS += -Wl,-gc-sections -SHARED_FLAGS += -Os - -C_CPP_FLAGS += -mcall-prologues -C_CPP_FLAGS += -g -C_CPP_FLAGS += -Wl,-relax -C_CPP_FLAGS += -MMD -C_CPP_FLAGS += -ffunction-sections -C_CPP_FLAGS += -fdata-sections - -LFLAGS += -flto -LFLAGS += -fuse-linker-plugin -LFLAGS += -lc -lm -# LFLAGS += -L/usr/avr/lib/avr5/ -L/usr/lib/gcc/avr/12.2.0/avr5 -lgcc -lm -lc -latmega32u4 -# LFLAGS += -flto -fuse-linker-plugin -mmcu=atmega32u4 -Wl,--gc-sections -Os -lc -lm - - -CFLAGS += -fno-fat-lto-objects -# CFLAGS += -std=gnu11 - -CPPFLAGS += -fpermissive -CPPFLAGS += -fno-exceptions -CPPFLAGS += -fno-threadsafe-statics -CPPFLAGS += -fno-devirtualize -# CPPFLAGS += -std=gnu++11 - - -LFLAGS += $(SHARED_FLAGS) -CFLAGS += $(C_CPP_FLAGS) $(SHARED_FLAGS) -CPPFLAGS += $(C_CPP_FLAGS) $(SHARED_FLAGS) - -include zumo.mk - -OBJS := $(patsubst %.c,%.o, $(SRCS)) -OBJS := $(patsubst %.cpp,%.o, $(OBJS)) - -MAKEFLAGS += -j - -.PHONY: all clean flash - -all: $(TARGET).hex - -%.o: %.cpp - $(C++) $(CPPFLAGS) -o $@ -c $< - -%.o: %.c - $(CC) $(CFLAGS) -o $@ -c $< - -$(TARGET): $(OBJS) - $(LD) $(LFLAGS) -o $@ $^ - -$(TARGET).hex: $(TARGET) - avr-objcopy -R .eeprom -O ihex $< $@ - -flash: $(TARGET).hex - avrdude -p $(MCU) -c avr109 -P $(PORT) -U flash:w:$(TARGET).hex - -clean: - $(RM) $(TARGET) $(TARGET).hex $(OBJS) - -compile_commands.json: makefile - compiledb make -Bn diff --git a/zumo/zumo.mk b/zumo/zumo.mk deleted file mode 100644 index f5ab84b..0000000 --- a/zumo/zumo.mk +++ /dev/null @@ -1,73 +0,0 @@ -C_CPP_FLAGS += -DF_CPU=16000000L -C_CPP_FLAGS += -D__PROG_TYPES_COMPAT__ -C_CPP_FLAGS += -DARDUINO=1819 -C_CPP_FLAGS += -DARDUINO_AVR_LEONARDO -C_CPP_FLAGS += -DARDUINO_ARCH_AVR -C_CPP_FLAGS += -DARDUINO_BOARD='"AVR_LEONARDO"' -C_CPP_FLAGS += -DARDUINO_VARIANT='"leonardo"' -C_CPP_FLAGS += -DUSB_VID=0x2341 -C_CPP_FLAGS += -DUSB_PID=0x8036 -C_CPP_FLAGS += -DUSB_PRODUCT='"Arduino Leonardo"' -C_CPP_FLAGS += -DUSB_MANUFACTURER='"Unknown"' - -C_CPP_FLAGS += -I./lib/zumo-32u4-arduino-library/src -C_CPP_FLAGS += -I./lib/fastgpio-arduino -C_CPP_FLAGS += -I./lib/pushbutton-arduino -C_CPP_FLAGS += -I./lib/usb-pause-arduino -C_CPP_FLAGS += -I./lib/pololu-buzzer-arduino/src -C_CPP_FLAGS += -I./lib/pololu-hd44780-arduino -C_CPP_FLAGS += -I./lib/pololu-menu-arduino/src -C_CPP_FLAGS += -I./lib/pololu-oled-arduino/src -C_CPP_FLAGS += -I./lib/ArduinoCore-avr/cores/arduino -C_CPP_FLAGS += -I./lib/ArduinoCore-avr/libraries/HID/src -C_CPP_FLAGS += -I./lib/ArduinoCore-avr/libraries/SoftwareSerial/src -C_CPP_FLAGS += -I./lib/ArduinoCore-avr/libraries/SPI/src -C_CPP_FLAGS += -I./lib/ArduinoCore-avr/libraries/EEPROM/src -C_CPP_FLAGS += -I./lib/ArduinoCore-avr/libraries/Wire/src -C_CPP_FLAGS += -I./lib/ArduinoCore-avr/variants/leonardo - -# LIBS += lib/ArduinoCore-avr/cores/arduino/PluggableUSB.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/CDC.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/HardwareSerial.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/USBCore.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/HardwareSerial0.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/HardwareSerial1.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/HardwareSerial2.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/HardwareSerial3.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/IPAddress.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/Print.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/Stream.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/WMath.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/WString.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/abi.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/main.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/new.cpp -# LIBS += lib/ArduinoCore-avr/libraries/HID/src/HID.cpp -# LIBS += lib/ArduinoCore-avr/libraries/SPI/src/SPI.cpp -# LIBS += lib/ArduinoCore-avr/libraries/SoftwareSerial/src/SoftwareSerial.cpp -LIBS += lib/ArduinoCore-avr/libraries/Wire/src/Wire.cpp -LIBS += lib/ArduinoCore-avr/cores/arduino/WInterrupts.c -LIBS += lib/ArduinoCore-avr/cores/arduino/hooks.c -LIBS += lib/ArduinoCore-avr/cores/arduino/wiring_shift.c -LIBS += lib/ArduinoCore-avr/cores/arduino/wiring_digital.c -LIBS += lib/ArduinoCore-avr/cores/arduino/wiring_analog.c -LIBS += lib/ArduinoCore-avr/cores/arduino/wiring_pulse.c -LIBS += lib/ArduinoCore-avr/cores/arduino/wiring.c -LIBS += lib/ArduinoCore-avr/cores/arduino/Tone.cpp -# LIBS += lib/ArduinoCore-avr/libraries/Wire/src/utility/twi.c - -LIBS += lib/pololu-buzzer-arduino/src/PololuBuzzer.cpp -LIBS += lib/pushbutton-arduino/Pushbutton.cpp -LIBS += lib/zumo-32u4-arduino-library/src/QTRSensors.cpp -LIBS += lib/zumo-32u4-arduino-library/src/Zumo32U4IRPulses.cpp -LIBS += lib/zumo-32u4-arduino-library/src/Zumo32U4Encoders.cpp -LIBS += lib/zumo-32u4-arduino-library/src/Zumo32U4IMU.cpp -LIBS += lib/zumo-32u4-arduino-library/src/Zumo32U4Motors.cpp -LIBS += lib/zumo-32u4-arduino-library/src/Zumo32U4ProximitySensors.cpp -LIBS += lib/usb-pause-arduino/USBPause.cpp -LIBS += lib/pololu-hd44780-arduino/PololuHD44780.cpp -LIBS += lib/fastgpio-arduino/FastGPIO.cpp -LIBS += lib/pololu-oled-arduino/src/font.cpp - -SRCS += $(LIBS) - -- cgit v1.2.3