Latest. Paaleese commit any time.
Thanks, Dick
Index: src/pld/CMakeLists.txt =================================================================== --- src/pld/CMakeLists.txt (revision 0) +++ src/pld/CMakeLists.txt (revision 0) @@ -0,0 +1,11 @@ +# Copyright 2009 SoftPLC Corporation http://softplc.com +# Dick Hollenbeck <[email protected]> +# License: GPL v2 + +SET(PLD_SRCS + pld.c + xilinx_bit.c + virtex2.c +) + +add_library(pld STATIC ${PLD_SRCS}) Property changes on: src/pld/CMakeLists.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Index: src/svf/CMakeLists.txt =================================================================== --- src/svf/CMakeLists.txt (revision 0) +++ src/svf/CMakeLists.txt (revision 0) @@ -0,0 +1,10 @@ +# Copyright 2009 SoftPLC Corporation http://softplc.com +# Dick Hollenbeck <[email protected]> +# License: GPL v2 + + +SET(SVF_SRCS + svf.c +) + +add_library(svf STATIC ${SVF_SRCS}) Property changes on: src/svf/CMakeLists.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Index: src/jtag/CMakeLists.txt =================================================================== --- src/jtag/CMakeLists.txt (revision 0) +++ src/jtag/CMakeLists.txt (revision 0) @@ -0,0 +1,78 @@ +# Copyright 2009 SoftPLC Corporation http://softplc.com +# Dick Hollenbeck <[email protected]> +# License: GPL v2 + + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/rlink + ) + +set(JTAG_SRCS jtag.c) + + +if(BUILD_BITBANG OR BUILD_DUMMY OR BUILD_EP93XX OR BUILD_ECOSBOARD OR BUILD_PARPORT OR BUILD_AT91RM9200) + list(APPEND JTAG_SRCS bitbang.c) +endif(BUILD_BITBANG OR BUILD_DUMMY OR BUILD_EP93XX OR BUILD_ECOSBOARD OR BUILD_PARPORT OR BUILD_AT91RM9200) + +if(BUILD_PARPORT) + list(APPEND JTAG_SRCS parport.c) +endif(BUILD_PARPORT) + +if(BUILD_DUMMY) + list(APPEND JTAG_SRCS dummy.c) +endif(BUILD_DUMMY) + +if(BUILD_FT2232_FTD2XX OR BUILD_FT2232_LIBFTDI) + list(APPEND JTAG_SRCS ft2232.c) +endif(BUILD_FT2232_FTD2XX OR BUILD_FT2232_LIBFTDI) + +if(BUILD_AMTJTAGACCEL) + list(APPEND JTAG_SRCS amt_jtagaccel.c) +endif(BUILD_AMTJTAGACCEL) + +if(BUILD_EP93XX) + list(APPEND JTAG_SRCS ep93xx.c) +endif(BUILD_EP93XX) + +if(BUILD_AT91RM9200) + list(APPEND JTAG_SRCS at91rm9200.c) +endif(BUILD_AT91RM9200) + +if(BUILD_GW16012) + list(APPEND JTAG_SRCS gw16012.c) +endif(BUILD_GW16012) + +if(BUILD_BITQ) + list(APPEND JTAG_SRCS bitq.c) +endif(BUILD_BITQ) + +if(BUILD_PRESTO) + list(APPEND JTAG_SRCS presto.c) +endif(BUILD_PRESTO) + +if(BUILD_USBPROG) + list(APPEND JTAG_SRCS usbprog.c) +endif(BUILD_USBPROG) + +if(BUILD_ECOSBOARD) + list(APPEND JTAG_SRCS zy1000.c) +endif(BUILD_ECOSBOARD) + +if(BUILD_JLINK) + list(APPEND JTAG_SRCS jlink.c) +endif(BUILD_JLINK) + +if(BUILD_RLINK) + list(APPEND JTAG_SRCS rlink/rlink.c rlink/rlink_speed_table.c) +endif(BUILD_RLINK) + +if(BUILD_VSLLINK) + list(APPEND JTAG_SRCS vsllink.c) +endif(BUILD_VSLLINK) + +if(BUILD_ARM_JTAG_EW) + list(APPEND JTAG_SRCS arm-jtag-ew.c) +endif(BUILD_ARM_JTAG_EW) + + +add_library(jtag STATIC ${JTAG_SRCS}) Property changes on: src/jtag/CMakeLists.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Index: src/xsvf/CMakeLists.txt =================================================================== --- src/xsvf/CMakeLists.txt (revision 0) +++ src/xsvf/CMakeLists.txt (revision 0) @@ -0,0 +1,9 @@ +# Copyright 2009 SoftPLC Corporation http://softplc.com +# Dick Hollenbeck <[email protected]> +# License: GPL v2 + +set( XSVF_SRCS + xsvf.c +) + +add_library(xsvf STATIC ${XSVF_SRCS}) Property changes on: src/xsvf/CMakeLists.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Index: src/flash/CMakeLists.txt =================================================================== --- src/flash/CMakeLists.txt (revision 0) +++ src/flash/CMakeLists.txt (revision 0) @@ -0,0 +1,38 @@ +# Copyright 2009 SoftPLC Corporation http://softplc.com +# Dick Hollenbeck <[email protected]> +# License: GPL v2 + + +SET(FLASH_SRCS + avrf.c + flash.c + lpc2000.c + cfi.c + non_cfi.c + at91sam7.c + at91sam7_old.c + str7x.c + str9x.c + aduc702x.c + nand.c + nand_ecc.c + lpc3180_nand_controller.c + stellaris.c + str9xpec.c + stm32x.c + tms470.c + ecos.c + orion_nand.c + s3c24xx_nand.c + s3c2410_nand.c + s3c2412_nand.c + s3c2440_nand.c + s3c2443_nand.c + lpc288x.c + ocl.c + mflash.c + pic32mx.c + ) + +add_library(flash STATIC ${FLASH_SRCS}) + Property changes on: src/flash/CMakeLists.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Index: src/CMakeLists.txt =================================================================== --- src/CMakeLists.txt (revision 0) +++ src/CMakeLists.txt (revision 0) @@ -0,0 +1,386 @@ +# Copyright 2009 SoftPLC Corporation http://softplc.com +# Dick Hollenbeck <[email protected]> +# License: GPL v2 + +# This is the top level CMake build script for OpenOCD. +# First created: April 2009 + + +# http://www.vtk.org/Wiki/CMake_FAQ +# Read the above for information on CMake and in particular, "Out of Tree Builds" +# I have a <base>/release and a <base>/debug directory, at same level as <base>/src. +# $ cd release +# cmake -DBUILD_<what1>=1 -DBUILD_<what2>=1 ../src +# make +# sudo make install + + +project(openocd C) + +cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR) + +# Path to local CMake modules. +set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules) + +set(VERSION 1.0) # version of openocd that this is + + +###### Command line options ############################################# + +# that enable OR disable features in the build. +# For example, use -DBUILD_PARPORT=ON to enable parport support + +#set(CMAKE_BUILD_TYPE Release CACHE PATH "Set to Release or Debug.") + +option(BUILD_PARPORT "Enable building the pc parallel port driver (default OFF)" OFF) +option(BUILD_DUMMY "Enable building the dummy port driver (default OFF)" OFF) +option(BUILD_PARPORT_PPDEV "Enable use of ppdev (/dev/parportN) for parport (default OFF)" OFF) +option(BUILD_FT2232_FTD2XX "Enable building support for FT2232 based devices using the FTD2XX driver from ftdichip.com (default OFF)" OFF) +option(BUILD_FT2232_LIBFTDI "Enable building support for FT2232 based devices using the libftdi driver, opensource alternate of FTD2XX (default OFF)" OFF) +option(BUILD_AMTJTAGACCEL "Enable building the Amontec JTAG-Accelerator driver (default OFF)" OFF) +option(BUILD_ECOSBOARD "Enable building support for eCosBoard based JTAG debugger (default OFF)" OFF) +option(BUILD_IOUTIL "Enable ioutil functions - useful for standalone OpenOCD implementations (default OFF)" OFF) +option(BUILD_HTTPD "Enable builtin httpd server - useful for standalone OpenOCD implementations (default OFF)" OFF) +option(BUILD_EP93XX "Enable building support for EP93xx based SBCs (default OFF)" OFF) +option(BUILD_AT91RM9200 "Enable building support for AT91RM9200 based SBCs (default OFF)" OFF) +option(BUILD_GW16012 "Enable building support for the Gateworks GW16012 JTAG Programmer (default OFF)" OFF) + +#option(BUILD_PRESTO_LIBFTDI "Enable building support for ASIX Presto Programmer using the libftdi driver (default OFF)" OFF) +#option(BUILD_PRESTO_FTD2XX "Enable building support for ASIX Presto Programmer using the FTD2XX driver (default OFF)" OFF) +option(BUILD_PRESTO "Enable building support for ASIX Presto Programmer using the selected FT2232 driver (default OFF)" OFF) + +option(BUILD_USBPROG "Enable building support for the usbprog JTAG Programmer (default OFF)" OFF) +option(BUILD_OOCD_TRACE "Enable building support for the OpenOCD+trace ETM capture device (default OFF)" OFF) +option(BUILD_JLINK "Enable building support for the Segger J-Link JTAG Programmer (default OFF)" OFF) +option(BUILD_VSLLINK "Enable building support for the Versaloon-Link JTAG Programmer (default OFF)" OFF) +option(BUILD_RLINK "Enable building support for the Raisonance RLink JTAG Programmer (default OFF)" OFF) +option(BUILD_ARM_JTAG_EW "Enable building support for the Olimex ARM-JTAG-EW Programmer (default OFF)" OFF) +option(BUILD_PARPORT_GIVEIO "Enable use of giveio for parport instead of ioperm (default OFF)" OFF) +option(BUILD_BITQ "Enable a BITQ interface (default ON)" ON) + + +option(_DEBUG_JTAG_IO_ "Enable debug logging of jtag io calls (default OFF)" OFF) +option(_DEBUG_USB_IO_ "Enable debug logging of usb io calls (default OFF)" OFF) +option(_DEBUG_USB_COMMS_ "Enable debug logging of usb comms calls (default OFF)" OFF) +set(DEBUG_JTAG_IOZ 32 CACHE PATH "The number of bits to print in debugging miscompares") + +option(USE_STATIC_USB "If ON use a static libusb, else dynamic (default OFF = dynamic)" OFF) + +# this option must be used along with BUILD_FT2232_LIBFTDI +option(USE_STATIC_FTDI "If ON use a static libftdi, else dynamic (default OFF = dynamic)" OFF) + + + + +# this one wanted to be special +if(BUILD_PRESTO) + if( NOT BUILD_FT2232_FTD2XX AND NOT BUILD_FT2232_LIBFTDI) + message( FATAL_ERROR "You must specify either -DBUILD_FT2232_FTD2XX=1 or -DBUILD_FT2232_LIBFTDI=1 when building PRESTO") + endif( NOT BUILD_FT2232_FTD2XX AND NOT BUILD_FT2232_LIBFTDI) + if(BUILD_FT2232_FTD2XX) + set( BUILD_PRESTO_FTD2XX ON) + endif(BUILD_FT2232_FTD2XX) + if(BUILD_FT2232_LIBFTDI) + set( BUILD_PRESTO_LIBFTDI ON) + endif(BUILD_FT2232_LIBFTDI) +endif(BUILD_PRESTO) +#message("BUILD_PRESTO=\"${BUILD_PRESTO}\" BUILD_PRESTO_FTD2XX=\"${BUILD_PRESTO_FTD2XX}\" BUILD_PRESTO_LIBFTDI=\"${BUILD_PRESTO_LIBFTDI}\"") +#message("BUILD_FT2232_FTD2XX=\"${BUILD_FT2232_FTD2XX}\" BUILD_FT2232_LIBFTDI=\"${BUILD_FT2232_LIBFTDI}\"") + +if(BUILD_HTTPD) + # httpd.c needs function loadFile() in ioutil.c + set(BUILD_IOUTIL ON) +endif(BUILD_HTTPD) + +# Having these here seems to keep the find modules from finding standard installations of these libraries, +# so these are commented out for now +#set( LIBFTD2XX_LIBRARIES "" CACHE PATH "Path to the ftd2xx library") +#set( LIBFTD2XX_INCLUDE_DIR "" CACHE PATH "Path to the ftd2xx header files") +#set( LIBFTDI_LIBRARIES "" CACHE PATH "Path to the ftdi library") +#set( LIBFTDI_INCLUDE_DIR "" CACHE PATH "Path to the ftdi header files") +#set( LIBUSB_LIBRARIES "" CACHE PATH "Path to the usb library") +#set( LIBUSB_INCLUDE_DIR "" CACHE PATH "Path to the usb header files") + + +# Locations for install targets. +set(OPENOCD_BIN bin CACHE PATH "Location of OpenOCD binaries, relative to CMAKE_INSTALL_PREFIX if not absolute path.") + +if(UNIX) + # Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line. + set(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH "") + + # Everything without leading / is relative to CMAKE_INSTALL_PREFIX. + set(OPENOCD_DATA share/openocd CACHE PATH "Location of OpenOCD data files, relative to CMAKE_INSTALL_PREFIX if not absolute path.") + set(OPENOCD_DOCS share/doc/openocd CACHE PATH "Location of OpenOCD documentation files, relative to CMAKE_INSTALL_PREFIX if not absolute path.") + set(OPENOCD_LIBS lib/openocd CACHE PATH "Location of OpenOCD libary file, relative to CMAKE_INSTALL_PREFIX if not absolute path.") +endif(UNIX) + +if(WIN32) + # Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line. + set(CMAKE_INSTALL_PREFIX c:/OpenOCD CACHE PATH "") + + # Everything without leading / is relative to CMAKE_INSTALL_PREFIX. + set(OPENOCD_DATA share CACHE PATH "Location of OpenOCD data files, relative to CMAKE_INSTALL_PREFIX if not absolute path.") + set(OPENOCD_DOCS doc CACHE PATH "Location of OpenOCD documentation files, relative to CMAKE_INSTALL_PREFIX if not absolute path.") + set(OPENOCD_LIBS lib CACHE PATH "Location of OpenOCD libary file, relative to CMAKE_INSTALL_PREFIX if not absolute path.") +endif(WIN32) + +# set the PKGDATADIR and PKGLIBDIR the same way the install() function creates +# the intallation path from CMAKE_INSTALL_PREFIX and OPENOCD_DATA or +# OPENOCD_LIBS respectively. PKGLIBDIR and PKGDATADIR are passed into the *.c code +# via the config.h file, whereas OPENOCD_DATA and OPENOCD_LIBS are given to the +# install() function. After install() works on its arguments, it should come up +# with the same as our PKGDATADIR and PKGLIBDIR. +if( IS_ABSOLUTE ${OPENOCD_DATA} ) + set(PKGDATADIR ${OPENOCD_DATA}) +else( IS_ABSOLUTE ${OPENOCD_DATA} ) + set(PKGDATADIR ${CMAKE_INSTALL_PREFIX}/${OPENOCD_DATA}) +endif( IS_ABSOLUTE ${OPENOCD_DATA} ) + +if( IS_ABSOLUTE ${OPENOCD_LIBS} ) + set(PKGLIBDIR ${OPENOCD_LIBS}) +else( IS_ABSOLUTE ${OPENOCD_LIBS} ) + set(PKGLIBDIR ${CMAKE_INSTALL_PREFIX}/${OPENOCD_LIBS}) +endif( IS_ABSOLUTE ${OPENOCD_LIBS} ) + + +# check for include files and functions +include(CheckIncludeFile) +check_include_file(elf.h HAVE_ELF_H) +check_include_file(inttypes.h HAVE_INTTYPES_H) +check_include_file(jtag_minidriver.h HAVE_JTAG_MINIDRIVER_H) +check_include_file(memory.h HAVE_MEMORY_H) +check_include_file(stdbool.h HAVE_STDBOOL_H) +check_include_file(stdint.h HAVE_STDINT_H) +check_include_file(stdlib.h HAVE_STDLIB_H) +check_include_file(strings.h HAVE_STRINGS_H) +check_include_file(string.h HAVE_STRING_H) +check_include_file(sys/param.h HAVE_SYS_PARAM_H) +check_include_file(sys/stat.h HAVE_SYS_STAT_H) +check_include_file(sys/time.h HAVE_SYS_TIME_H) +check_include_file(sys/types.h HAVE_SYS_TYPES_H) +check_include_file(unistd.h HAVE_UNISTD_H) + +include(CheckFunctionExists) +check_function_exists(gettimeofday HAVE_GETTIMEOFDAY) +check_function_exists(strnlen HAVE_STRNLEN) +check_function_exists(usleep HAVE_USLEEP) +check_function_exists(vasprintf HAVE_VASPRINTF) +check_function_exists(strndup HAVE_STRNDUP) + +include(CheckLibraryExists) +check_library_exists(dl dlopen "" HAVE_LIBDL) + +#================================================ +# Set flags for GCC. +#================================================ + +#message("CMAKE_COMPILER_IS_GNUCC=\"${CMAKE_COMPILER_IS_GNUCC}\"") +if(CMAKE_COMPILER_IS_GNUCC) + # Set default flags for when "CMAKE_BUILD_TYPE equals Release" build. + set(CMAKE_C_FLAGS_RELEASE "-Wall -Wstrict-prototypes -Wformat-security -O2 -DNDEBUG") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s") + + # Set default flags for when "CMAKE_BUILD_TYPE equals None" build. + set(CMAKE_C_FLAGS "-Wall -Wstrict-prototypes -Wformat-security -O2 -DNDEBUG") + set(CMAKE_EXE_LINKER_FLAGS "-s") + + # Set default flags for when "CMAKE_BUILD_TYPE equals Debug" build. + set(CMAKE_C_FLAGS_DEBUG "-Wall -Wstrict-prototypes -Wformat-security -g3 -ggdb3 -DDEBUG") +endif(CMAKE_COMPILER_IS_GNUCC) + +#message("CMAKE_BUILD_TYPE=\"${CMAKE_BUILD_TYPE}\"") + + +# CONDITIONAL_LIBS is added to other unconditional libs below +set( CONDITIONAL_LIBS ) + + +set(NEED_USB FALSE) +if( BUILD_PRESTO OR BUILD_JLINK OR BUILD_RLINK OR BUILD_VSLINK OR BUILD_USBPROG OR USE_STATIC_FTDI) + #message("Yes USB") + set(NEED_USB TRUE) +endif( BUILD_PRESTO OR BUILD_JLINK OR BUILD_RLINK OR BUILD_VSLINK OR BUILD_USBPROG OR USE_STATIC_FTDI) + + +if(NEED_USB) + find_package(LibUSB) + #message("LIBUSB_LIBRARIES=\"${LIBUSB_LIBRARIES}\"") + set(CONDITIONAL_LIBS ${CONDITIONAL_LIBS} ${LIBUSB_LIBRARIES}) + include_directories( ${LIBUSB_INCLUDE_DIR} ) +endif(NEED_USB) + + +if(BUILD_FT2232_FTD2XX) + #message("BUILD_FT2232_LIBFTDI=\"${BUILD_FT2232_LIBFTDI}\"") + if(BUILD_FT2232_LIBFTDI) + message( FATAL_ERROR "BUILD_FT2232_FTD2XX and BUILD_FT2232_LIBFTDI are mutually exclusive, please enable only one") + endif(BUILD_FT2232_LIBFTDI) + find_package(LibFTD2XX) + #message("LIBFTD2XX_LIBRARIES=\"${LIBFTD2XX_LIBRARIES}\"") + set(CONDITIONAL_LIBS ${LIBFTD2XX_LIBRARIES}) + include_directories( ${LIBFTD2XX_INCLUDE_DIR} ) +endif(BUILD_FT2232_FTD2XX) + + +if(BUILD_FT2232_LIBFTDI) + if(BUILD_FT2232_FTD2XX) + message( FATAL_ERROR "BUILD_FT2232_FTD2XX and BUILD_FT2232_LIBFTDI are mutually exclusive, please enable only one") + endif(BUILD_FT2232_FTD2XX) + find_package(LibFTDI) + #message("LIBFTDI_LIBRARIES=\"${LIBFTDI_LIBRARIES}\"") + set(CONDITIONAL_LIBS ${LIBFTDI_LIBRARIES} ${CONDITIONAL_LIBS}) + include_directories( ${LIBFTDI_INCLUDE_DIR} ) +endif(BUILD_FT2232_LIBFTDI) + + +if(BUILD_HTTPD) + #future: + #find_package(LibMicroHTTPD) + # use this for now: + + check_library_exists(microhttpd MHD_stop_daemon "/usr/lib" HAVE_LIBMICROHTTPD) + if(HAVE_LIBMICROHTTPD) + message("-- found libmicrohttpd") + set(CONDITIONAL_LIBS microhttpd ${CONDITIONAL_LIBS}) + endif(HAVE_LIBMICROHTTPD) + +endif(BUILD_HTTPD) + +if(HAVE_LIBDL) + set(CONDITIONAL_LIBS ${CONDITIONAL_LIBS} dl) +endif(HAVE_LIBDL) + +include(TestBigEndian) +test_big_endian( WORDS_BIGENDIAN ) + +if(RELEASE) + set(RELSTR Release) + set(PKGBLDREV "") +else(RELEASE) + set(RELSTR svn:) + find_package(Subversion) + if(Subversion_FOUND) + subversion_wc_info( ${PROJECT_SOURCE_DIR} OPENOCD ) + MESSAGE("Current revision is ${OPENOCD_WC_REVISION}") + set(PKGBLDREV ${OPENOCD_WC_REVISION}) + else(Subversion_FOUND) + set(PKGBLDREV "") + endif(Subversion_FOUND) +endif(RELEASE) + +# preprocess and output config.h into release or debug directory +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/target + ${CMAKE_CURRENT_SOURCE_DIR}/server + ${CMAKE_CURRENT_SOURCE_DIR}/helper + ${CMAKE_CURRENT_SOURCE_DIR}/jtag + ${CMAKE_CURRENT_SOURCE_DIR}/xsvf + ${CMAKE_CURRENT_SOURCE_DIR}/svf + ${CMAKE_CURRENT_SOURCE_DIR}/flash + ${CMAKE_CURRENT_SOURCE_DIR}/pld + ${CMAKE_BINARY_DIR} + ) + +if(NOT CMAKE_HOST_UNIX) + set(IS_WIN32, true) + # http://dev-notes.com/code.php?q=49 + set(GETDATECMD \\"%date%\\" ) + #message("yes WIN32") +else(NOT CMAKE_HOST_UNIX) + set(IS_WIN32, false) + set(GETDATECMD \\"`date +%F-%R`\\") + #message("not WIN32") +endif(NOT CMAKE_HOST_UNIX) + + +if(CYGWIN) + set(IS_CYGWIN, true) +else(CYGWIN) + set(IS_CYGWIN, false) +endif(CYGWIN) + +if(MINGW) + set(IS_MINGW, true) +else(MINGW) + set(IS_MINGW, false) +endif(MINGW) + +add_definitions( + -DHAVE_CONFIG_H=1 + ) + +add_subdirectory(helper) +add_subdirectory(jtag) +add_subdirectory(xsvf) +add_subdirectory(svf) +add_subdirectory(target) +add_subdirectory(server) +add_subdirectory(flash) +add_subdirectory(pld) + + +########### openocd target ############### + +set_source_files_properties( openocd.c PROPERTIES + COMPILE_FLAGS + -DPKGBLDDATE=${GETDATECMD} +) + + +# create OPENOCD_SRCS +# prepend the main file to OPENOCD_SRCS +if(BUILD_ECOSBOARD) + set(OPENOCD_SRCS ecosboard.c openocd.c) +else(BUILD_ECOSBOARD) + set(OPENOCD_SRCS main.c openocd.c) +endif(BUILD_ECOSBOARD) + +add_executable(openocd ${OPENOCD_SRCS}) + +target_link_libraries(openocd + xsvf + svf + target + jtag + server + flash + target + pld + helper + ${CONDITIONAL_LIBS} + ) + + +########### install files ############### + +install(TARGETS openocd DESTINATION ${OPENOCD_BIN}) + +install( + DIRECTORY tcl + DESTINATION ${OPENOCD_LIBS} + COMPONENT "tcl configuration files" + FILES_MATCHING PATTERN "*.tcl" + PATTERN ".svn" EXCLUDE + ) + +# tcl/bitsbytes.tcl +# tcl/memory.tcl +# tcl/mmr_helpers.tcl +# tcl/readable.tcl +# tcl/chip/atmel/at91/aic.tcl +# tcl/chip/atmel/at91/at91sam7x128.tcl +# tcl/chip/atmel/at91/at91sam7x256.tcl +# tcl/chip/atmel/at91/pmc.tcl +# tcl/chip/atmel/at91/rtt.tcl +# tcl/chip/atmel/at91/usarts.tcl +# tcl/chip/st/stm32/stm32.tcl +# tcl/chip/st/stm32/stm32_rcc.tcl +# tcl/chip/st/stm32/stm32_regs.tcl +# tcl/cpu/arm/arm7tdmi.tcl +# tcl/cpu/arm/arm920.tcl +# tcl/cpu/arm/arm946.tcl +# tcl/cpu/arm/arm966.tcl +# tcl/cpu/arm/cortex_m3.tcl Property changes on: src/CMakeLists.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Index: src/helper/CMakeLists.txt =================================================================== --- src/helper/CMakeLists.txt (revision 0) +++ src/helper/CMakeLists.txt (revision 0) @@ -0,0 +1,43 @@ +# Copyright 2009 SoftPLC Corporation http://softplc.com +# Dick Hollenbeck <[email protected]> +# License: GPL v2 + + + +add_executable(bin2char bin2char.c) +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/startup_tcl.c + COMMAND bin2char startup_tcl < ${CMAKE_CURRENT_SOURCE_DIR}/startup.tcl > ${CMAKE_CURRENT_BINARY_DIR}/startup_tcl.c + DEPENDS bin2char ${CMAKE_CURRENT_SOURCE_DIR}/startup.tcl +) + + +set( HELPER_SRCS + binarybuffer.c + command.c + configuration.c + fileio.c + log.c + replacements.c + ${CMAKE_CURRENT_BINARY_DIR}/startup_tcl.c + time_support.c +) + + +if(NOT BUILD_ECOSBOARD) + + # omit these sources if building ecosboard, otherwise include them + set( HELPER_SRCS ${HELPER_SRCS} options.c jim.c jim-eventloop.c ) + +endif(NOT BUILD_ECOSBOARD) + + +if(BUILD_IOUTIL) + + # add these souces if BUILD_IOUTIL + set( HELPER_SRCS ${HELPER_SRCS} ioutil.c ) + +endif(BUILD_IOUTIL) + + +add_library(helper STATIC ${HELPER_SRCS}) Property changes on: src/helper/CMakeLists.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Index: src/server/CMakeLists.txt =================================================================== --- src/server/CMakeLists.txt (revision 0) +++ src/server/CMakeLists.txt (revision 0) @@ -0,0 +1,32 @@ +# Copyright 2009 SoftPLC Corporation http://softplc.com +# Dick Hollenbeck <[email protected]> +# License: GPL v2 + +set( SERVER_SRCS + server.c + telnet_server.c + gdb_server.c + tcl_server.c + ) + +if(BUILD_HTTPD) + list(APPEND SERVER_SRCS httpd.c) + file(GLOB HTTP_DATA httpd/*.tcl httpd/*.css httpd/menu_cuts/*.png) + #message( ${HTTP_DATA} ) + + install( + DIRECTORY httpd + DESTINATION ${OPENOCD_LIBS} + COMPONENT "httpd data files" + FILES_MATCHING + PATTERN "*.tcl" + PATTERN "*.css" + PATTERN "*.png" + PATTERN ".svn" EXCLUDE + ) + +endif(BUILD_HTTPD) + +add_library(server STATIC ${SERVER_SRCS}) + + Property changes on: src/server/CMakeLists.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Index: src/target/CMakeLists.txt =================================================================== --- src/target/CMakeLists.txt (revision 0) +++ src/target/CMakeLists.txt (revision 0) @@ -0,0 +1,75 @@ +# Copyright 2009 SoftPLC Corporation http://softplc.com +# Dick Hollenbeck <[email protected]> +# License: GPL v2 + + +SET(TARGET_SRCS + avrt.c + target.c + register.c + breakpoints.c + armv4_5.c + embeddedice.c + etm.c + arm7tdmi.c + arm9tdmi.c + arm_jtag.c + arm7_9_common.c + algorithm.c + arm920t.c + arm720t.c + armv4_5_mmu.c + armv4_5_cache.c + arm_disassembler.c + arm966e.c + arm926ejs.c + feroceon.c + etb.c + xscale.c + arm_simulator.c + image.c + armv7m.c + cortex_m3.c + arm_adi_v5.c + etm_dummy.c + target_request.c + trace.c + arm11.c + arm11_dbgtap.c + mips32.c + mips_m4k.c + mips32_pracc.c + mips32_dmaacc.c + mips_ejtag.c + ) + + +if(BUILD_OOCD_TRACE) + list(APPEND TARGET_SRCS oocd_trace.c) +endif(BUILD_OOCD_TRACE) + + +add_library(target STATIC ${TARGET_SRCS}) + + +install( + FILES xscale/debug_handler.bin + DESTINATION ${OPENOCD_LIBS}/xscale + COMPONENT xscale/debug_handler + ) + +install( + FILES ecos/at91eb40a.elf + DESTINATION ${OPENOCD_LIBS}/ecos + COMPONENT "ecos/elf stuff" + ) + +# find all cfg files and install them into the OPENOCD_LIBS directory +install( + DIRECTORY target interface board test + DESTINATION ${OPENOCD_LIBS} + COMPONENT "tcl configuration files" + FILES_MATCHING PATTERN "*.cfg" + PATTERN ".svn" EXCLUDE + ) + Property changes on: src/target/CMakeLists.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Index: src/config.h.cmake =================================================================== --- src/config.h.cmake (revision 0) +++ src/config.h.cmake (revision 0) @@ -0,0 +1,208 @@ +/*************************************************************************** + * Copyright (C) 2009 SoftPLC Corporation http://softplc.com * + * Dick Hollenbeck <[email protected]> * + * * + * This program 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 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef CONFIG_H_ +#define CONFIG_H_ + +/* config.h is created by CMake during a preprocessing operation from config.h.cmake */ + +/* if you want the Amontec JTAG-Accelerator driver. */ +#cmakedefine BUILD_AMTJTAGACCEL 1 + +/* if you want the ARM-JTAG-EW JTAG driver. */ +#cmakedefine BUILD_ARMJTAGEW 1 + +/* if you want at91rm9200. */ +#cmakedefine BUILD_AT91RM9200 1 + +/* if you want a bitbang interface. */ +#cmakedefine BUILD_BITBANG 1 + +/* if you want a bitq interface. */ +#cmakedefine BUILD_BITQ 1 + +/* if you want dummy driver. */ +#cmakedefine BUILD_DUMMY 1 + +/* if you want eCosBoard. */ +#cmakedefine BUILD_ECOSBOARD 1 + +/* if you want ep93xx. */ +#cmakedefine BUILD_EP93XX 1 + +/* if you want ftd2xx ft2232. */ +#cmakedefine BUILD_FT2232_FTD2XX 1 + +/* if you want libftdi ft2232. */ +#cmakedefine BUILD_FT2232_LIBFTDI 1 + +/* if you want the Gateworks GW16012 driver. */ +#cmakedefine BUILD_GW16012 1 + +/* if you want httpd. */ +#cmakedefine BUILD_HTTPD 1 + +/* if you want ioutils. */ +#cmakedefine BUILD_IOUTIL 1 + +/* if you want the J-Link JTAG driver. */ +#cmakedefine BUILD_JLINK 1 + +/* if you want the OpenOCD+trace ETM capture driver. */ +#cmakedefine BUILD_OOCD_TRACE 1 + +/* if you want parport. */ +#cmakedefine BUILD_PARPORT 1 + +/* if you want the ASIX PRESTO driver using FTD2XX. */ +#cmakedefine BUILD_PRESTO_FTD2XX 1 + +/* if you want the ASIX PRESTO driver using libftdi. */ +#cmakedefine BUILD_PRESTO_LIBFTDI 1 + +/* if you want the RLink JTAG driver. */ +#cmakedefine BUILD_RLINK 1 + +/* if you want the usbprog JTAG driver. */ +#cmakedefine BUILD_USBPROG 1 + +/* if you want the Versaloon-Link JTAG driver. */ +#cmakedefine BUILD_VSLLINK 1 + +/* if you want parport to use giveio. */ +#cmakedefine PARPORT_USE_GIVEIO 1 + +/* if you want parport to use ppdev. */ +#cmakedefine PARPORT_USE_PPDEV 1 + +/* Define to 1 if you have the <elf.h> header file. */ +#cmakedefine HAVE_ELF_H 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#cmakedefine HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#cmakedefine HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <jtag_minidriver.h> header file. */ +#cmakedefine HAVE_JTAG_MINIDRIVER_H 1 + +/* Define to 1 if you have the <memory.h> header file. */ +#cmakedefine HAVE_MEMORY_H 1 + +/* Define to 1 if you have the <stdbool.h> header file. */ +#cmakedefine HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#cmakedefine HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#cmakedefine HAVE_STDLIB_H 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#cmakedefine HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#cmakedefine HAVE_STRING_H 1 + +/* Define to 1 if you have the `strndup' function. */ +#cmakedefine HAVE_STRNDUP 1 + +/* Define to 1 if you have the `strnlen' function. */ +#cmakedefine HAVE_STRNLEN 1 + +/* Define to 1 if you have the <sys/param.h> header file. */ +#cmakedefine HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#cmakedefine HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#cmakedefine HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#cmakedefine HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#cmakedefine HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `usleep' function. */ +#cmakedefine HAVE_USLEEP 1 + +/* Define to 1 if you have the `vasprintf' function. */ +#cmakedefine HAVE_VASPRINTF 1 + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine STDC_HEADERS 1 + +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +#cmakedefine TIME_WITH_SYS_TIME 1 + +/* Version number of package */ +#define VERSION "${VERSION}" + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#cmakedefine WORDS_BIGENDIAN 1 + +/* if building for Cygwin. */ +#cmakedefine IS_CYGWIN 1 + +/* 1 if building for MinGW. */ +#cmakedefine IS_MINGW 1 + +/* if not building for Win32. */ +#cmakedefine IS_WIN32 1 + +/* Name of package */ +#cmakedefine PACKAGE 1 + +/* Define to the address where bug reports for this package should be sent. */ +#cmakedefine PACKAGE_BUGREPORT 1 + +/* Define to the full name of this package. */ +#cmakedefine PACKAGE_NAME 1 + +/* Define to the full name and version of this package. */ +#cmakedefine PACKAGE_STRING 1 + +/* Define to the one symbol short name of this package. */ +#cmakedefine PACKAGE_TARNAME 1 + +/* Define to the version of this package. */ +#cmakedefine PACKAGE_VERSION 1 + +#define PKGLIBDIR "${PKGLIBDIR}" + +#define PKGDATADIR "${PKGDATADIR}" + +/* Define the subversion revision number, in double quotes */ +#define PKGBLDREV "${PKGBLDREV}" + +/* A leading prompt for the version number, in double quotes */ +#define RELSTR "${RELSTR}" + +/* configure some debugging #defines */ +#cmakedefine _DEBUG_JTAG_IO_ 1 +#cmakedefine _DEBUG_USB_IO_ 1 +#cmakedefine _DEBUG_USB_COMMS_ 1 +#define DEBUG_JTAG_IOZ ${DEBUG_JTAG_IOZ} + +#endif /* CONFIG_H_ */ Property changes on: src/config.h.cmake ___________________________________________________________________ Added: svn:eol-style + native
_______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
