A few queries about Jam
Chris Molozian <chris <at> cmoz.me>
2011-05-28 12:43:10 GMT
Hey all,
I hope the mailing list is still active. I've been through all the
documentation for Jam and peeked at the Jambase file in the source
repository but there's still a couple of things I can't find the
idiomatic way to do.
My build consists of using a D compiler to build a project I'm
working on involving the LLVM. The Jamfile I've created looks like
this:
DCFLAGS = -fPIC -O -inline -release -w -wi
-I./imports/llvm-2.9 ;
C++FLAGS =
-I/usr/include
-DNDEBUG
-D_GNU_SOURCE
-D__STDC_LIMIT_MACROS
-D__STDC_CONSTANT_MACROS
-O3
-fomit-frame-pointer
-fno-exceptions
-fPIC
-Woverloaded-virtual
-Wcast-qual ; # should be generated from `llvm-config
--cxxflags`
LINK = $(DC) ;
DFILES =
src/ob2c/main.d
src/ob2c/info.d ; # should be scanned from src dir
# override the Link action to correct for the dmd compiler -o flag
actions Link bind NEEDLIBS {
$(LINK) $(LINKFLAGS) -of$(<) $(UNDEFS) $(>) $(NEEDLIBS)
$(LINKLIBS)
}
MainFromObjects ob2c : $(DFILES:S=.o) ;
Objects $(DFILES) ;
LinkLibraries ob2c : llvm-c-ext ;
Library llvm-c-ext :
imports/llvm-2.9/llvm/Ext.cpp
imports/llvm-2.9/llvm/Target.cpp ;
The things I'm not sure how to do are:
- Can I call an external program (i.e. llvm-config) and store
the stdout from it to the C++FLAGS variable?
- All of my source code is within a src folder, can I
tell Jam to scan the directory and subdirectories for source
files and store them to the DFILES variable?
- Is there a way for me to force all target output (e.g. object
files, generated libraries, binaries... etc) to be put within a
build folder at the same directory level as the Jamfile?
Hope this makes sense, any help and advice would be most
appreciated.
Cheers,
Chris
_______________________________________________
jamming mailing list - jamming <at> maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/jamming