make

Can makefile variables be assigned with values read from source files?

Suppose there is a C program, which stores its version in a global char* in main.c. Can the buildsystem (gnu make) somehow extract the value of this variable on build time, so that the executable built could have the exact version name as it appears in the program? What I'd like to achieve is that given the source: char g_version[] = "...

Sourcing a shell profile in an ant build file?

I am using cruisecontrol and ant to build some legacy executables that also depend on a shell profile to setup env vars properly. Is there a way to exec this profile using ant in the current process so the makefiles ant calls get the env vars correctly? Another solution would be if there is a way to add the profile sourcing to the sub m...

Python make systems

What are the benefits and problems with the various Python make-like systems? note We're using the denotations '(+)' and '(-)' respectively at the beginning of list items to indicate benefits and problems. So far I'm aware of buildit was previously known as pymake (-) seems to be obsolescing: last release was in late 2007 zc.build...

Speedup GNU make build process - Parallelism?

I build a huge project frequently and this takes long time (more than one hour) to finish even after configuring pre-compiled headers. Are their any guidelines or tricks to allow make work in parallel (e.g. starting gcc in background, ...etc) to allow for faster builds? Note: Sources and binaries are too large in size to be placed in a ...

Does CMake has something like % substitution support from Make?

I need a chain of file processing in my build-process. Workflow can be easily specified and built around a filename, only extension changes, like file.a -> file.b -> file.c. So, it's clearly a case for Make's declarative syntax. But as I see, for CMake this will look like an explicit *add_custom_command* for each file for each step of pr...

Cygwin make can't find cygwin commands

While trying to install a build server I've run into a funny problem where all cygwin commands can be run from a DOS box but sometimes do not work when called from make. What's even more weird is some make targets, like 'clean', work and others, like 'all', do not. Here's a representative makefile extract. The quoting has hosed the fo...

Executing commands in the directory in which the file that they were defined in is located

Consider, if you will, the following situation: $ pwd /tmp/submake_example $ head $(find -type f) ==> ./subdir/Makefile <== subtarget: echo "executing subtarget from directory $$(pwd)" ==> ./Makefile <== include subdir/Makefile $ make subtarget echo "executing subtarget from directory $(pwd)" executing subtarget from directory ...

How can you force recompilation of a single file in a Makefile?

The idea is that a project has a single file with __DATE__ and __TIME__ in it. It might be cool to have it recompiled without explicitly changing its modification date. edit: $(shell touch -c ..) might be a good solution if only clumsy. ...

Problem using SDCC in a Makefile during the link step

The Small Device C Compiler (SDCC) will produce a ihx (Intel Hex) file even if there are undefined reference errors during the link step. This behavior causes problems when using SDCC in a Makefile because if you set the ihx file to be your make target, then make has no good way of knowing that a previous attempt at linking has failed. ...

make install only if file changed

When writing a well crafted Makefile, one that keeps proper dependencies, and do only the minimum needed if a file has been changed, it seem that the install: target is often overlooked. More often then not the install target looks something like: TRG := /trg BIN_TRG := $(TRG)/bin ETC_TRG := $(TRG)/etc BIN_FILES := b1 b2 b3 ETC_FILES :=...

make deleting dependency files

I'm not sure if it's gmake or gcc that I don't understand here. I'm using the -MM and -MD options to generate dependency rules for the Unit Testing framework I'm using. Specifically: $(TEST_OBJ_DIR)/%.d: $(TEST_SRC_DIR)/%.cpp @$(CPPC) -MM -MD $< -o $@ @sed -i -e 's|\(.*\)\.o:|$(OBJ_DIR)/\1.o $(TEST_OBJ_DIR)/\1.d $(TEST_OBJ_DIR)/\1...

Automatically choosing object files for compilation

I have recently begun writing unit tests (using GoogleTest) for a C++ project. Building the main project is fairly simple: I use GCC's -MM and -MD flags to automatically generate dependencies for my object files, then I link all of the object files together for the output executable. No surpirses. But as I'm writing unit tests, is the...

Building Froyo fails - make: *** [.../classes.dex] Killed

Hi, I am attempting to build Google's Android v2.2 (Froyo) from source on an Asus A3E laptop (512MB ram) running Ubuntu Netbook 10.04. I have followed the instructions on http://source.android.com/source/download.html and set java to version 5 with using: sudo update-java-alternatives -s java-1.5.0-sun java -version gives me: 1.5.0_01...

How to detect XCode vs Makefile build

I'ld like to automatically detect (using #ifdef) whether I'm building using XCode or using make under Darwin. Is there a specific define to XCode or make set automatically by either tool? I'ld like to avoid setting a define in the XCode project or Makefile manually. ...

Python Script Calling Make and Other Utilities

Hi all. I have a python script that invokes the following command: # make After make, it also invokes three other programs. Is there a standard way of telling whether the make command was succesful or not? Right now, if make is successful or unsuccessful, the program still continues to run. I want to raise an error that the make ...

Set “makeprg” via modeline in Vim

By default, makeprg is set to just make. However, I’ve got a lot of projects where different build configurations and targets reside in the same directory. This of course necessitates that I specify a target when invoking make. For example, I’ve got a project that’s set up to build a source file <foo>.cpp by invoking make foo, and the ...

Automake: Syntax of conditionals in Makefile.am

I am familiar with the if VAR_NAME, where VAR_NAME is defined by an AM_CONDITIONAL clause inside of configure.ac. Is there a corresponding "if not defined" construct in Makefile.am? ...

Comments from a makefile

When running something like "make install", there is a lot of information displayed in the terminal window. Some lines start with make[1], make[2], make[3] or make[4]. What do these mean? Does this mean there is some kind of error? ...

Execute commands if compiling fails with Make

With GNU Make and one of the compilers in gcc: Is it possible to execute commands if (and only if) the compiling fails? ...

install rpcgen on debian lenny

Hey everybody, I am trying to compile VXI11 source codes on my debian - lenny, but I get this error: make rpcgen -M vxi11.x make: rpcgen: command not found Anyone know to rpcgen get intalled? Cant find solution. Any help is most appreciated. Thanks Petr ...