makefile

How to make a failing $(shell) command interrupt Make

I have a Makefile that starts by running a tool before applying the build rules (which this tool writes for me). If this tool, which is a python script, exits with a non-null status code, I want GNU Make to stop right there and not go on with building the program. Currently, I do something like this (top level, i.e. column 1): $(info G...

Makefile problem with conditional used in define used in commands part of a rule

I have a section of makefile that has this sort of structure: bob: ifdef DEBUG @echo running endif @echo chug chug chug ifdef DEBUG @echo done endif bobit: @echo "before" @make bob @echo "after" I'm simplifying greatly here, all the echo's are actually non trivial blocks of commands and there is more cond...

How to generate a Makefile with source in sub-directories using just one makefile.

I have source in a bunch of subdirectories like: src/widgets/apple.cpp src/widgets/knob.cpp src/tests/blend.cpp src/ui/flash.cpp In the root of the project I want to generate a single Makefile using a rule like: %.o: %.cpp $(CC) -c $< build/test.exe: build/widgets/apple.o build/widgets/knob.o build/tests/blend.o src/ui/flash.o ...

How to do Makefile dependencies for python code.

I have a bunch of C files that are generated by a collection of python programs that have a number of shared python modules and I need to account for this in my make system. It is easy enough to enumerate which python program need to be run to generate each C file. What I can't find a good solution for is determining which other python ...

Need a makefile dependency rule that can handle missing files

We use GNU Make for our system. At the end of our makefiles, we have an include called Makedepends which generates a bunch of .d files using -MM switch on gcc. We then include the .d file for each .cc file using an include $(CXXFILES:.cc=.d) line. But when we delete file or move files, the dependancies step breaks and we have to manua...

How to check if a file exists in a makefile

I have a makefile template to compile a single DLL (for a plugin system). The makefile of the user looks like this: EXTRA_SRCS=file1 file2 include makefile.in In the makefile.in I have: plugin.dll: plugin.os $(patsubst %,%.os,$(EXTRA_SRCS)) Where plugin.os is the main C++ file to be compiled. Btw, the files ending is .os are the ob...

What are the (M|m)akefile semantics?

Is there a difference between using a makefile and a Makefile? ...

Loops in Makefile

I have a lot of assignments where I have to continually update a Makefile as I add more subsequently numbered C programs. Is there a way to do this with a loop which iterates over the values 1.1, 1.2, 1.3, etc.? all: 1.1 1.2 1.3 1.4 1.5 1.6 1.7. 1.8 1.9 1.1: 1.1.o gcc -o 1.1 $(FLAGS) 1.1.o 1.1.o: 1.1.c gcc -c $(FLAGS) 1.1.c 1...

How can I have a Makefile automatically rebuild source files that include a modified header file? (In C/C++)

I have the following makefile that I use to build a program (a kernel, actually) that I'm working on. Its from scratch and I'm learning about the process, so its not perfect, but I think its powerful enough at this point for my level of experience writing makefiles. AS = nasm CC = gcc LD = ld TARGET = core BUILD = build SOURCES...

generic makefile?

Is there a generic makefile i can use to build a simple c++ project? on windows? i modified a working wii makefile to win32 but could not build properly (difference in make? the make app and the makefile seem to be found). I did a little hack and made a copy of mingw32-make as make. -edit- export PATH seem to be the reason i got my old ...

stange -I effect with make and bad -L

I am trying to build an automated build system. It took me a little while to change a working wii generic makefile to a working win32 (using mingw32) makefile. my make is here http://pastie.org/319482 The weird effect is, if i remove the a preceding the paths in ABS_INCL (line 31) the build doesnt work and complains about missing a hea...

Create a makefile for multiple OSes, this make (ext?) doesn't work?

I have a working makefile that builds with mingw32. Now i renamed that makefile to Makefile.w32 (source -> http://pastie.org/319964) Now i have a Makefile with the following. The problem is, it does not build my source all: make mingw32 clean: @echo "causes an infinite loop -> make mingw32 clean" mingw32: @echo "yeahhhhhh...

makefile calling makefile error

I have a working make, I have platform code and like several makes for each os in the folder. Right now I have one makefile which works. I renamed it to Makefile.ws and wrote this in Makefile all: make -f Makefile.w32 clean: make -f Makefile.w32 clean I ran it and got this error > "make" make -f Makefile.w32 make[1]: Enteri...

Is there a way to create a Makefile without running ./configure ??

I'd like to skip the tests and create a (default) Makefile. ...

generate dependencies for a makefile for a project in C/C++

I have a project that has a makefile with broken dependencies. Is there any best known way to generate a list of dependencies for the project that I can use in the makefile, other than examining each source file by hand or with a hand written perl script? ...

How to use makefiles in Visual Studio?

I heard a lot about makefile and how it simplifies the compilation process. I`m using VS2008, can somebody please advice me some online references or books when I can find how to deal with it? ...

What is this Makefile Doing?

I'm new using makefiles and I have some makefiles. One of them has these statements I tried to understand but I can't. What is this makefile doing? # debugging support ifeq ($(DEBUG), true) CFLAGS+=-DDEBUG -g endif ifeq ($(DEBUG), gdb) CFLAGS+=-g endif ifeq ($(PROFILING), true) CFLAGS+=-p endif # symbolic names debugging ifeq ($(D...

Can this build system be sped up?

Our build is dog slow. It uses nested gnu makefiles on linux. It creates three builds for three different targets from the same source tree. It uses symlinks to point to each of the three parallel directory trees in turn. We can do partial builds by using make inside subdirectories, which saves time, but if our work spans multiple direct...

Common GNU makefile directory path

I'm trying to consolidate some build information by using a common makefile. My problem is that I want to use that makefile from different subdirectory levels, which makes the working directory value (pwd) unpredictable. For example: # Makefile.common TOP := $(shell pwd) COMPONENT_DIR := $(TOP)/component COMPONENT_INC := $(COMPONENT_DIR...

Can autotools create multi-platform makefiles

I have a plugin project I've been developing for a few years where the plugin works with numerous combinations of [primary application version, 3rd party library version, 32-bit vs. 64-bit]. Is there a (clean) way to use autotools to create a single makefile that builds all versions of the plugin. As far as I can tell from skimming t...