Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build settings #929

Merged
merged 15 commits into from
Apr 19, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,42 @@ ls -1 /usr/bin/clang*
ls -1 /usr/bin/scan-build*
echo "----"

echo "WORK DIR:$DIR"
DIR=$PWD

if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo apt-get update -qq || true
sudo apt-get install -qq -y --no-install-recommends libgtk-3-dev
else #("$TRAVIS_OS_NAME" == "osx")

echo "--> Building Debug..."
mkdir -p build/Debug && cd build/Debug
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/_install"
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/_install ../../
make && make package && cd -

echo "--> Building Release..."
mkdir -p build/Release && cd build/Release
echo "-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/_install"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/_install ../../
make && make package && cd -

# echo "--> Building Binary..."
# mkdir -p build/Binary && cd build/Binary
# cho "-DCMAKE_BUILD_TYPE=Binary -DCMAKE_INSTALL_PREFIX=$PWD/_install"
# cmake -DCMAKE_BUILD_TYPE=Binary -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$PWD/_install ../../
# make && make package && cd -
else [ "$TRAVIS_OS_NAME" == "osx" ];
brew install libusb
fi

echo "=== Building Debug"
mkdir -p build/Debug && cd build/Debug && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/_install ../../ && make && make package && cd -
echo "--> Building Debug..."
mkdir -p build/Debug && cd build/Debug
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/_install"
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/_install ../../
make && make package && cd -

echo "=== Building Release"
mkdir -p build/Release && cd build/Release && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/_install ../../ && make && make package && cd -
echo "--> Building Release..."
mkdir -p build/Release && cd build/Release
echo "-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/_install"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/_install ../../
make && make package && cd -
fi
16 changes: 12 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ matrix:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-bionic-6.0']
packages: ['clang-6.0', 'libusb-1.0.0-dev']
# - os: linux
# arch: x64
# compiler: clang-6.0
# addons:
# apt:
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-bionic-6.0']
# packages: ['clang-6.0', 'libusb-1.0.0-dev']
# env: CFLAGS=-m32 LDFLAGS=-m32

### 32-bit builds ###
- os: linux
Expand All @@ -49,18 +57,18 @@ matrix:
packages: ['gcc-5', 'libusb-1.0.0-dev']
- os: linux
arch: x86
compiler: gcc-6
compiler: gcc-7
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-6', 'libusb-1.0.0-dev']
packages: ['gcc-7', 'libusb-1.0.0-dev']
- os: linux
arch: x86
compiler: gcc-7
compiler: gcc-9
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-7', 'libusb-1.0.0-dev']
packages: ['gcc-9', 'libusb-1.0.0-dev']
- os: linux
arch: x86
compiler: clang-3.7
Expand Down
272 changes: 136 additions & 136 deletions CHANGELOG.md

Large diffs are not rendered by default.

48 changes: 27 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
cmake_minimum_required(VERSION 3.4.2)
set(CMAKE_USER_MAKE_RULES_OVERRIDE cmake/c_flag_overrides.cmake)
cmake_policy(SET CMP0042 NEW)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/cmake/modules")
include(GNUInstallDirs)

project(stlink C)
set(PROJECT_DESCRIPTION "Open source version of the STMicroelectronics ST-LINK Tools")
include(GNUInstallDirs)

set(STLINK_UDEV_RULES_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/udev/rules.d" CACHE PATH "udev rules directory")
set(STLINK_MODPROBED_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/modprobe.d" CACHE PATH "modprobe.d directory")
set(STLINK_STATIC_LIB ON CACHE BOOL "Install static lib")

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
option(STLINK_INSTALL_UDEV_RULES "Install udev rules files" ON)
option(STLINK_INSTALL_MODPROBE_CONF "Install modprobe conf files" ON)
option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF)

# ====

#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

if (IS_DIRECTORY ${LIB_INSTALL_DIR})
set(LIB_INSTALL_DIR ${LIB_INSTALL_DIR} CACHE PATH "Main library directory")
Expand All @@ -28,17 +36,16 @@ else ()
set(STLINK_INCLUDE_PATH "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}")
endif ()

option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF)
option(STLINK_INSTALL_UDEV_RULES "Install udev rules files" ON)
option(STLINK_INSTALL_MODPROBE_CONF "Install modprobe conf files" ON)

