I'd like to switch to using Jam as my build system. Currently, I have a src, include and build directories and I'm wondering how I can get Jam to put object files in the build directory and search for include files in the include directory.
Seperate build directory and include directory in Jam
1.8k Views Asked by Tom Leese At
1
There are 1 best solutions below
Related Questions in BUILD
- Ionic cordova build
- Force GHC using local files
- RPM spec files with rpmbuild can have errors
- (automake, libtool) build fails in automake when using same source file name in different directory
- Backup strategy for build tool hosted on Azure VM
- include typescript file in output result build with TFS
- Android Build failed at ':app:dexDebug' with exception ( library and app project )
- GNU make - depend only on file existence and not modification time
- Error code 31 returned from mt.exe when building C++ projects in Visual Studio 2013
- IONIC FRAMEWORK Build Xcode Error :(
- Jenkins - Stage before "Source Code Management"
- Python: Trouble with dill installation
- Execution failed for task 'app:mergeDebugResources' Crunching Cruncher....png failed
- Android: Execution failed for task ':app:processDebugResources'
- Change assets urls to cdn adding absolute path in Grunt
Related Questions in INCLUDE
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- SilverStripe - Multilingual Custom Form Template
- Interesting random PHP include issue
- Maddening scope issue
- PHP Include giving weird results
- VB.Net: Display total when check boxes are checked
- PHPBB3and super globals?
- Combine Fortran .for and .f90 include header files
- PHP include Page.php, if Page=404 { PHP include API { WRITE API as Page.php (Storing APIs on Servers)
- C++ #include <[filename]> but #include <string> is not a filename
- Make prepros watch Jade HTML include files
- Xcode 7 handling of include files changed
- Dynamic PHP Page Include (CMS / Blog)
- how to include script of variables in a class? undefined variable
- How to create an "include all" file?
Related Questions in DIRECTORY
- Optimum directory structure for large number of files to display on a page
- install a R package from directory
- Are stringified MongoDB ObjectID's safe as folder names?
- Generate TCPDF output to a shared drive folder
- Get number of files in various subdirectories relative to the current page - ColdFusion
- Ruby on Windows XP: How to change directory of SSL certificates
- Google Drive API VB.NET Parent Folder of a Folder
- Count files in a directory while excluding others by directory and subdirectories using PHP
- Media files end up in in a pycharm subdirectory when uploading
- Remove part of filename of files that are in different folders
- Group items based on x number characters of basename
- Android Studio missing drawable Folder
- Updating folder structure with Mac Terminal
- Matlab error in file path for a sound
- Rails: Include Javascript_include_tag outside default folders
Related Questions in JAM
- Calling jam from Makefile does not work
- Combining multiple static libraries into single share library in Boost Jam file
- Jam and static libraries
- Dependency Breaks Build
- Creating Application Structure
- Seperate build directory and include directory in Jam
- Building boost without memory-mapped IO
- Jam Object rule and directories
- Calling a python script from a Jamfile
- How can I include the Jambase file to my build?
- Create Folder using Jam
- How do I see g++ compiler output when using Jam?
- Is there a provision to invoke jamfile and jamrule from cmake and vice versa?
- Require.js build not concatenation scripts loaded with Jam
- Jam HDRPATTERN for scheme load expressions
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Good for you for using Jam! I think you'll find it a lot easier than makefiles, once you get past a few of its oddities.
What you are asking about is a setup I have often used. At the top level, I have three directories: src, inc, and build. There is also a file called Jamfile:
The SubDir line establishes the location of this file within the directory structure, and seems to be necessary for Jam to work. (I think Jam could have been designed to not need it, but there it is, so be it.) The SubInclude lines tell Jam to include two subdirectories. The inc subdirectory is not included because there is nothing there that needs to be compiled directly; all its contents will be included by other files.
Within inc, I have a header file called header.h:
Within src, I have the source of the main program, main.c:
Also within src is another Jamfile with these contents:
The SubDir line locates the Jamfile within the directory structure. The HDRS line tells Jam where additional headers can be found (it will pass this on to the compiler when the time comes). Note the use of the += operator, which appends to an existing variable. The Library line tells Jam to build a library out of main.c (yes, a library with a main() is a little weird, but OK on a small project like this).
Within build is a single Jamfile:
The SubDir line locates the Jamfile within the directory structure. The Main line tells Jam to build an executable called helloworld. Note that it has no source file dependencies. If it did, it would look like
Main hello world : foo.c ;. The LinkLibraries line tells Jam to link the helloworld executable with a library, also called helloworld. It is OK in this case that the executable and library have the same name, but in a real program you might want to give them different (and better) names. The SubInclude line tells Jam to look in the src directory for more code to build. This is how the dependency between the executable and the library gets resolved. It is important that this line come last.Now, if you navigate to the build directory and execute the jam command, Jam will build a helloworld.a file in src, and link it into a helloworld executable in build.
Because all the code in src is being compiled into a library, there are no .o files left over. They are all stored inside the .a file, which is an archive, after all. If you have additional source files in build (like the hypothetical foo.c mentioned above), then you would have .o files left over in the build directory after compiling.
Good luck with all this. I learned most of what I know about Jam from the Perforce website and through experimentation. The main Perforce page for Jam is here.