реклама на сайте
подробности

 
 
> Продвинутые make'еры, все уже изобретено!
Evgeny_CD
сообщение Jul 3 2006, 15:07
Сообщение #1


Гуру
******

Группа: СуперМодераторы
Сообщений: 2 065
Регистрация: 11-01-05
Из: Москва
Пользователь №: 1 892



Я себе так представляю процесс правильной embedded (и не только) разработки кода.

Есть большоооой репозиторий кода. Там лежит масса всего, упорядоченная по папочкам и подпапочкам. Есть CVS | SVN, разумеется.

Есть папки архитектур и платформ. Там лежат специфические для них вещи.

Есть папка проекта. Тут лежат папки и подпапки с:
* кодом, специфичным для данного проекта
* заменяемой частью кода в "стандартных" кусках "большого репозитория"
* make, conf и прочие файлы, который позволяют из всего этого винегрета собрать целевой код.

Собственно, это не новость; все большие проекты так и делаются, и то, что я только что это осознал - это мои проблемы.

Вопрос в том, как оптимизировать процесс сборки кода.

Make - сильня штука, но писать "руками" кучу make файлов я пас.

Automake, Autoconf - хорошие штуковины, но хочется большой поддерджки для родных виндовых тулзов (M$ Visual C, например)

Некоторое время назад я постил различные (нетривиальные | бредовые) идеи
"Концептуальный вопрос по написанию прототипа в среде "похожей на embedd Ось"
http://www.caxapa.ru/echo/arm.html?id=58541

Но поизучав вопрос, я понял, что многое уже изобретено, надо только осознать его smile.gif

************************************* 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.org/Wiki/CMake_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.

С документацией не густо, по сути одна страница (но большая smile.gif
http://www.cmake.org/HTML/Documentation.html

************************************* SCons *************************************
Раньше это был "выбор KDE".

http://www.scons.org/
http://www.scons.org/doc/HTML/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.ru/echo/arm.html?id=60891
http://electronix.ru/forum/index.php?showtopic=17562

Членомер C компилеров: GCC 4.xxx зажигает! (данные за август 2005)
http://www.caxapa.ru/echo/arm.html?id=60918
http://electronix.ru/forum/index.php?showtopic=17607
Go to the top of the page
 
+Quote Post

Сообщений в этой теме
- Evgeny_CD   Продвинутые make'еры   Jul 3 2006, 15:07
- - Седой   По поводу большого репозитария и повторного исполь...   Jul 3 2006, 15:59
- - Evgeny_CD   2 Седой: "адназначна". Вот именно таких...   Jul 3 2006, 16:15
|- - spf   ЦитатаУ кого как организован процесс сборки проект...   Jul 4 2006, 04:36
|- - Andy Mozzhevilov   Написано много, читать всего нет времени, но на эт...   Jul 4 2006, 04:48
|- - raider   Цитата(Andy Mozzhevilov @ Jul 4 2006, 04...   Jan 9 2007, 00:42
|- - Andy Mozzhevilov   Цитата(raider @ Jan 9 2007, 02:42) Цитата...   Jan 9 2007, 08:56
||- - klen   Кроме ембедерства занимаюсь разработкай игрушек (к...   Jan 9 2007, 09:54
||- - dxp   Цитата(klen @ Jan 9 2007, 12:54) Лично по...   Jan 9 2007, 17:59
||- - klen   Цитата(dxp @ Jan 9 2007, 17:59) К сожален...   Jan 10 2007, 12:57
|||- - Andrew2000   Цитата(klen @ Jan 10 2007, 12:57) Если на...   Jan 10 2007, 15:29
||||- - klen   Цитата(Andrew2000 @ Jan 10 2007, 15:29) Ц...   Jan 13 2007, 15:17
|||- - dxp   Цитата(klen @ Jan 10 2007, 15:57) Дэк что...   Jan 10 2007, 18:07
|||- - andrew_b   Цитата(dxp @ Jan 10 2007, 18:07) Цитата(a...   Jan 11 2007, 08:44
|||- - dxp   Цитата(andrew_b @ Jan 11 2007, 11:44) Цит...   Jan 11 2007, 11:55
|||- - zltigo   Цитата(dxp @ Jan 11 2007, 10:55) Тем боле...   Jan 11 2007, 22:53
|||- - spf   Цитата(zltigo @ Jan 12 2007, 00:53) Маке ...   Jan 12 2007, 07:50
|||- - dxp   Цитата(zltigo @ Jan 12 2007, 01:53) Цитат...   Jan 12 2007, 08:01
|||- - spf   Цитата(dxp @ Jan 12 2007, 10:01) Поскольк...   Jan 12 2007, 08:12
||||- - makc   Цитата(spf @ Jan 12 2007, 08:12) Цитата(d...   Jan 12 2007, 08:33
|||||- - dxp   Цитата(makc @ Jan 12 2007, 11:33) Да, и к...   Jan 12 2007, 11:39
|||||- - spf   Цитата(dxp @ Jan 12 2007, 13:39) Цитата(m...   Jan 12 2007, 12:55
|||||- - dxp   Цитата(spf @ Jan 12 2007, 15:55) Не увере...   Jan 12 2007, 14:14
|||||- - spf   Цитата(dxp @ Jan 12 2007, 16:14) Цитата(s...   Jan 12 2007, 14:33
||||- - dxp   Цитата(spf @ Jan 12 2007, 11:12) Цитата(d...   Jan 12 2007, 11:23
|||- - zltigo   Цитата(dxp @ Jan 12 2007, 07:01) Лично я ...   Jan 12 2007, 12:59
|||- - dxp   Цитата(zltigo @ Jan 12 2007, 15:59) Самая...   Jan 12 2007, 14:25
||- - andrew_b   Цитата(dxp @ Jan 9 2007, 17:59) make, к с...   Jan 10 2007, 16:10
|- - spf   Цитата(raider @ Jan 9 2007, 02:42) Сейчас...   Jan 9 2007, 14:40
- - xyzzy   Довольно интересная альтернатива make - cook http...   Jul 4 2006, 06:07
|- - Evgeny_CD   Цитата(xyzzy @ Jul 4 2006, 10:07) Довольн...   Jul 4 2006, 07:55
|- - spf   Цитата(Evgeny_CD @ Jul 4 2006, 13:55) Цит...   Jul 4 2006, 09:36
- - raider   2 Andy Mozzhevilov Спасибо за наводку, буду иметь ...   Jan 9 2007, 19:05
- - Alex03   Выскажу и я свои 5 копеек! Некоторые итоги. ...   Jan 12 2007, 07:42


Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 20th July 2025 - 02:36
Рейтинг@Mail.ru


Страница сгенерированна за 0.01442 секунд с 7
ELECTRONIX ©2004-2016