# cmake (3.0+) on MacOS should use @rpath
cmake_policy(SET CMP0042 NEW)

set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/cmake/modules")
include(cmake/version.cmake)

if (NOT MSVC)
include(cmake/c_flags.cmake)
else ()
message(STATUS "MSVC C Flags override to /MT")
set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1")
set(CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
set(CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
endif ()


Expand Down Expand Up @@ -207,16 +214,13 @@ endif ()
###

add_executable(st-flash src/tools/flash.c src/tools/flash_opts.c)
if (WIN32 OR APPLE)
target_link_libraries(st-flash ${STLINK_LIB_STATIC} ${SSP_LIB})
else ()
target_link_libraries(st-flash ${STLINK_LIB_SHARED} ${SSP_LIB})
endif ()

add_executable(st-info src/tools/info.c)

if (WIN32 OR APPLE)
target_link_libraries(st-flash ${STLINK_LIB_STATIC} ${SSP_LIB})
target_link_libraries(st-info ${STLINK_LIB_STATIC} ${SSP_LIB})
else ()
target_link_libraries(st-flash ${STLINK_LIB_SHARED} ${SSP_LIB})
target_link_libraries(st-info ${STLINK_LIB_SHARED} ${SSP_LIB})
endif ()

Expand All @@ -233,21 +237,23 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif ()

add_subdirectory(src/gdbserver)
add_subdirectory(src/tools/gui)
add_subdirectory(src/stlink-gui)


###
# Others
###

add_subdirectory(usr/lib/pkgconfig)
add_subdirectory(debian/pkgconfig)
add_subdirectory(include)
add_subdirectory(doc/man)
add_subdirectory(tests)

include(cmake/cpack_config.cmake)
include(CPack)

# ====


###
# Uninstall target
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2020, The stlink project (github.com/texane/stlink) & "Capt'ns Missing Link" authors.
Copyright (c) 2020, The stlink project (github.com/stlink-org/stlink) & "Capt'ns Missing Link" authors.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
MAKEFLAGS += -s

all: release
ci: debug release test
ci: debug release binary test

help:
@echo " release: Run a release build"
@echo " debug: Run a debug build"
@echo " release: Run a release build"
@echo " binary: Build Windows-Binary"
@echo " lint: Lint check all source-code"
@echo " test: Build and run tests"
@echo " clean: Clean all build output"
Expand All @@ -17,6 +18,7 @@ help:
rebuild_cache: build/Debug build/Release
@$(MAKE) -C build/Debug rebuild_cache
@$(MAKE) -C build/Release rebuild_cache
@$(MAKE) -C build/Binary rebuild_cache

debug: build/Debug
@echo "[DEBUG]"
Expand All @@ -26,6 +28,10 @@ release: build/Release
@echo "[RELEASE]"
@$(MAKE) -C build/Release

binary: build/Binary
@echo "[BINARY]"
@$(MAKE) -C build/Binary

package: build/Release
@echo "[PACKAGE] Release"
@$(MAKE) -C build/Release package
Expand All @@ -41,6 +47,10 @@ build/Release:
@mkdir -p $@
@cd $@ && cmake -Wno-dev -DCMAKE_BUILD_TYPE=Release $(CMAKEFLAGS) ../../

build/Binary:
@mkdir -p $@
@cd $@ && cmake -Wno-dev -DCMAKE_BUILD_TYPE=Binary $(CMAKEFLAGS) ../../

clean:
@echo "[CLEAN]"
@rm -Rf build
Expand Down
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Open source version of the STMicroelectronics STlink Tools
==========================================================

[![BSD licensed](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/hyperium/hyper/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/texane/stlink.svg)](https://github.com/stlink-org/stlink/releases/latest)
[![GitHub commits](https://img.shields.io/github/commits-since/texane/stlink/v1.6.0.svg)](https://github.com/stlink-org/stlink/releases/master)
[![Downloads](https://img.shields.io/github/downloads/texane/stlink/total.svg)](https://github.com/stlink-org/stlink/releases)
[![Linux Status](https://img.shields.io/travis/texane/stlink/master.svg?label=linux)](https://travis-ci.org/stlink-org/stlink)
[![macOS Status](https://img.shields.io/travis/texane/stlink/master.svg?label=osx)](https://travis-ci.org/stlink-org/stlink)
[![GitHub release](https://img.shields.io/github/release/stlink-org/stlink.svg)](https://github.com/stlink-org/stlink/releases/latest)
[![GitHub commits](https://img.shields.io/github/commits-since/stlink-org/stlink/v1.6.0.svg)](https://github.com/stlink-org/stlink/releases/master)
[![Downloads](https://img.shields.io/github/downloads/stlink-org/stlink/total.svg)](https://github.com/stlink-org/stlink/releases)
[![Linux Status](https://img.shields.io/travis/stlink-org/stlink/master.svg?label=linux)](https://travis-ci.org/stlink-org/stlink)
[![macOS Status](https://img.shields.io/travis/stlink-org/stlink/master.svg?label=osx)](https://travis-ci.org/stlink-org/stlink)

Recent new features and bugfixes can be found in the [Changelog](CHANGELOG.md) of this software project.

Expand Down Expand Up @@ -48,10 +48,12 @@ The STlink toolset includes:
* a GUI-Interface (stlink-gui) _[optional]_


## Supported hardware combinations
## Supported operating systems and hardware combinations

Currently known working combinations of programmers and targets are listed in [devices_boards.md](doc/devices_boards.md).

Supported operating systems are listed in [version_support.md](doc/version_support.md).


## Tutorial & HOWTO

Expand Down Expand Up @@ -110,13 +112,13 @@ When there is no executable available for your platform or you need the latest (
# Current state of the project
## Known missing features

Some features are currently missing from the `texane/stlink` toolset.
Some features are currently missing from the `stlink-org/stlink` toolset.
Here we would appreciate any help and would love to welcome new contributors who want to get involved:

* Instrumentation Trace Macro (ITM) Cell ([#136](https://github.com/texane/stlink/issues/136))
* OTP & EEPROM area programming ([#202](https://github.com/texane/stlink/issues/202), [#333](https://github.com/texane/stlink/issues/333), [#686](https://github.com/texane/stlink/issues/686))
* Protection bits area reading ([#346](https://github.com/texane/stlink/issues/346))
* Writing external memory connected to an STM32 controller (e.g Quad SPI NOR flash) ([#412](https://github.com/texane/stlink/issues/412))
* MCU hotplug ([#449](https://github.com/texane/stlink/issues/449))
* Writing options bytes (region) ([#458](https://github.com/texane/stlink/issues/458))
* Support for STLINKv3 programmer ([#820](https://github.com/texane/stlink/issues/820))
* Instrumentation Trace Macro (ITM) Cell ([#136](https://github.com/stlink-org/stlink/issues/136))
* OTP & EEPROM area programming ([#202](https://github.com/stlink-org/stlink/issues/202), [#333](https://github.com/stlink-org/stlink/issues/333), [#686](https://github.com/stlink-org/stlink/issues/686))
* Protection bits area reading ([#346](https://github.com/stlink-org/stlink/issues/346))
* Writing external memory connected to an STM32 controller (e.g Quad SPI NOR flash) ([#412](https://github.com/stlink-org/stlink/issues/412))
* MCU hotplug ([#449](https://github.com/stlink-org/stlink/issues/449))
* Writing options bytes (region) ([#458](https://github.com/stlink-org/stlink/issues/458))
* Support for STLINKv3 programmer ([#820](https://github.com/stlink-org/stlink/issues/820))
7 changes: 0 additions & 7 deletions cmake/c_flag_overrides.cmake

This file was deleted.

Loading