Reputation: 1243
all.
My main program uses third-party library A. The main program uses autoconf and the library A uses cmakefile to build. Since converting one framework to another is pain to me, I want to keep two different build mechanism.
Since the main
depends on libA
, I made main
to depend on libA
and
libA
as force-build target.
When I change a source file of main
and do make
on main
,
libA
gets cmake
and keep intact since nothing on libA
is changed,
then only main
gets build.
When I change a source file in libA
and do make
on main
,
libA
gets build forcefuly. But main
's dependency to libA
is computed
before building new libA
, linking does not get done.
Now I do make twice each time to get main safely.
How can I improve this build? To summarize:
main
depends on libA
(A)make
after changing source file of libA
, I want to build libA
first and build main
(B)make
after changing source file of main
, I want to build only main
with original libA (C)make
without doing anything, I want to build nothing. (D)With current setup, I cannot get (B).
Any helps will be deeply appreciated.
Upvotes: 0
Views: 107
Reputation: 57203
What about good old shell script (or bat file, if you happen to be on Windows)? Run cmake for libA, run make for main, profit!
You can use make as your batch engine, e.g.
all:
Cmake libA
$(MAKE) -f main.mk main
Upvotes: 1