I have a CMake C++ project that is rapidly growing and often changing. I'm trying to reduce compile times to a minimum.
Often, when I rebuild the project, especially after a header change, I'm surprised at how many compilation units need to be recompiled. I'm trying to identify #includes that can possibly be avoided, for example by usin...
How to get the invoking target of the gnu makefile?
for example, I invoke the makefile with the following command line:
make a-target
How can I get the invoking target "a-target" in the makefile to assign it to a variable?
further more, if more than one target is specified in cmd line:
make target1 target2 ...
How to get all of the...
Hi Everyone,
I've been heavily refactoring my makefiles, with help from Beta, Paul R, and Sjoerd (thanks guys!).
Below is my STARTING product:
#Nice, wonderful makefile written by Jason
CC=g++
CFLAGS=-c -Wall
BASE_DIR:=.
SOURCE_DIR:=$(BASE_DIR)/source
BUILD_DIR:=$(BASE_DIR)/build
TEST_DIR:=$(BASE_DIR)/build/tests
MAKEFILE_DIR:=$(BASE_D...
So a couple years back I took some time to grok make, and it's paid off enormously. Writing little makefiles for building my projects and automating tasks is fun and productive.
The downside is, of course, that my makefiles are overspecific, especially when it comes to platforms and library locations.
So this is the point at which peo...
Hi.
I am trying to make APP native code for Android.
The Native code is in cplusplus.
Whenever I try to make, the following error appears.
H236Plus.cpp:135: error: exception handling disabled, use -fexceptions to enable
How do I use -fexceptions to enable exception handling, and where do i use it?
...
I'm using msysgit on Windows 7, but it doesn't seem to come with make. Is there an easy way to get make running on msysgit?
...
This is the first time that this error has come up. I am using Cygwin with Eclipse 3.5 and my Path variable is set to: %CommonProgramFiles%\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Prog...
I am trying to install gcc (a branch of gcc, not the trunk in the svn), and I configured it with:
./configure --prefix=/home/user/myroot/ --enable-languages=c,c++ \
--disable-multilib --libexecdir=/usr/lib --without-included-gettext \
--enable-threads=posix --disable-werror --with-arch-32=i486 \
--with-tune=generic --enable-...
I have the following Makefile rules:
DIR = src
SOURCES = $(shell find $(DIR) -name "*.cpp")
OBJS := $(SOURCES:.cpp=.o)
With this definition all my .o files are located in the same directories (and sub-directories) as their .cpp counterparts. Such allocation principle turns the project directory into a mess very soon (with 50+ files). ...
From the GNU Make manual:
The value of the make variable SHELL
is not exported. Instead, the value of
the SHELL variable from the invoking
environment is passed to the sub-make.
You can force make to export its value
for SHELL by using the export
directive, described below.
I must be doing something wrong, or not readin...
I have a makefile that takes options at the command line
make OPTION_1=1
Based on the value it will add additional compiler definitions to a subset of objects.
ifeq ($(OPTION_1), 1)
CC_FLAGS += -DOPTION_1_ON
endif
The change in the definition affects the included header file content - a stub or an implementation is exposed to the ...
I want to run 'make install' so I have everything I need, but I'd like it to install the things in their own folder as opposed to the system's /usr/bin etc. is that possible? even if it references tools in the /usr/bin etc.?
...
I'm trying to "portablize" git, so I want to send the required executables from the make process of git to my hosted web server. Can I do that? Do you think the executables will work?
...
none of the --debug= flags seem to do it for me.
...
I am not proficient with makefiles, but am used to simple ones. Right now, I have a task on hand.
I need to compile and link a test application with a different library and different include path based on the given target. If target is TARGET1, then link against LIB1 and include INCLUDEPATH1 during compilation. Similarly, if given targe...
I have a makefile structured something like this:
all :
compile executable
clean :
rm -f *.o $(EXEC)
I realized that I was consistently running "make clean" followed by "clear" in my terminal before running "make all". I like to have a clean terminal before I try and sift through nasty C++ compilation errors. So I tried to a...
Installing QT plain is no problem, but when you've got to recompile QT with a MySQL driver plugin? Confusing. And when I do run configure, Qt registers my MySQL driver, but when I attempt to run mingw32-make, this abomination shows up on my command prompt:
g++.exe: ....corelibcodecsqisciicodec.cpp: No such file or directory
g++.exe: n...
I have a build system tool that is using getcwd() to get the current working directory. That's great, except that sometimes people have spaces in their paths, which isn't supported by the build system. You'd think that you could just make a symbolic link:
ln -s "Directory With Spaces" DirectoryWithoutSpaces
And then be happy. But u...
I am trying to say "the download of the git repository will only work if the directory yank/ exists. If the directory yank/ does not exist then make it"
yank/gist.el/gist.el : yank
cd yank ; git clone http://github.com/defunkt/gist.el.git
yank:
mkdir yank
I am using makepp - http://makepp.sf.net
and am getting the error:
[m...
It is clear that the target is newer than the source from these two ls
comands:
[metaperl@andLinux ~/edan/pkg/gist.el] ls -l ../../wares/gist.el/gist.elc #target
-rw-r--r-- 1 metaperl metaperl 10465 Jul 18 10:56 ../../wares/gist.el/gist.elc
[metaperl@andLinux ~/edan/pkg/gist.el] ls -l yank/gist.el/gist.el #source
-rw-r--r-- 1 metaperl m...