make

gnu make reloads includes but doesn't update the targets

I'm trying to create a Makefile that will download and process file a file to generate targets, this is a simplified version: default: all .PHONY: all clean filelist.d clean: @rm -fv *.date *.d #The actual list comes from a FTP file, but let's simplify things a bit filelist.d: @echo "Getting updated filelist..." @echo "LIST...

What do companies use to build their binaries?

What do modern companies use to compile and link their projects? Especially with large projects, makefiles don't seem usable enough to be scalable. As far as I can tell, many companies use either in-house build systems or in-house scripts on top of existing build systems. Do large projects use make? Is pure Ant, Maven, etc used or is...

Compling C++ on remote Linux machine - "clock skew detected" warning

I'm connected to my Universities small Linux cluster via PuTTY and WinSCP, transferring files using the latter and compiling and running them with the former. My work so far as all been in the Uni labs and today I've been doing some work at home and hit an interesting warning. I uploaded an entire folder of stuff and upon running make i...

Cleanup Strategies after Building Source Code using eg. Git

I (mostly) use git to download and compile various projects from their source code, keeping my source in /usr/local/src and installing the binaries in /usr/local/bin. Following the building procedure, usually with ./configure && make && make install, I'm left with a lot of cruft that ends up as 'new' files in my local git repository. T...

Managing C++ project - file layout, dependencies and version control

Hi community, I have recently started a new C++ project and I intend to make it cross-platform in time. I haven't had much experience with C++ projects before so the first thing that bothers me is that default Visual Studio file layout setup. I tried reading-up the Net on this subject but the info just seems rare and conflicting, so I s...

BSD Make and GNU Make compatible makefile

I have a BSDmakefile and GNUmakefile that are pretty much identical except for dependency management. The GNUmakefile: ifneq ($(MAKECMDGOALS), "clean") -include $(dependencies) endif The BSDmakefile: .for i in $(dependencies) .sinclude "${i}" .endfor Is there a way to make it so that I can detect if I am running under gmake or bsd...

Directory as a dependency in make rule

Is it possible to specify a directory as a dependency in a Makefile rule? Actually I have a Makefile in a directory and another directory containing all the source files. . . |_ Makefile |_ src |_a.c |_a.h Now I want that whenever I make any change in the src directory i.e. in either of a.c or a.h , a particular rule in my Mak...

get process id in Makefile

How can I get the pid of my make command in the Makefile? Specifically, I want to use a temp directory that will be unique to this build. I tried: TEMPDIR = /tmp/myprog.$$$$ but this seems to store TEMPDIR as "/tmp/myprog.$$" and then eval as a new pid for every command which refs this! How do I get one pid for all of them (I'd prefe...

ignoring at (@) symbol in makefiles

In makefiles, a line prefixed with an at symbols disables the print of the output. I have a makefile where every line is prefixed with an at, but for debug I need to see what's going on. Is there a way to tell make to ignore the at and output the line ? the debug is excessive, and the -n option prints them, but does not do anything (it's...

making all rules depend on the Makefile itself

When I change a Makefile, its rules may have changed, so they should be reevaluated, but make doesn't seem to think so. Is there any way to say, in a Makefile, that all of its targets, no matter which, depend on the Makefile itself? (Regardless of its name.) I'm using GNU make. ...

Using boost.python with make instead of bjam

Hi folks, I'm just trying to compile the "hello world" example of boost.python WITHOUT using all the bjam magic. My boost.python installation is working, I did succesfully build the example with bjam and passed the test suite. Now for my project I need to use all this stuff in a plain Make environment. I don't want to port to another b...

Help with Makefile: No rule to make target

CC = g++ CFLAGS = -Wall RM = /bin/rm -rf BIN_DIR = ifeq "$(DEBUG)" "1" BIN_DIR = Debug else BIN_DIR = Release endif OBJS = \ $(BIN_DIR)/Unit.o $(BIN_DIR)/%.o: src/%.c @echo Building "$@" @g++ -c "$<" -o"$@" all: $(OBJS) clean: $(RM) $(BIN_DIR) .PHONY: all clean However, when I try to build my project this, it gives m...

Create rule in makefile for just a set of files

I am writing a Makefile, and I want to use a generic rule with wildcards, like %: bkp/% cp $< $@ But I wanted this rule to be valid only for a few specific files. I wanted to define a variable with the list, for example file_list = foo.c bar.c zzz.c and configure the rule so it is only valid for files that are listed in this var...

Forcing erl -make to recompile files when macros are changed

I tried to do something similar to http://stackoverflow.com/questions/1894363/how-to-make-two-different-source-directories-in-a-makefile-output-to-one-bin-dire/1895096#1895096, so I have these files (relative to my project root): Emakefile: % EMakefile % -*- mode: erlang -*- {["src/*", "src/*/*", "src/*/*/*"], [{i, "include"}, {outdir,...

What's an easy way to detect modified files in a GIT workspace?

During make, I create string fields which I embedded in the linked output. Very useful. Other than a complex sed/grep parsing of the git status command, how can I easily determine if files in the workspace have been modified according to git? ...

Expression that either returns the output string from a program, or a specific string, if the program doesn't exist

I'm using mercurial as a SCM, and an output from the hg parents command in my makefile to store build number and version information in my program. However, mercurial is not always present on machines where I try to build the program. Thus, hg parent fails. I'd like to use a substitute string (hard-coded or output from other program) whe...

automake: modify implicity make rule to include extra flags

How can I add extra flag variables (like CPPFLAGS) that will apply to all makefiles? Currently, we're using CPPFLAGS, but that is supposed to be reserved as a user variable and I would like to reserve it. I'd prefer not to use AM_CPPFLAGS because I would like to reserve that for specific Makefile.amS. What I want is something like GLO...

Makefile conditional include

I'm trying to write an application that needs either ALSA or OSS headers. Basically, I want to pass a define to the compiler if /etc/oss.conf does not exist, since that probably means the soundcard.h header doesn't exist (feel free to correct me on that one, I'm still new to working with OSS). Per the OSS documentation, you would use the...

What are makefiles - make install

I see in Linux these things, but what is it?: ./configure make make install etc etc. ...

How do you perform an action over each file using make?

Let's say I have this: FILES = c:/file.c c:/another_file.c and I want to do something to each of the files. For example, I'd like to apply cygpath to each of the files. How can I do that? I would like a solution based on an external program, instead of a built-in make function please. ...