make

my makefile's target-specific variable doesn't affect recursively expanded variables

In my makefile (rather simplified below) I have a target-specific variable that needs to influence a recursively expanded variable, but it's not doing so - leaving me sitting here scratching my head: NAME = MyProg OBJECTS = $(OD)/main.o RD = Release OD = Foo all: OD = $(RD) all: $(OD) $(OD)/...

Are there any good tools for examining Makefiles?

Large complex make files can be daunting to read and examine. What tools are good for visualizing or otherwise examining a gnu make file? ...

create custom LAMP distribution like XAMPP

I wish to make a self contained LAMP distro software package from source with at least the following: * php must have mysqli, ldap and GD support * all required .so's must be included (like libpng needed by GD) (self contained) I managed to make one but i keep patching quirks to it, SO i thought to start from a wide-used one like XAM...

How do I use cp to copy one directory to new name repeatedly and correctly?

I am writing a makefile. However except for the path expansion and restrictions on what I can do, this is basically a shell scripting question. As part of the make process, I want to copy a directory to the destination. My source directory and destination directory are variables, so I can't assume a lot about them. They may be fully qual...

Make, inherit rules in subdirectory Makefile

I want to set up a system of Makefiles in my project directories so that the rules defined in one will be defined in others. Let's say for example I have a directory called "test" and inside is "test.c" but I want to build test.c using a rule defined in a Makefile in the root directory Here is an example #Makefile (inside base dir) %....

Makefile, header dependencies

Let's say I have a makefile with the rule %.o: %.c gcc -Wall -Iinclude ... I want *.o to be rebuilt whenever a header file changes. Rather than work out a list of dependencies, whenever any header file in /include changes, then all objects in the dir must be rebuilt. I can't think of a nice way to change the rule to accomodate this...

linker error - linker input file unused because linking not done. then undefined reference to a function in that file

Ok so I'm having trouble with my linking of files. Basically, my program works: the main program, is gen1 gen1 - recieves input sends to str2value for processing, outputs resaults str2value, brakes input into tokens using "tokenizer" deterines what sort of processing to do to each token, and passes them off to str2num, or str2cmd. then r...

Very simple application fails with "multiple target patterns" from Eclipse

Since I'm more comfortable using Eclipse, I thought I'd try converting my project from Visual Studio. Yesterday I tried a very simple little test. No matter what I try, make fails with "multiple target patterns". (This is similar to this unanswered question.) I have three files: Application.cpp: using namespace std; #include "Window....

Makefiles: how to get a file name for a rule target from outside, in a portable way

I need to get some external data to form an output file name in a Makefile. In GNU Make I can do something like this : NAME=$(shell some_commands) $(NAME).out: file.in compile "$<" -o "$@" Some other rules have $(NAME).out as a prerequisite so I need $(NAME).out as a target. I can't use substitution+quotes here as this is not in...

Is there a C++ dependency index somewhere?

When trying new software and compiling with the classic ./configure, make, make install process, I frequently see something like: error: ____.h: No such file or directory Sometimes, I get really lucky and apt-get install ____ installs the missing piece and all is well. However, that doesn't always happen and I end up googling to fin...

Silent make execution in vim/gvim

I want to use gvim to launch make and do the build for my code. Since the build process takes some time i want it to be silently executed and then in the end errors/build log be showed to me. i have added this to my .vimrc :command -nargs=* Make silent make <args> | cwindow 10 map <c-b> <c-o>:Make<cr> So when i press Ctrl-b it start...

gcc, make: how to disable fail on warning?

I'm trying to build gcc for use with an AVR micro controller and avr-ada, and I've hit a roadblock caused by my regular compiler being too picky about the version I needed for the AVR. I get the following warning, which in turn causes the gcc or make to report an error: gcc -c -g -O2 -gnatpg -gnata -nostdinc -I- -I. -Iada -I../../gc...

How to match string/dir in a path using bash scripting

I'm trying to create a Makefile that uses information from the path to create a relevant rpm name. Suppose I have two different possible paths: PATH1 = /usr/local/home/jsmith/code/main PATH2 = /usr/local/home/jsmith/code/dev/ver2 If "main" is detected in the path, I want to detect and append "main" to the rpm name. If "dev" is detec...

Log invoked commands of make

Is there a way to log the commands, make invokes to compile a program? I know of the parameters -n and -p, but they either don't resolve if-conditions but just print them out. Or they don't work, when there are calls to 'make' itself in the Makefile. ...

GNU Make: How to call $(wildcard) within $(eval)

I'm trying to create a generic build template for my Makefiles, kind of like they discuss in the eval documentation. I can't seem to get the wildcard function to work within an eval. The basic code I'm having issues with looks like this. SRC_DIR = ./src/ PROG_NAME = test define PROGRAM_template $(1)_SRC_DIR = $(join $(SRC_DIR), $(...

How to use MinGW make with Vim on Windows.

I have installed Vim and MinGW on my machine, so I try to create Hello World then compile in in Vim and everything work fine. However when I type :make it show error 'make' not recognized as an internal or external command. I already added variable path to C:\MinGW\bin. I want to know how to configure Vim or my machine to allow make com...

Vim: multi-file editing - having different makes in different splits

I'm a recent vim convert (from fancy IDEs like eclipse.) I love the :make command in vim and use it extensively; however I also like to edit multiple projects (with separate makefiles.) So usually to edit more than one project I will do pushd project1 vim project1.cpp [suspend signal] pushd ../project2 vim project2.cpp and now I ca...

Workaround for GNU Make 3.80 eval bug

I'm trying to create a generic build template for my Makefiles, kind of like they discuss in the eval documentation. I've run into a known bug with GNU Make 3.80. When $(eval) evaluates a line that is over 193 characters, Make crashes with a "Virtual Memory Exhausted" error. The code I have that causes the issue looks like this. SRC_...

What does this error mean: `somefile.c:200: error: the frame size of 1032 bytes is larger than 1024 bytes`?

During a make, I'm seeing an error along the lines of: cc1: warnings being treated as errors somefile.c:200: error: the frame size of 1032 bytes is larger than 1024 bytes The line number points to the closing brace of a c function that has a signature like this: void trace(SomeEnum1 p1, SomeEnum2 p2, char* format, ...) { char st...

Makefile rule depending on change of number/titles of files instead of change in content of files.

I'm using a makefile to automate some document generation. I have several documents in a directory, and one of my makefile rules will generate an index page of those files. The list of files itself is loaded on the fly using list := $(shell ls documents/*.txt) so I don't have to bother manually editing the makefile every time I add, de...