makefile

Linux Makefile structure and documentation

Hello, I'm new to Linux development, 'make' seems to be the standard for building applications. I'm having difficulties understanding the structure of a makefile. Please, can you point me to good resource or documentation to look at ? ...

Firefox make file

I want to backtrace the makefile for firefox so that I can get the final gcc command that is used to compile the c++ files. How can I do that? ...

Re-execute target when specified as dependency to multiple rules

I have the following GNU makefile: .PHONY a b c d a: b c b: d c: d d: echo HI I would like the target 'd' to be run twice -- since it is specified as a dependency by both b & c. Unfortunately, the target 'd' will be executed only once. The output of running make will simply be 'HI', instead of 'HI HI'. How can I fix this? Th...

Multiple rules specify the same phony dependent, dependent only executes once

I have a question regarding the GNU makefile example below: .PHONY: $(subdirs) build x y subdirs = a b c build: x y x: target=prepare x: $(subdirs) y: target=build y: $(subdirs) $(subdirs): $(make) -f $@/makefile $(target) When I run make, I expect make to be called for each sub-directory specifying the target 'prepare' then...

Installing PL/Ruby for PostgreSQL on Windows

I have a problem installing PL/Ruby for PostgreSQL 8.4 on Windows XP PostgreSQL 8.4 is installed and working OK Ruby-186-27 is installed and working OK I have MinGW installed and I'm using MSYS as the command line shell I have downloaded plruby-0.5.3 and unzipped. My PostreSQL is in C:\Program Files\PostgreSQL\8.4 I've created a record...

Unix Makefile in Windows Visual Studio 2008

I've done a decent search, but can't seem to find a way to get Visual Studio 2008 to use a unix Makefile, or even to create some MSVC compatible equivalent from the Makefile. Does anyone have ideas or similar issues? Note: I already know the benefits/drawbacks of using Makefiles or not, and I don't want to hear your opinion. All I'm int...

Finding version of Microsoft C++ compiler from command-line (for makefiles)

I must be missing something really obvious, but for some reason, the command-line version of the Microsoft C++ compiler (cl.exe) does not seem to support reporting just its version when run. We need this to write makefiles that check the compiler version a user of our tool has installed (they get makefiles with code they are to compile ...

Recommended build system for latex?

I'm trying to figure out the best build system for latex. Currently, I use latex-makefile, editing in vim, and viewing changes in Okular or gv. The major problem is that it sometimes gets hides errors on me, and I have to run latex manually. The major advantages are that it does all the iteration I need, and offers both pdf and ps simpl...

Compiling Small Gcc Project on Windows Using MinGW

Hello, so I've been programming in C++ for almost 2 years now, and the whole while I've had the pleasure of using an IDE (VS) with lovely project settings and automatic linking and the like. I've always stayed away from any external libraries which required me to compile via makefiles, or at least the ones which were meant for linux envi...

Win32 paths as targets/dependencies

Is it possible to have a GNU makefile with a target/dependent containing a win32 path name? I'm currently using the win32 3.81 version of GNU make, and it seems to have difficulties with drive letters. For example: C:\MyTarget.obj : c:\MySource.cpp cl /c C:\MySource.cpp The above makefile snippet will generate errors. In partic...

perfect makefile

I'd like to use make to get a modular build in combination with Continuous Integration, automatic unit testing and multi-platform builds Similar setups are common in Java and .NET, but I'm having a hard time putting this together for make and C/C++. Any thoughts? My requirements: fast build; non recursive make (stackoverflow what i...

makefile/script for small program

Hi All, I have to frequently compile small program and run it. Since, it was tedious to write compile command g++ -W -Wall file.cpp -o out everytime for each cpp file, I wrote one small scripts, which does the compiling. Here is the script that I wrote #!/bin/bash g++ -W -Wall $1 -o $1.out So, if I have to compile file.cpp, I will ...

recursive gmake question

Hello, I need to write a quick makefile for building all my projects. This is C++ code and I am using gmake. Say I have a list of directories, I want to cd to each, issue gmake command and if it succeeds, go to the next one and so on. I cooked this by looking at the gmake manual .PHONY: all clean dirs $(DIRS) dirs: $(DIRS) $(DIRS):...

Passing a gcc flag through makefile

Hi, I am trying to build a pass using llvm and I have finished building llvm and its associated components. However, when I run make after following all the steps to build a pass including the makefile, I get the following error: *relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile wit...

Prepend/Append Makefile to a QT generated Makefile

I have a building environment where I add some prepending and appending lines to each Makefile generated. It would be nice if I could put this lines into the qmake generated file via my project file (*.pro). Of cause I can do this via some easy shell scripting but it would be much nicer to do it from inside of the project file. Is ther...

printing long compilation lines with MS NMAKE

I have a legacy MS NMAKE Makefile I need to fix a few bugs in. There are some very long command lines I wish to debug that are being executed using the following NMAKE trick dep: cmd @<<tmpfilename cmd_args.. << When changing the line to dep: echo cmd @<<tmpfilename cmd_args.. << NMAKE complains that the line is too long....

Using make to borrow compiler license from license server?

We are using recursive make in our project. We also use a commercial embedded compiler (diab) with a FlexLM license. We are currently adding license-borrowing as a dependency on the top-level targets in each directory. Like this: .PHONY: target target: borrow_compiler $(TARGETLIB) $(RETURN_COMPILER) .PHONY : borrow_compiler borro...

Forcing Eclipse to generate standard Unix makefiles

I have an Eclipse project I've been working on for some time now, and I'd like to open source it. But to do that I'd like to have a clean Makefile like the majority of other open source programs. I understand I could make my own, but it would be better if Eclipse could manage it for me. Getting Eclipse to generate a CMake file would be e...

Install C C++ library under HOME shared via Network File System

Hi, My Home directory is shared among several linux computers via Network File System. I would like to install some C C++ library from source under my Home directory, and wish they can be used under all the linux computers. Do I have to install different versions of the library under different directories of my Home for different compu...

organize project and specify directory for object files in Makefile

Hi, Here are my two questions: I am now learning to manage my code with CVS, and I just want to make a repository for my C++ files, Makefile and bash and python scripts only, not the object files and executables. So I made several subdirectories under my project directory: src, bin, scripts, results and data. I put C++ files and Makefi...