[Coin-discuss] Comments on makefile setup (devel-1)

Lou Hafer lou at cs.sfu.ca
Thu Sep 26 14:14:40 EDT 2002


Folks,

	Overall, I like the organization of the devel-1 branch. Once I
managed to figure out the plan behind the makefiles, they were great to work
with. I like the overall organization. There's just one problem --- they do
an ungodly amount of work and still occasionally fail to rebuild the
necessary pieces. Do the rest of you see the same behaviour? Our system here
has GNU make 3.78.1.

	To give you an idea of what I'm griping about: I've been working at
getting OsiDylpSolverInterface up and working. Everything has been built at
least once. I'd make a change to Osi/OsiDylp/OsiDylpSolverInterface.cpp or
Coin/CoinMpsIO.cpp. Then I'd go to Osi and type `build unitTest'. My
expectation is that this will recompile OsiDylpSolverInterface or CoinMpsIO,
as appropriate, push the modified library up to COIN/libs, and then relink
unitTest. But unless I delete Osi/Test/.../unitTest up front, it isn't
rebuilt. And in the process, make visits Coin, Osi, Osi/OsiDylp, etc., three
or four times each, sometimes nested down six levels.

	Am I just using the makefiles incorrectly? Or is the design intended
more for a one-time build, with the notion that we maintainers should work
with more specific targets? There's got to be a better way. I'm sure you'll
have it worked out by the time I get back from vacation :-).

	I've rewritten Makefile.SunOS to do a decent job of detecting a
Workshop or Linux environment and proceeding accordingly. I'll attach it to
this email. The real problem seems to lie in Makefile.lib, and perhaps in the
individual Makefiles in Coin, Osi, etc.

	There were two other problems which bugged me, but I can suggest fixes
for them.

	When I was doing the initial makefile modifications to get the
Workshop setup correct, I ended up doing many partial builds followed by a
clean.  With each clean, make would insist on rebuilding the dependencies
(dep/*.d) because they are treated as included makefiles. Then it would
proceed to delete them.  To suppress this, I changed the inclusion at the end
of Makefile.lib to read

 ifneq ($(LIBDEP),)
   -include $(LIBDEP)
 endif

and added the conditional define

 clean: LIBSRC :=

to Makefile.Osi, Makefile.Coin, etc.

	The second problem came about because I unthinkingly set OptVersion
to be completely empty. This causes Makefile.lib to attempt a circular
symbolic link: for example, libCoin.a -> libCoin.a. One possible solution,
if this is considered a problem worth fixing, is to change Makefile.lib to read

  space:= $(empty) $(empty)
  OptVersion := $(subst $(space),_,$(OptLevel))
  ifeq ($(strip $(OptVersion)),)
    OptVersion := -noopt
  endif

I do like the idea of linking to a generic name, though, to allow different
compile options for each library.

							Lou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile.SunOS
Type: text/x-sun-makefile
Size: 2599 bytes
Desc: Makefile.SunOS
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20020926/17b8e744/attachment.bin>


More information about the Coin-discuss mailing list