Building latest Unix VM - how?

Scott A Crosby crosby at qwes.math.cmu.edu
Sat Jan 19 18:31:38 UTC 2002


On Sat, 19 Jan 2002, Tim Rowledge wrote:

> ago myself - copying files makes editing platform files problematic (you
> have to remember to edit the right ones, then hit the button to have it
> moved to the right place). I've never been very bothered about it

I don't know the details of VMMaker... But...

One way I've seen to do this automatically in make is something like:

--
build/foo.c : src/platform/unix/foo.c
	cp -f $< $@
build/foo.o : build/foo.c
	gcc ${CFLAGS} -o $@ -c $<
--
In which case, make will automatically move things over if/when they
update in the src tree. Or, perhaps:
--
build/foo.c : src/platform/unix/foo.c
	rm -f $@
	cp -f $< $@
build/foo.o : build/foo.c
	gcc ${CFLAGS} -o $@ -c $<
--


I believe you can also do things like:
--
${BUILDDIR}/foo.c : ${SRCDIR}/foo.c
	cp -f $< $@
--
too

Then have a warning about never editing a file in build/


> personally and it is an artifact of trying to make it easy to write a
> script (like the autoconf type of script) that can work out from a
> simple directory tree what bits go where. Of course, more experienced

Something like this:

--
(in the toplevel)
plugins:
--
--
(Foo/Makefile.inc)
plugins: ${BUILDDIR}/PluginFoo.so

#Stuff for making ${BUILDDIR}/PluginFoo.so, possibly using above code.
--
--
(Bar/Makefile.inc)
plugins: ${BUILDDIR}/PluginFoo.so

#Stuff for making ${BUILDDIR}/PluginBar.so, possibly using above code.
--

Where a 'make plugin' will, after all the individual makefiles are
included, auto-build just the plugins.  (and, as a bonus, parallel
builds work. :)


> writers of such scripts can cope with more complex situations, so maybe
> it is possible to avoid this file copying altogether.

I don't know autoconf/automake, but I do know GNU make fairly well.

>
> a) is possible on all four of the mainly active platforms as far as I
> can discover. Using links would allow makefiles and scripts to stay
> relatively simple.
> b) would result in makerules somethinglike
> fooplugin.o: ../src/vm/intplugins/fooplugin/fooplugin.c
> ../platforms/unix/plugins/fooplugin/sqUnixfoostuff.c
> ../platforms/Cross/plugins/fooplugin/fooplugin.h
> etc  - which I suppose is not a lot different than what we get now. The
> one bit that worries me a little is the care needed with specifiying
> the include file lookup paths so we make sure exactly the right stuff is
> included. Can you tell that I've had trouble with this in the past?
>
> The likely simplest approach is to use the split tree, since adding file
> links is actual work and we don't want to have to do any of _that_
> stuff. What do makefile makers think?

Have a directories:
  generated
  plugin/foo
  plugin/bar
  build

And use make rules like the above to copy from... wherever... to wherever. :)

This is a *guess*. I don't know vmmaker. The most I can do is maybe jog
your memory with an idea. But, this seems like it might be a cross between
the two options above?

Scott





More information about the Squeak-dev mailing list