From b444dd7b7dec748c2906c864e8d07e48a9581ccf Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Sat, 8 Oct 2011 18:51:16 +0000 Subject: [PATCH 1/1] Add a netbeans project setup Has two run configs, one for the gdb server, and one for the command line tools and library build. --- nbproject/Package-gdbserver.bash | 75 ++++++++++++++++++++++ nbproject/Package-library_cli.bash | 75 ++++++++++++++++++++++ nbproject/configurations.xml | 100 +++++++++++++++++++++++++++++ nbproject/project.xml | 27 ++++++++ 4 files changed, 277 insertions(+) create mode 100644 nbproject/Package-gdbserver.bash create mode 100644 nbproject/Package-library_cli.bash create mode 100644 nbproject/configurations.xml create mode 100644 nbproject/project.xml diff --git a/nbproject/Package-gdbserver.bash b/nbproject/Package-gdbserver.bash new file mode 100644 index 0000000..722b818 --- /dev/null +++ b/nbproject/Package-gdbserver.bash @@ -0,0 +1,75 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=gdbserver +CND_DISTDIR=dist +CND_BUILDDIR=build +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=gdbserver/st-util +OUTPUT_BASENAME=st-util +PACKAGE_TOP_DIR=stlink/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/stlink/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/stlink.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/stlink.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/nbproject/Package-library_cli.bash b/nbproject/Package-library_cli.bash new file mode 100644 index 0000000..5a64472 --- /dev/null +++ b/nbproject/Package-library_cli.bash @@ -0,0 +1,75 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=library_cli +CND_DISTDIR=dist +CND_BUILDDIR=build +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=test_usb +OUTPUT_BASENAME=test_usb +PACKAGE_TOP_DIR=stlink/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/stlink/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/stlink.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/stlink.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/nbproject/configurations.xml b/nbproject/configurations.xml new file mode 100644 index 0000000..3d02ea8 --- /dev/null +++ b/nbproject/configurations.xml @@ -0,0 +1,100 @@ + + + + + + main.c + + + gdb-remote.c + gdb-remote.h + gdb-server.c + + + stlink-common.c + stlink-common.h + stlink-sg.c + stlink-sg.h + stlink-usb.c + stlink-usb.h + test_sg.c + test_usb.c + + + + + + build/Makefile + + + ^(nbproject)$ + + . + + build/Makefile + + + + LOCAL_SOURCES + default + + + + + ${MAKE} -f Makefile + ${MAKE} -f Makefile clean + test_usb + + + stm32l/src + /usr/include/libusb-1.0 + stm32l/build + src + + + CONFIG_USE_LIBUSB=1 + __GNUC_STDC_INLINE__=1 + __OPTIMIZE__=1 + __REGISTER_PREFIX__= + __STDC_VERSION__=199901L + __USER_LABEL_PREFIX__= + + + + + + + + LOCAL_SOURCES + default + + + + gdbserver + ${MAKE} -f Makefile + ${MAKE} -f Makefile clean + gdbserver/st-util + + + stm32l/src + /usr/include/libusb-1.0 + stm32l/build + src + + + CONFIG_USE_LIBUSB=1 + __GNUC_STDC_INLINE__=1 + __OPTIMIZE__=1 + __REGISTER_PREFIX__= + __STDC_VERSION__=199901L + __USER_LABEL_PREFIX__= + + + + + + + diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..6608636 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,27 @@ + + + org.netbeans.modules.cnd.makeproject + + + stlink + c + + h + UTF-8 + + + . + + + + library_cli + 0 + + + gdbserver + 0 + + + + + -- 2.30.2