From b49bae199727d313683cba5401a2ac1cf87a6a4a Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 6 Oct 2022 00:19:29 +0200 Subject: further cleanup sdk builds --- chibios-blink/Makefile | 2 +- debug.mk | 28 ++++++++++++++++++++++++++++ rules.mk | 28 ---------------------------- sdk-blink/CMakeLists.txt | 33 +++++++++++++++++++++++---------- sdk-blink/Makefile | 24 ++++++------------------ sdk.mk | 37 +++++++++++++++++++++++++++++++++++++ 6 files changed, 95 insertions(+), 57 deletions(-) create mode 100644 debug.mk delete mode 100644 rules.mk create mode 100644 sdk.mk diff --git a/chibios-blink/Makefile b/chibios-blink/Makefile index 9180851..53c5b2a 100644 --- a/chibios-blink/Makefile +++ b/chibios-blink/Makefile @@ -190,7 +190,7 @@ include $(RULESPATH)/rules.mk # Custom rules # -include ../rules.mk +include ../debug.mk # # Custom rules diff --git a/debug.mk b/debug.mk new file mode 100644 index 0000000..96745eb --- /dev/null +++ b/debug.mk @@ -0,0 +1,28 @@ +## +## spreadspace rppico utils +## +## +## Copyright (C) 2022 Christian Pointner +## +## This file is part of spreadspace rppico utils. +## +## spreadspace rppico utils is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## any later version. +## +## spreadspace rppico utils is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with spreadspace rppico utils. If not, see . +## + +gdb-server: + $(OPENOCD)/src/openocd -s $(OPENOCD)/tcl -f interface/picoprobe.cfg -f target/rp2040.cfg -c "tcl_port disabled; telnet_port disabled; gdb_port 4242;" +# $(OPENOCD)/src/openocd -s $(OPENOCD)/tcl -f interface/picoprobe.cfg -f target/rp2040.cfg -c "tcl_port disabled; telnet_port disabled; gdb_port 4242; rp2040.core0 configure -rtos chibios; rp2040.core1 configure -rtos chibios;" + +gdb: + arm-none-eabi-gdb -se "build/$(PROJECT).elf" -ex "target extended-remote localhost:4242" diff --git a/rules.mk b/rules.mk deleted file mode 100644 index 96745eb..0000000 --- a/rules.mk +++ /dev/null @@ -1,28 +0,0 @@ -## -## spreadspace rppico utils -## -## -## Copyright (C) 2022 Christian Pointner -## -## This file is part of spreadspace rppico utils. -## -## spreadspace rppico utils is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## any later version. -## -## spreadspace rppico utils is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with spreadspace rppico utils. If not, see . -## - -gdb-server: - $(OPENOCD)/src/openocd -s $(OPENOCD)/tcl -f interface/picoprobe.cfg -f target/rp2040.cfg -c "tcl_port disabled; telnet_port disabled; gdb_port 4242;" -# $(OPENOCD)/src/openocd -s $(OPENOCD)/tcl -f interface/picoprobe.cfg -f target/rp2040.cfg -c "tcl_port disabled; telnet_port disabled; gdb_port 4242; rp2040.core0 configure -rtos chibios; rp2040.core1 configure -rtos chibios;" - -gdb: - arm-none-eabi-gdb -se "build/$(PROJECT).elf" -ex "target extended-remote localhost:4242" diff --git a/sdk-blink/CMakeLists.txt b/sdk-blink/CMakeLists.txt index c365501..85c5ad4 100644 --- a/sdk-blink/CMakeLists.txt +++ b/sdk-blink/CMakeLists.txt @@ -1,25 +1,38 @@ +## +## spreadspace rppico utils +## +## +## Copyright (C) 2022 Christian Pointner +## +## This file is part of spreadspace rppico utils. +## +## spreadspace rppico utils is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## any later version. +## +## spreadspace rppico utils is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with spreadspace rppico utils. If not, see . +## + cmake_minimum_required(VERSION 3.12) include(../sdk.cmake) project(blink C CXX ASM) -set(CMAKE_C_STANDARD 11) -set(CMAKE_CXX_STANDARD 17) pico_sdk_init() -add_compile_options(-Wall - -Wno-format # int != int32_t as far as the compiler is concerned because gcc has int32_t as long int - -Wno-unused-function # we have some for the docs that aren't called - -Wno-maybe-uninitialized - ) +add_compile_options(-Wall) add_executable(blink blink.c ) -# pull in common dependencies target_link_libraries(blink pico_stdlib) - -# create map/bin/hex file etc. pico_add_extra_outputs(blink) diff --git a/sdk-blink/Makefile b/sdk-blink/Makefile index ca7776e..110de49 100644 --- a/sdk-blink/Makefile +++ b/sdk-blink/Makefile @@ -21,22 +21,10 @@ ## PROJECT := blink -include ../defines.mk - -all: build -.PHONY: build clean distclean - -build/Makefile: - mkdir -p build - cd build; cmake .. - -build: build/Makefile - make -C build +PICO_PLATFORM := rp2040 +PICO_BOARD := pico +CMAKE_BUILD_TYPE := Release -clean: - make -C build clean - -distclean: - rm -rf build - -include ../rules.mk +include ../defines.mk +include ../sdk.mk +include ../debug.mk diff --git a/sdk.mk b/sdk.mk new file mode 100644 index 0000000..9d2bb98 --- /dev/null +++ b/sdk.mk @@ -0,0 +1,37 @@ +## +## spreadspace rppico utils +## +## +## Copyright (C) 2022 Christian Pointner +## +## This file is part of spreadspace rppico utils. +## +## spreadspace rppico utils is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## any later version. +## +## spreadspace rppico utils is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with spreadspace rppico utils. If not, see . +## + +all: build +.PHONY: build clean distclean + +build/Makefile: + mkdir -p build + cd build; cmake -D PICO_PLATFORM=${PICO_PLATFORM} -D PICO_BOARD=${PICO_BOARD} -D PICO_COMPILER=pico_arm_gcc -D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} .. + +build: build/Makefile + make -C build + +clean: + make -C build clean + +distclean: + rm -rf build -- cgit v1.2.3