Hello
I'm working on a C++ project on linux and I want to use autotools.
Before that I need to change the organization of the projects.
For the moment, this is how it is organized:
bin for binaries
DEV/Makefile : a makefile for all the project
DEV/SOC/src => source code for socket classes
DEV/SOC/include => headers of socket classes
DEV/SOC/obj => .o files
DEV/DRI/src => .cc class for drivers
DEV/DRI/include => headers of drivers
DEV/DRI/obj => .o
and so on
DEV/LIB => libraries needed by the project
On open-sources project, I see :
src/
and then directory for each package:
src/socket (in this case) where you have ".cc", ".h" and ".o"
Is there rules for the source code organization?
With autotools I need to put a Makefile.am in each directory that's
why I want to reorganize everything.
Any ideas will help me.
Thanks
|
|
0
|
|
|
|
Reply
|
ludocluba (11)
|
12/14/2009 7:54:35 PM |
|
lhommedumatch wrote:
> I'm working on a C++ project on linux and I want to use autotools.
Whatever. Off-topic here anyway.
> Before that I need to change the organization of the projects.
If you say so.
> For the moment, this is how it is organized:
>
> bin for binaries
> DEV/Makefile : a makefile for all the project
> DEV/SOC/src => source code for socket classes
> DEV/SOC/include => headers of socket classes
> DEV/SOC/obj => .o files
>
> DEV/DRI/src => .cc class for drivers
> DEV/DRI/include => headers of drivers
> DEV/DRI/obj => .o
>
> and so on
>
> DEV/LIB => libraries needed by the project
>
> On open-sources project, I see :
> src/
> and then directory for each package:
> src/socket (in this case) where you have ".cc", ".h" and ".o"
>
> Is there rules for the source code organization?
No.
> With autotools I need to put a Makefile.am in each directory that's
> why I want to reorganize everything.
OK.
> Any ideas will help me.
Get a copy of "Large Scale C++ Software Design" by Lakos. Outdated in
some areas, it still contains enough wisdom (about how to organise your
projects as well) to warrant having it in one's library.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
|
|
0
|
|
|
|
Reply
|
Victor
|
12/14/2009 8:41:21 PM
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
lhommedumatch wrote:
> With autotools I need to put a Makefile.am in each directory that's
> why I want to reorganize everything.
autotools have an alias called autohell because it is too complex like in
hell. As a developer I can't understand how it works. I now prefer strongly
on cmake.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAksnWPEACgkQG6NzcAXitM8kRgCdEv6ooxdq82S8erJPKiZe5Kse
WdUAnRj8AGfmfzeFl9EYAWKVm8kYYogA
=gqs9
-----END PGP SIGNATURE-----
|
|
0
|
|
|
|
Reply
|
Michael
|
12/15/2009 9:37:53 AM
|
|
Thanks,
I think I will use cmake
|
|
0
|
|
|
|
Reply
|
lhommedumatch
|
12/15/2009 9:17:51 PM
|
|
On 14/12/09 19:54, lhommedumatch wrote:
> Hello
> I'm working on a C++ project on linux and I want to use autotools.
> Before that I need to change the organization of the projects.
I would suggest using plain GNU make for simplicity if you build for a
limited set of platforms.
> For the moment, this is how it is organized:
>
> bin for binaries
> DEV/Makefile : a makefile for all the project
> DEV/SOC/src => source code for socket classes
> DEV/SOC/include => headers of socket classes
> DEV/SOC/obj => .o files
>
> DEV/DRI/src => .cc class for drivers
> DEV/DRI/include => headers of drivers
> DEV/DRI/obj => .o
>
> and so on
Where to put object and binary files depends on the requirements of your
project. For example, if you'd like to switch between debug and release
mode builds often it makes sense to add the build mode name in the name
of the folder for object and binary files, e.g. obg-debug and obj-debug.
This way when you switch between the build modes make does not confuse
debug object files with the release ones. Same for the static and shared
libraries and executables.
It is also very convenient to put the generated dependency .d files into
the corresponding object file folder along with the corresponding .o
because debug and release build header dependencies may well be different.
The most flexible way is to build into a separate build root folder.
Under that root folder the source folder tree is replicated (source
files don't get replicated and stay where they are). For example,
${src_dir}/SOC/src/socket.cc gets compiled into
${root_dir}/obj/SOC/src/socket.o and ${root_dir}/obj/SOC/src/socket.d.
Shared libraries and executable binaries go under ${root_dir}/bin.
As a part of its name the root folder may include the build mode and,
for multi-platform/architecture builds, it may also include platform
(say Linux, SunOS, etc..), architecture (i686, x86_64, etc..), memory
model (32/64 bit), compiler name (gcc, icc, etc..) and compiler versions
if you intend to build often with different compilers, and the build
model. For example: Linux.x86_64.64.gcc-4.4.debug. You can figure all
this information from within the makefile ($(shell uname), $(shell gcc
--version)) and construct the root build folder name.
--
Max
|
|
0
|
|
|
|
Reply
|
Maxim
|
12/16/2009 12:18:20 AM
|
|
On 2009-12-14, lhommedumatch <ludocluba@yahoo.com> wrote:
> Hello
> I'm working on a C++ project on linux and I want to use autotools.
> Before that I need to change the organization of the projects.
>
> For the moment, this is how it is organized:
>
> bin for binaries
An Autotools project should be able to build in a separate build
directory.
$ mkdir build_the_project
$ cd build_the_project
build_the_project $ /path/to/project/configure
build_the_project $ make ; make install
There can be a bin directory, but it's relative to the build
directory, not to the original source directory.
> With autotools I need to put a Makefile.am in each directory that's
Google for "Recursive Make Considered Harmful" and read the paper.
Two or three times, if necessary.
I don't believe that autotools /requires/ this; it may be a dumb
way of using Autotools that many projects are following.
|
|
0
|
|
|
|
Reply
|
Kaz
|
12/16/2009 1:15:19 AM
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
lhommedumatch wrote:
> Thanks,
> I think I will use cmake
If portability is not your concern, you may just use plain GNU make,
otherwise, use cmake is better.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAksoapgACgkQG6NzcAXitM9UlACeKTv7JVVxdSRo6Z8IOMNVvhm6
Uy4AmgIwjDs1IFh6AIl8feTRfPUEOH5F
=6bdl
-----END PGP SIGNATURE-----
|
|
0
|
|
|
|
Reply
|
Michael
|
12/16/2009 5:05:28 AM
|
|
Michael Tsang wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> lhommedumatch wrote:
>
>> Thanks,
>> I think I will use cmake
>
> If portability is not your concern, you may just use plain GNU make,
> otherwise, use cmake is better.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAksoapgACgkQG6NzcAXitM9UlACeKTv7JVVxdSRo6Z8IOMNVvhm6
> Uy4AmgIwjDs1IFh6AIl8feTRfPUEOH5F
> =6bdl
> -----END PGP SIGNATURE-----
>
Please stop posting with all that PGP nonsense, it's very annoying on
Usenet.
--
Ian Collins
|
|
0
|
|
|
|
Reply
|
Ian
|
12/16/2009 5:37:55 AM
|
|
On 16 d=E9c, 02:15, Kaz Kylheku <kkylh...@gmail.com> wrote:
> On 2009-12-14, lhommedumatch <ludocl...@yahoo.com> wrote:
[snip]
> Google for "Recursive Make Considered Harmful" and read the paper.
> Two or three times, if necessary.
> I don't believe that autotools /requires/ this; it may be a dumb
> way of using Autotools that many projects are following.
It doesn't create a Makefile per directory but requires a
configuration Makefile.am per directory. And in a Makefile.am
directories are not allowed in source definition.
Perhaps you could read the autotools manual once :)
--
Michael
|
|
0
|
|
|
|
Reply
|
Michael
|
12/16/2009 12:19:45 PM
|
|
|
8 Replies
153 Views
(page loaded in 0.224 seconds)
Similiar Articles: Need to link shared objects after changing source code but not the ...In our company we have a big c++ software project devided into several shared ... to link shared objects after changing source code but not the ..... software project ... fft source code - comp.soft-sys.matlab... code for fft() If you want some C/C++ source code for ... this route: http://www.mathworks.com/company ... now. i need to work with fft matlab source code for my project ... ADPCM Source Code in C - comp.compression... to be public-domain: ftp://ftp.cs.cmu.edu/afs/cs.cmu.edu/data/anonftp/project ... Adpcm C Source Code Codes and Scripts Downloads Free. Source Code Scanners is the high ... open source C or C++ reverse engineering tools - comp.lang.c++ ...Are there any non-commercial, open source C or C++ tools to reverse engineer C or C++ programs with source codes on linux? i.e. It parses any sized C or C++ project to ... I wanted a C code for Dijikstra's algorithm in Networks - comp ...I want the code in C. Just for my >OSPF implementation in C project. >thnx in advance. >Manohar We see ... Need Convolutional networks source code(C or matlab or delphi ... converting C/Visual BASIC code to MATLAB - comp.soft-sys.matlab ...If I were to analyze that bit of source code by analogy to C, I would suspect that that ... Hi, Is there any method avilable to convert MATLAB code into C code ... project ... json functions - comp.lang.xharbourhttp://harbour-project.svn.sourceforge.net/viewvc/harbour-project ... The source code is open, presumably, and in C... so a > >> >LIB or DLL might be possible, but pretty ... Displaying Images - comp.lang.java.guiI've read the tutorials, looked at the source code to them, searched the net, read tons of source code and can't seem to make it work in my project. From NASM to Visusal Studio source debugging - comp.lang.asm.x86 ...I have a rather large NASM/Win32 project (an interpreter for a LISP/Prolog ... See Source code of *.dll file - comp.fonts From NASM to Visusal Studio source debugging ... Gaussian white noise code in C - comp.dspI'm affraid this project must run on Windoze :( Thank you in advance Jess ... filter+ white noise - comp.soft-sys.matlab Ben, Without details of the source-code you ... source code organization in a C++ projectsource code organization in a C++ project ... > Is there rules for the source code organization? No. > With autotools I need ... Welcome to The Code Project - CodeProject - Your Development ResourceFree source code and tutorials for Software developers ... What is 'The Code Project'? General FAQ; Ask a Question ... set out to build the greatest video-game company the ... 7/28/2012 4:13:59 AM
|