From 55a9a832ad8c951e6b52cf08a8d7b85ca60c6554 Mon Sep 17 00:00:00 2001 From: Samuel Kyletoft Date: Sun, 13 Feb 2022 22:02:28 +0000 Subject: [PATCH] Simplify templates for having everything on PATH on Windows --- vsc_gui/templates/basic/.vscode/launch.json | 5 +-- vsc_gui/templates/basic/.vscode/tasks.json | 32 +------------ vsc_gui/templates/basic/makefile | 50 ++++----------------- vsc_gui/templates/crt/.vscode/launch.json | 5 +-- vsc_gui/templates/crt/.vscode/tasks.json | 32 +------------ vsc_gui/templates/crt/makefile | 50 ++++----------------- 6 files changed, 22 insertions(+), 152 deletions(-) diff --git a/vsc_gui/templates/basic/.vscode/launch.json b/vsc_gui/templates/basic/.vscode/launch.json index 63d7dbf..2f204ce 100644 --- a/vsc_gui/templates/basic/.vscode/launch.json +++ b/vsc_gui/templates/basic/.vscode/launch.json @@ -1,7 +1,4 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { @@ -9,7 +6,7 @@ "gdbpath": "gdb-multiarch" }, "windows": { - "gdbpath": "C:/Program Files (x86)/GMV/Eterm8/arm-none-eabi-gdb" + "gdbpath": "arm-none-eabi-gdb" }, "name": "Debug - SimServer", "type": "gdb", diff --git a/vsc_gui/templates/basic/.vscode/tasks.json b/vsc_gui/templates/basic/.vscode/tasks.json index da4af74..6399d92 100644 --- a/vsc_gui/templates/basic/.vscode/tasks.json +++ b/vsc_gui/templates/basic/.vscode/tasks.json @@ -9,35 +9,7 @@ "kind": "build", "isDefault": true }, - "linux": { - "command": "make build_linux" - }, - "windows": { - "command": "C:/cseapp/CodeLite/mingw32-make build_windows" - } - }, - { - "label": "run_hardware", - "type": "shell", - "linux": { - "command": "make run_linux" - }, - "windows": { - "command": "C:/cseapp/CodeLite/mingw32-make run_windows" - }, - "problemMatcher": [], - "group": "build" - }, - { - "label": "query", - "type": "shell", - "linux": { - "command": "make query_linux" - }, - "windows": { - "command": "C:/cseapp/CodeLite/mingw32-make query_windows" - }, - "problemMatcher": [] - }, + "command": "make build" + } ] } diff --git a/vsc_gui/templates/basic/makefile b/vsc_gui/templates/basic/makefile index 9014a9e..81b3a71 100644 --- a/vsc_gui/templates/basic/makefile +++ b/vsc_gui/templates/basic/makefile @@ -4,59 +4,25 @@ FILES := \ startup.c \ debug.c -# Copy the value from query_* to here. If there are several, you might have to try them all -WINDOWS_PORT := COM3 -LINUX_PORT := /dev/ttyUSB0 - # +---------------------------------------------------------------------------+ # | | # | If you're just using the templates, there's nothing to look at below this | # | | # +---------------------------------------------------------------------------+ -# Yes, these are hacky and don't allow anything to be cached. I'm not gonna do the research to figure that one out for programs of this scale. +# Yes, this is hacky and doesn't allow anything to be cached. I'm not gonna do the research to figure that one out for programs of this scale. # Merge requests welcome though -GCCPATH := C:/cseapp/CodeLite/tools/gcc-arm/bin -RUN_W := "./.vscode/hardware-com-windows.exe" -RUN_L := "./.vscode/hardware-com-linux" - -build_windows: +build: -mkdir debug -cls - $(GCCPATH)/arm-none-eabi-gcc -c $(FILES) -g -O0 -w -mthumb -march=armv6-m -mno-unaligned-access -mfloat-abi=soft -std=gnu17 -I. -I. - $(GCCPATH)/arm-none-eabi-g++ -o debug/MOP -L. *.o -lgcc -lc_nano -Tmd407-ram.x -LC:/cseapp/CodeLite/tools/gcc-arm/lib/gcc/arm-none-eabi/9.2.1/thumb/v6-m/nofp -nostartfiles - $(GCCPATH)/arm-none-eabi-objcopy -S -O srec debug/MOP debug/MOP.s19 - $(GCCPATH)/arm-none-eabi-objdump -D -S debug/MOP > debug/MOP.dass - -rm *.o - -build_linux: - -mkdir debug -clear - arm-none-eabi-gcc -c $(FILES) -g -O0 -w -mthumb -march=armv6-m -mno-unaligned-access -mfloat-abi=soft -std=gnu17 -I. -I. - arm-none-eabi-g++ -o debug/MOP -L. *.o -lgcc -lc_nano -Tmd407-ram.x -L/usr/include/newlib/c++/9.2.1/arm-none-eabi/thumb/v6-m/nofp -L/usr/lib/arm-none-eabi/newlib/thumb/v6-m/nofp -L/usr/lib/gcc/arm-none-eabi/9.2.1/thumb/v6-m/nofp -nostartfiles + arm-none-eabi-gcc -c $(FILES) -g -O0 -w -mthumb -march=armv6-m -mno-unaligned-access -mfloat-abi=soft -std=gnu17 -I. -I ./inc + arm-none-eabi-g++ -o debug/MOP -L. *.o -lgcc -lc_nano -Tmd407-ram.x -nostartfiles\ + -L'C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/lib/gcc/arm-none-eabi/10.3.1/thumb/v6-m/nofp' \ + -L/usr/include/newlib/c++/9.2.1/arm-none-eabi/thumb/v6-m/nofp -L/usr/lib/arm-none-eabi/newlib/thumb/v6-m/nofp \ + -L/usr/lib/gcc/arm-none-eabi/9.2.1/thumb/v6-m/nofp arm-none-eabi-objcopy -S -O srec debug/MOP debug/MOP.s19 arm-none-eabi-objdump -D -S debug/MOP > debug/MOP.dass -rm *.o - -run_windows: - C:/cseapp/CodeLite/mingw32-make build_windows - -cls - $(RUN_W) load -p $(WINDOWS_PORT) -f debug/MOP.s19 - $(RUN_W) interactive -p $(WINDOWS_PORT) - -run_linux: - make build_linux - -chmod +x $(RUN_L) - -clear - $(RUN_L) load -p $(LINUX_PORT) -f debug/MOP.s19 - $(RUN_L) interactive -p $(LINUX_PORT) - -query_windows: - -cls - $(RUN_W) query - -query_linux: - -chmod +x $(RUN_L) - -clear - $(RUN_L) query + -del *.o diff --git a/vsc_gui/templates/crt/.vscode/launch.json b/vsc_gui/templates/crt/.vscode/launch.json index 63d7dbf..2f204ce 100644 --- a/vsc_gui/templates/crt/.vscode/launch.json +++ b/vsc_gui/templates/crt/.vscode/launch.json @@ -1,7 +1,4 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { @@ -9,7 +6,7 @@ "gdbpath": "gdb-multiarch" }, "windows": { - "gdbpath": "C:/Program Files (x86)/GMV/Eterm8/arm-none-eabi-gdb" + "gdbpath": "arm-none-eabi-gdb" }, "name": "Debug - SimServer", "type": "gdb", diff --git a/vsc_gui/templates/crt/.vscode/tasks.json b/vsc_gui/templates/crt/.vscode/tasks.json index da4af74..6399d92 100644 --- a/vsc_gui/templates/crt/.vscode/tasks.json +++ b/vsc_gui/templates/crt/.vscode/tasks.json @@ -9,35 +9,7 @@ "kind": "build", "isDefault": true }, - "linux": { - "command": "make build_linux" - }, - "windows": { - "command": "C:/cseapp/CodeLite/mingw32-make build_windows" - } - }, - { - "label": "run_hardware", - "type": "shell", - "linux": { - "command": "make run_linux" - }, - "windows": { - "command": "C:/cseapp/CodeLite/mingw32-make run_windows" - }, - "problemMatcher": [], - "group": "build" - }, - { - "label": "query", - "type": "shell", - "linux": { - "command": "make query_linux" - }, - "windows": { - "command": "C:/cseapp/CodeLite/mingw32-make query_windows" - }, - "problemMatcher": [] - }, + "command": "make build" + } ] } diff --git a/vsc_gui/templates/crt/makefile b/vsc_gui/templates/crt/makefile index 9014a9e..81b3a71 100644 --- a/vsc_gui/templates/crt/makefile +++ b/vsc_gui/templates/crt/makefile @@ -4,59 +4,25 @@ FILES := \ startup.c \ debug.c -# Copy the value from query_* to here. If there are several, you might have to try them all -WINDOWS_PORT := COM3 -LINUX_PORT := /dev/ttyUSB0 - # +---------------------------------------------------------------------------+ # | | # | If you're just using the templates, there's nothing to look at below this | # | | # +---------------------------------------------------------------------------+ -# Yes, these are hacky and don't allow anything to be cached. I'm not gonna do the research to figure that one out for programs of this scale. +# Yes, this is hacky and doesn't allow anything to be cached. I'm not gonna do the research to figure that one out for programs of this scale. # Merge requests welcome though -GCCPATH := C:/cseapp/CodeLite/tools/gcc-arm/bin -RUN_W := "./.vscode/hardware-com-windows.exe" -RUN_L := "./.vscode/hardware-com-linux" - -build_windows: +build: -mkdir debug -cls - $(GCCPATH)/arm-none-eabi-gcc -c $(FILES) -g -O0 -w -mthumb -march=armv6-m -mno-unaligned-access -mfloat-abi=soft -std=gnu17 -I. -I. - $(GCCPATH)/arm-none-eabi-g++ -o debug/MOP -L. *.o -lgcc -lc_nano -Tmd407-ram.x -LC:/cseapp/CodeLite/tools/gcc-arm/lib/gcc/arm-none-eabi/9.2.1/thumb/v6-m/nofp -nostartfiles - $(GCCPATH)/arm-none-eabi-objcopy -S -O srec debug/MOP debug/MOP.s19 - $(GCCPATH)/arm-none-eabi-objdump -D -S debug/MOP > debug/MOP.dass - -rm *.o - -build_linux: - -mkdir debug -clear - arm-none-eabi-gcc -c $(FILES) -g -O0 -w -mthumb -march=armv6-m -mno-unaligned-access -mfloat-abi=soft -std=gnu17 -I. -I. - arm-none-eabi-g++ -o debug/MOP -L. *.o -lgcc -lc_nano -Tmd407-ram.x -L/usr/include/newlib/c++/9.2.1/arm-none-eabi/thumb/v6-m/nofp -L/usr/lib/arm-none-eabi/newlib/thumb/v6-m/nofp -L/usr/lib/gcc/arm-none-eabi/9.2.1/thumb/v6-m/nofp -nostartfiles + arm-none-eabi-gcc -c $(FILES) -g -O0 -w -mthumb -march=armv6-m -mno-unaligned-access -mfloat-abi=soft -std=gnu17 -I. -I ./inc + arm-none-eabi-g++ -o debug/MOP -L. *.o -lgcc -lc_nano -Tmd407-ram.x -nostartfiles\ + -L'C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/lib/gcc/arm-none-eabi/10.3.1/thumb/v6-m/nofp' \ + -L/usr/include/newlib/c++/9.2.1/arm-none-eabi/thumb/v6-m/nofp -L/usr/lib/arm-none-eabi/newlib/thumb/v6-m/nofp \ + -L/usr/lib/gcc/arm-none-eabi/9.2.1/thumb/v6-m/nofp arm-none-eabi-objcopy -S -O srec debug/MOP debug/MOP.s19 arm-none-eabi-objdump -D -S debug/MOP > debug/MOP.dass -rm *.o - -run_windows: - C:/cseapp/CodeLite/mingw32-make build_windows - -cls - $(RUN_W) load -p $(WINDOWS_PORT) -f debug/MOP.s19 - $(RUN_W) interactive -p $(WINDOWS_PORT) - -run_linux: - make build_linux - -chmod +x $(RUN_L) - -clear - $(RUN_L) load -p $(LINUX_PORT) -f debug/MOP.s19 - $(RUN_L) interactive -p $(LINUX_PORT) - -query_windows: - -cls - $(RUN_W) query - -query_linux: - -chmod +x $(RUN_L) - -clear - $(RUN_L) query + -del *.o