ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Пятница
10 мая
61898
Evgeny_CD (03.07.2006 19:00, просмотров: 58533)
Продвинутые make'еры: все уже изобретено! Я себе так представляю процесс правильной embedded (и не только) разработки кода. Есть большоооой репозиторий кода. Там лежит масса всего, упорядоченная по папочкам и подпапочкам. Есть CVS | SVN, разумеется. Есть папки архитектур и платформ. Там лежат специфические для них вещи. Есть папка проекта. Тут лежат папки и подпапки с: * кодом, специфичным для данного проекта * заменяемой частью кода в "стандартных" кусках "большого репозитория" * make, conf и прочие файлы, который позволяют из всего этого винегрета собрать целевой код. Собственно, это не новость; все большие проекты так и делаются, и то, что я только что это осознал - это мои проблемы. Вопрос в том, как оптимизировать процесс сборки кода. Make - сильня штука, но писать "руками" кучу make файлов я пас. Automake, Autoconf - хорошие штуковины, но хочется большой поддерджки для родных виндовых тулзов (M$ Visual C, например) Некоторое время назад я постил различные (нетривиальные | бредовые) идеи "Концептуальный вопрос по написанию прототипа в среде "похожей на embedd Ось" http://www.caxapa. …echo/arm.html?id=58541 Но поизучав вопрос, я понял, что многое уже изобретено, надо только осознать его :) ************************************* CMake ************************************* !!! KDE chooses CMake as its build system http://www.cmake.org/HTML/News.html http://www.cmake.org Welcome to CMake, the cross-platform, open-source make system. CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice. CMake is quite sophisticated: it is possible to support complex environments requiring system configuration, pre-processor generation, code generation, and template instantiation. * Supports complex, large build environments. CMake has been proven in several large projects. * Generates native build files (e.g., makefiles on Unix; workspaces/projects on MS Visual C++). Therefore standard tools can be used on any platform/compiler configuration. * Has powerful commands include the ability to locate include files, libraries, executables; include external CMake files that encapsulate standard functionality; interfaces to testing systems; supports recursive directory traversal with variable inheritance; can run external programs; supports conditional builds; supports regular expression expansion; and so on. * Supports in-place and out-of-place builds. Multiple compilation trees are possible from a single source tree. * Can be easily extended to add new features. * CMake is open source. * CMake operates with a cache designed to be interfaced with a graphical editor. The cache provides optional interaction to conditionally control the build process. Статья по CMake Cross-Platform Software Development Using CMake http://www.linuxjournal.com/article/6700 The CMake Build Manager Cross platform and open source http://www.ddj.com/184405251 Хорошая обзорная статья Make alternatives http://freshmeat.net/articles/view/1715/ Какой-то тестировщик есть http://www.cmake.o …ake_Scripting_Of_CTest CTest is a cross-platform, open-source testing system distributed with CMake. CTest can peform several operations on the source code, that include retrieving from CVS or Subversion repository, configure, build, perform set of predefined runtime tests. It also includes several advanced tests such as coverage and memory checking. The results can be submitted to a Dart testing dashboard. С документацией не густо, по сути одна страница (но большая :) http://www.cmake.o …TML/Documentation.html ************************************* SCons ************************************* Раньше это был "выбор KDE". http://www.scons.org/ http://www.scons.o …/scons-user/book1.html - дока *********** What is SCons? ************ SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software. ************ What makes SCons better? ************ * Configuration files are Python scripts--use the power of a real programming language to solve build problems. * Reliable, automatic dependency analysis built-in for C, C++ and Fortran--no more "make depend" or "make clean" to get all of the dependencies. Dependency analysis is easily extensible through user-defined dependency Scanners for other languages or file types. * Built-in support for C, C++, D, Java, Fortran, Yacc, Lex, Qt and SWIG, and building TeX and LaTeX documents. Easily extensible through user-defined Builders for other languages or file types. * Building from central repositories of source code and/or pre-built targets. * Built-in support for fetching source files from SCCS, RCS, CVS, BitKeeper and Perforce. * Built-in support for Microsoft Visual Studio .NET and past Visual Studio versions, including generation of .dsp, .dsw, .sln and .vcproj files. * Reliable detection of build changes using MD5 signatures; optional, configurable support for traditional timestamps. * Improved support for parallel builds--like make -j but keeps N jobs running simultaneously regardless of directory hierarchy. * Integrated Autoconf-like support for finding #include files, libraries, functions and typedefs. * Global view of all dependencies--no more multiple build passes or reordering targets to build everything. * Ability to share built files in a cache to speed up multiple builds--like ccache but for any type of target file, not just C/C++ compilation. * Designed from the ground up for cross-platform builds, and known to work on Linux, other POSIX systems (including AIX, *BSD systems, HP/UX, IRIX and Solaris), Windows NT, Mac OS X, and OS/2. Очень сильная штука. Я сижу в листе SCons несколько недель - обстановка здоровая. ************************************* RAKE ************************************* http://rake.rubyforge.org/ RAKE — Ruby Make Rake has the following features: * Rakefiles (rake’s version of Makefiles) are completely defined in standard Ruby syntax. No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?) * Users can specify tasks with prerequisites. * Rake supports rule patterns to sythesize implicit tasks. * Flexible FileLists that act like arrays but know about manipulating file names and paths. * A library of prepackaged tasks to make building rakefiles easier Не знаю, что это такое. Просто привел для полноты обзора ************************************* Классика жанра ************************************* GNU Automake http://sources.redhat.com/automake/ Automake is a tool for automatically generating Makefiles compliant with the GNU Coding Standards. Automake is currently written in Perl, and requires a Perl interpreter on the developer's system. The resulting Makefile.in's do not require Perl or any other "nonstandard" tool (the complete list of standard tools is mentioned in the coding standards). Autoconf http://www.gnu.org/software/autoconf/ Autoconf is an extensible package of m4 macros that produce shell scripts to automatically configure software source code packages. These scripts can adapt the packages to many kinds of UNIX-like systems without manual user intervention. Autoconf creates a configuration script for a package from a template file that lists the operating system features that the package can use, in the form of m4 macro calls. Producing configuration scripts using Autoconf requires GNU m4. You must install GNU m4 (version 1.4 or later) before configuring Autoconf, so that Autoconf's configure script can find it. The configuration scripts produced by Autoconf are self-contained, so their users do not need to have Autoconf (or GNU m4). GNU m4 http://www.gnu.org/software/m4/ http://savannah.gnu.org/projects/m4/ GNU m4 is an implementation of the traditional Unix macro processor. It is mostly SVR4 compatible although it has some extensions (for example, handling more than 9 positional parameters to macros). GNU m4 also has built-in functions for including files, running shell commands, doing arithmetic, etc. GNU m4 is a macro processor in the sense that it copies its input to the output expanding macros as it goes. Macros are either builtin or user-defined and can take any number of arguments. Besides just doing macro expansion m4 has builtin functions for including named files, running UNIX commands, doing integer arithmetic, manipulating text in various ways, recursion etc... m4 can be used either as a front-end to a compiler or as a macro processor in its own right. ************************************* Нестандартные идеи ************************************* Формат .proj и прочих фалов далеко не от всех IDE описан. И хачить каждый раз его для новой IDE - тоскливо. Если нужно сделать проект под новую IDE, то, возможно, стоит поступить так: * делаем в директории проекта папку под IDE * пишем скрипт на любом удобном языке * делаем hard link на все необходимые файлы в эту директорию (с поддирами, если надо) * в IDE выбираем "включить все файлы" * линковочные и пр. опции придется вводить ручками в IDE - ничего не поделаешь. ************************************* Вопрос ************************************* У кого как организован процесс сборки проектов из репозитория кода? Критика раздела "Нестандартные идеи"? ************************************* Ссылки по теме ************************************* Сквозная система разработки embedded устройств Полноценная GNU среда для embedded разработки http://www.caxapa. …echo/arm.html?id=60891 http://electronix. …ex.php?showtopic=17562 Членомер C компилеров: GCC 4.xxx зажигает! (данные за август 2005) http://www.caxapa. …echo/arm.html?id=60918 http://electronix. …ex.php?showtopic=17607