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 answers
Related Questions in BUILD
- Build issue in my STM32-NUCLEO project using the Eclipse IDE
- Module not found when building flutter app for IOS
- Why am I getting this error ? error CS0103: The name 'EnhancedStackTrace' does not exist in the current context
- Gradle 8.7 cannot find installed JDK 22 in IntelliJ
- Build LLVM, Clang and Libfuzzer
- when I open a ktor project, error Cannot invoke "java.nio.file.Path.toString()" because the return value of "java.nio.file.Path.getFileName()" is null
- Cannot make Django run the frontend from Vite's build ("was blocked because of a disallowed MIME type (“text/html”)")
- Distorted CSS after Build process
- how to build nextjs app unable to build and deploy
- How to build custom mediapipe python model i.e. adding flow_limiter_calculator to face_landmark_front_cpu.binarypb
- Assets not showing after build process in Vite and React
- "Config.guess failed to determine the host type" when trying build binutils-2.7 with Cygwin
- The assembled Python application does not launch
- Why rebuild module does not recompile dependency module, but build module does in IntelliJ Idea?
- Gitlab pipeline stuck with nx cloud issue
Related Questions in INCLUDE
- A multi-line substitution in RST
- External macro definition in header
- Premake configuration - include directories in a multi project work directory
- Django NameError: name 'include' is not defined in urls.py
- "avr/io.h" not found when compiling assembly for ATmega128
- Re-flex library not found in C++ autotools project
- Fortran compilation dependency of modules and INCLUDE statement with make
- How exactly is include/require resolved in PHP?
- Sequelize - Wrong sql request generated using include, with a basic example
- C++11 - GCC - Can #import (used once) replace many #include? (or is that necessary?)
- How to have individual include directories for each subdirectory?
- Paraview paraview.plugin purpose
- VS code : #include<execution> :-#include errors detected. Please update your includePath
- C: redefinition of function when using #include
- Include error with # include <sys/wait.h>
Related Questions in DIRECTORY
- I cant access file directory with PHP local host on XAMPP. it just shows one of the files I have in my visual studio code
- PHP string variable to multiple rows in table sql insert
- Android - Why my app picks values on default folder (instead XXHDPI)
- Use htaccess to add subdirectory to url while displaying base url
- Dockerfile and package-json are in different folders
- VS2022 C++ empty directory for audio file. CMake; SFML
- Visual Studio Error: The system cannot find the file specified
- Email from SharePoint: "Heads up! We noticed that you recently deleted a large number of files from a site" but the user doesn't deleting anything
- Duplicate folder into new folder one level up in the directionary
- Shapefiles not showing up in assigned directory in R - says it exists but can't find it
- Recursively calculate SHA256 sum of all files in directory using OpenSSL
- $WinREAgent folder keeps to automatically appear
- thunderbird local archive folder missing
- Python folder path string escape character error
- Switch r settings to not have to create directory when saving files into new subfolders
Related Questions in JAM
- No builtin modules when calling b2 on a file with -f
- jamfile: copy files to different directories
- Building boost without memory-mapped IO
- Boost build error of recursion in main target references
- Boost compilation does not understand block comment in JAM file
- Is there a provision to invoke jamfile and jamrule from cmake and vice versa?
- what does $(1:D=) mean?
- using short codes in JAM Stacks
- How can I include the Jambase file to my build?
- Failed building boost for GCC on Win10
- Access environment variables inside a jam configuration file
- How do I specify dependencies in libraries in Jamfiles?
- Boost-build - dependency on subproject target
- How to pass command line arguments in Jamfile?
- Your Rank Is Pure Google Code Jam Assistance
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?
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)
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.