method for setting up separate src and build directories [message #1820619] |
Thu, 23 January 2020 17:01  |
Eclipse User |
|
|
|
Hello,
I have a makefile g++/gfortran project that I have imported into eclipse. This is a large project, so the src is spread over many directories and sub-directories. I build this for multiple platforms but like to keep the code base unified. I have a different build directory for each platform to hold the associated complied objects and binaries.
The different build directories are named and created by the makefile with code that looks something like this,
# determine platform
# this is not really sufficient for all linux cases, might be hard coded
PLATFORM := $(shell echo $$OSTYPE)
# determine build directory name elements
OS := $(shell uname -s)
ARCH := $(shell uname -m)
KERN := $(shell uname -r | cut -d. -f 1,2)
# determine g++ compiler version
GCMP := $(shell g++ --version | cut -d ' ' -f 4 | sed q)
# create version name for g++
CMP := gcc-$(GCMP)
# specify version of the application being built
VER := debug
# create build dir name
BDIR := bld_$(OS)_$(KERN).$(ARCH)_$(CMP)_$(VER)
# mkdir the build directory if it doesn't exist
$(shell mkdir -p $(BDIR))
I boot into the OS I want to build in (in a VM or hardware) and mount the shared directory with the program /trunk directory (contains the makefile, /src, /bld_*, /test, etc). I run make from the command line passing the makefile (and sometimes version information) as arguments. The makefile creates the required build directory based on the local environment and builds the application. I generally don't need to run a separate configure script.
I have used eclipse to work on java projects before but not for c++. I have some questions about how to set up an eclipse project that is suitable for the system I have described here.
Is it enough that the src file and build directory locations are coded into the makefile? Do I need to somehow register these locations in the eclipse project? If I just create a makefile project in the top directory (/trunk), will I be able to use all of the featuures in eclipse such as debugging?
It seems now as if I am using eclipse in the same way I was using a terminal. I have a project in eclipse and I build or run by pressing buttons in a gui instead of calling make or the application from the terminal. Is there a write-up somewhere about eclipse projects using multipel /src and /build directories?
Thanks,
LMHmedchem
[Updated on: Thu, 23 January 2020 17:05] by Moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05825 seconds