make

GNU make variables in Makefile

Hi, I would like to create a Makefile which also creates a simple script for running the compiled application. I have something like the following: @touch $(SCRIPT) @echo LD_LIBRARY_PATH=$(LIB_DIR) $(APP_DIR)/$(APP) $1 $2 $3 $4 $5 $6 > $(SCRIPT) @chmod +x $(SCRIPT) @echo Script successfully created. And I want $1 $2 ... to appear i...

How can I define Makefile variables from a Perl script?

I am creating a Makefile which I want it to be a single file for different architectures, OSes, libraries, etc. To do this I have a build specific XML file which defines the different configuration options for each architecture. The config file is read by Perl (it could be any language) and the Perl output returns something like: var1...

How can I compile Open CL on Mac OS X 10.6.3?

I was able to follow instructions and compiled CUDA 3.0 but cannot compile OpenCL that goes with it on Mac OS X 10.6.3? ...

Compile PHP Error with freetype

Hey Guys, I configured PHP myself, included all of the libraries I needed... but then realized I forgot the freetype library. So I went back to my php-5.3.2 directory and ran ./configure '--with-free-type=/usr/local/lib' PHP did the configure fine, no errors. But when I run make: collect2: ld returned 1 exit status make: *** [sapi/c...

Invoking MSYS bash from Windows cmd

I'm using GCC on Windows7 (using the TDM's build). I installed MSYS to be able to execute make and compile using makefiles. However, it is tedious to every time start up the MSYS bash shell, navigate to the directory of the project and run make. What I want is to automate this process. I prefer to have a batch file in Windows, or someth...

CFLAGS vs CPPFLAGS

I understand that CFLAGS (or CXXFLAGS for C++) are for the compiler, whereas CPPFLAGS is used by the preprocessor. But I still don't understand the difference. I need to specify an include path for a header file that is included with #include -- because #include is a preprocessor directive, is the preprocessor (CPPFLAGS) the only thing...

How to generate one large dependency map for the whole project that builds with makefiles?

I have a gigantic project that is built using makefiles. Running make at the root of the project takes over 20 minutes when no files have changed (i.e. just traversing the project and checking for updated files). I'd like to create a dependency map that will tell me which directories I need to run 'make' in based on the file(s) changed....

C preprocessor vs. C compiler

If I tell the C preprocessor to #include a file and use CPPFLAGS to help find the needed file, then the file is included already, right? What, if any, use is telling the C compiler about the same include directory with CFLAGS? ...

How make decides to build target

One sign is that target does not exist, understand this. Another is by comparing modification timestamp of target and prerequisites. How it works in more details? What is the logic of comparing target and prerequisite timestamps and how it works when there are multiple prerequisites? ...

Cygwin make always processing target

However it happens only on Windows 7. On Windows XP once it built and intact, no more builds. I narrowed down the issue to one prerequisite - $(jar_target_dir). Here is part of the code # The location where the JAR file will be created. jar_target_dir := $(build_dir)/chrome # The main chrome JAR file. chrome_jar_file := $(jar_target_d...

Consolidating files in a single directory before you link them into the final executable

I am working on Solaris 10, Sun Studio 11. I am refactoring some old code, and trying to write unit tests for them. My make file looks like: my_model.o:my_model.cc CC -c my_model.cc -I/../../include -library=stlport4 -instances=extern unit_test: unit_test.o my_model.o symbol_dictionary.o CC -o unit_test unit_test.o my_model.o...

Makefile: couple syntax questions

package_version := $(version)x0d$(date) what is the x0d part between version and date vars? is it just string? What $(dotin_files:.in=) does below code dotin_files := $(shell find . -type f -name \*.in) dotin_files := $(dotin_files:.in=) what this means $(dotin_files:=.in) code $(dotin_files): $(dotin_files:=.in) ...

glui /usr/bin/ld: cannot find -lXmu

Hello: I have downloaded the latest GLUI source code and now I am trying to compile it. When I do so, I get the following error: g++ -O0 -Wall -pedantic -I./ -I./include -I/usr/X11R6/include -o bin/example1 example/example1.cpp -L./lib -lglui -L/usr/X11R6/lib/libXdmcp.a -lglut -lGLU -lGL -lXmu -lXext -lX11 -lXi -lm /usr/bin/ld: cannot...

using makefile targets to set build options

This is either trivial or runs counter to the philosophy of how make should be used, but I'd like to have a command line that reads as "make debug" rather than "make DEBUG=1". I tried creating a phony target called debug that did nothing except set the DEBUG variable, but then there was a difference between "make debug build" and "make b...

makefile: how to call macros in macros

Hello, I have the following macros in my make file: pdf: // do something clean: // just another fancy thing No I want to declare a macro all: which include (or call) the macros above. The following thing doesn't work: all: pdf: clean: I don't want to repeat the code from pdf: and clean: in order not to rebel agains...

make include directive and dependency generation with -MM

I want a build rule to be triggered by an include directive if the target of the include is out of date or doesn't exist. Currently the makefile looks like this: program_NAME := wget++ program_H_SRCS := $(wildcard *.h) program_CXX_SRCS := $(wildcard *.cpp) program_CXX_OBJS := ${program_CXX_SRCS:.cpp=.o} program_OBJS := $(program_CXX_OB...

Make errors - can the gcc compiler warnings prevent a C file from being compiled into an object file?

I'm trying to compile a wireless network card driver for my Linux box and I ran into a problem with the Make command. During the compilation process I normally see warnings on some of the C files that being are compiled; despite the warnings these files were still able to be compiled to an object file. When the Make process comes to a f...

Looking to reimplement build toolchain from bash/grep/sed/awk/(auto)make/configure to something more sane (e.g. boost.build, etc)

I currently maintain a few boxes that house a loosely related cornucopia of coding projects, databases and repositories (ranging from a homebrew *nix distro to my class notes), maintained by myself and a few equally pasty-skinned nerdy friends (all of said cornucopia is stored in SVN). The vast majority of our code is in C/C++/assembly ...

Mulitple lines in make

I am trying to store a multiline string in a variable in make var=$(shell cat <<End-of-message \ -------------------------------------\ This is line 1 of the message.\ This is line 2 of the message.\ This is line 3 of the message.\ This is line 4 of the message.\ This is the last line of the message.\ -----------------------------------...

How do I build SDL_TTF?

Okay, so I'm on Windows Vista, and I want to use SDL_TTF, but the idiots who made it decided you have to build everything from source, so I to build the .lib files and all that other stuff, but I'm on Windows, so how am I suppose to do this? ...