Makefiles are generally not very cross-platform compatible. You need "make" to make use of them, which you'll generally only have on Unix.
Regarding the x64 restriction you've mentioned: Makefiles do take parameters, and they respect shell variables, so passing in either "ia32" or "x64" is easy. Or you could write some autodetection magic -- remember that you can put any shell command into a Makefile recipe. For multi-OS buildability, take a look at GYP, which is used by Chromium (which depends on V8, similar to your project) and V8 itself to generate build files for different build systems native to each platform (make, Xcode, Visual Studio). There's some documentation at code.google.com/p/gyp, and in Chromium's *.gyp[i] files you'll find tons of examples for advanced usage. Of course there are other cross-platform build systems around, e.g. qmake, CMake, and Scons, each with their own devoted fans and sworn enemies. Finally, please be aware that V8's Scons based build is scheduled to go away soon-ish. Regardless of how you build your own project, you should use GYP to build the V8 dependency. See http://code.google.com/p/v8/wiki/BuildingWithGYP. On Fri, Sep 30, 2011 at 14:38, Lea Hayes <[email protected]> wrote: > > Just to clarify, the following works, but I would like to make it > possible to make on any platform. This Makefile only works on x64: > > build: clean > @@cd lib/v8; \ > echo "Building V8 shell"; \ > scons mode=release arch=x64; \ > cd ../..; \ > g++ -Ilib/v8/include src/hello.cc -o obj/hello.o lib/v8/libv8.a - > lpthread; \ > cp obj/hello.o ./hello > > clean: > @@echo "Removing built copy of V8" > @@rm -f hello > > I am relatively new to Makefiles so I think I just need a little > guidance. > > Thanks again > > > On Sep 30, 1:01 pm, Lea Hayes <[email protected]> wrote: > > Hello all, > > > > I started by duplicating one of the shell examples and customised it a > > little. But now I would like to use the following directory structure > > but still have the ability to build the application cross-platform > > (mac/windows/unix). > > > > This is for an open source project that I want to develop, but I am > > stumped on this part. Is there a project skeleton project that I can > > use to achieve this? or a template Makefile? > > > > /myproject/ > > src/ > > myproject.cc > > myproject.h > > lib/ > > v8/ > > ... > > Makefile > > > > Any help would be greatly appreciated! > > > > Lea Hayes > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
