[Geany-Users] General question - Sub projects
Lex Trotman
elextr at xxxxx
Fri Jul 31 09:41:18 UTC 2020
On Fri, 31 Jul 2020 at 18:14, m8847 <m8847 at abc.se> wrote:
>
> Hi everyone,
>
> Question about best practice of project set-up.
It seems not to really be about "project" in the Geany sense of the
word, its about your multi-software build system if I understand
below.
>
> First off: I have been using Geany for many years now, thanks to everyone
> involved in this project!
>
> So:-
> I have a project (embedded linux box) that has grown over the years, and now
> includes about 15 processes, which are treated as individual sub project (eash
> has its own makefile), each project are also included in a main Makefile.
>
> Now, normally when we work on one of the projects/process, we only want to
> compile/build that particular project, but there are some shared code, so
I'm assuming "shared code" is source code used in several places for
it to be a problem, if it can be put in a library and hidden behind a
stable API it would probably cause fewer problems as each subproject
just links the binary of the common library.
> every now and then we also need to build the rest, just to make sure nothing
> is affected.
I'm not sure what the problem is here, if any shared code is built
with a makefile then it won't build unless there is a change in it ...
and then you want to build everything that uses it anyway, otherwise
you are setting yourself up for a trap.
>
> Until now, I normally opens each sub project manually, but I wonder if there's
> any way of collecting the projects, so one can start build of other/all sub/
> siblings projects, and landing on any offending line?
I can think of two options:
1) have a top level makefile with many targets that invokes whatever
you need, and use "make foo", Geany supports this with the "make
target" build command and it saves previous target names (but only for
the session IIRC).
2) you can extend the number of build commands Geany supports (see
https://www.geany.org/manual/current/index.html#build-menu-section),
so can have as many as your menu can fit in the screen, so each "make
foo" or make in a different directory can have its own menu item, and
remember you can change the names to be useful, see
https://wiki.geany.org/howtos/configurebuildmenu
>
> I guess one solution is to create one project that includes every sub
> projects, and always use the top make. But I'm not sure I like to run through
> all the sub project each time I hit 'make'.
But as I said above, you are planning for problems if you don't do it
whenever shared code is changed, and unless you are far better than me
at remembering that then I'd say do them all all the time.
>
> So I thought I should ask if there's a solution to this, or how you guys are
> doing this / would do?
>
I'm using meson/ninja rather than make :)
Meson/ninja handles the shared code problem I think you are describing
pretty well, and the speed of ninja makes it viable to always run the
top level as it decides what to build much faster than make does, and
builds everything in parallel by default.
But the suggestions above are assuming you don't want to make
wholesale changes to your build system.
Cheers
Lex
>
> Regards,
> Micael
>
>
> _______________________________________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
More information about the Users
mailing list