makefile

Make: Setting variable based on target

Hi, I want to set a variable depending on the assigned target. For instance: if target == filename_a then VAR1 = YES if target == filename_b then VAR2 = YES Obviously, this is pseudo-code and not proper make-syntax. What I really want to do is to include different make-files and include-directories dependent on target. Some targ...

What does make use a *.d file for and why does Eclipse CDT hate me?

Possible Duplicate: Very simple application fails with multiple target patterns from Eclipse Within Eclipse CDT I build a C++ project composed of one source file, program.cpp. The only thing remotely complicated is that it links to an external library. The build is successful, but when I click the Run button I get the follow...

Argument list too long. Building Hubbub HTML Parsing Library. execv

When I attempt to build this library on my system (Fedora) Linux localhost.localdomain 2.6.33.8-149.fc13.i686 #1 SMP Tue Aug 17 22:45:56 UTC 2010 i686 i686 i386 GNU/Linux I get a long list of errors of which this is the last few lines: build/makefiles/Makefile.top:542: warning: overriding commands for target `build-Linux-Linux-releas...

What is an efficient workflow with C? - Makefile + bash script

I'm working on one of my first projects that will span more than one C file. For my first couple practice programs, I just wrote my code in main.c and compiled using gcc main.c -o main. This worked for me as I was learning. Now, I'm working on a much bigger project on my own. I want to continue doing compilation on my own (or at least s...

Problem with my makefile

I think I have a problem with my makefile. I'm writing this program: Q2.cpp contains the main. Agent.cpp Agent.h Timing.cpp Timing.h RandomDouble.cpp RandomDouble.cpp And I'm using the header randoma.h in RandomDouble.cpp. I downloaded the randomaelf64.a file and I wrote this makefile: Q2 : Q2.o Agent.o Timing.o RandomDouble.o ...

Problem with makefile

hiii , i just started studying makefiles and wrote the following one for a simple hello.c file. it shows some error saying : makefile1:5: * missing separator. Stop. What is the wrong here ... ? CC=gcc CFLAGS=-c -Wall hello: hello.c $(CC) $(CFLAGS) hello.c -o hello clean: rm -rf *.o And , Is it always a ...

Problem with my makefile

I have this Makefile and each line run OK separately, but when I do make I get this error: make: *** No rule to make target `CoalitionManipulation‬‬.cpp', needed by `CoalitionManipulation‬‬.o'. Stop. But I can see the CoalitionManipulation.o file, it means it exists! Bere is the makefile: CoalitionManipulation‬‬ : ‫‪CoalitionManipul...

resolve Makefile wildcard % inside shell function

hi, it seems that make doesn't resolve the wildcard character % before calling the shell function, in cases like this one: %.exe: $(shell cat %.txt) gcc $? -o $@ if I type this on the shell: $ make test.exe the shell complains that it cannot find "%.txt," but I was expecting it to find "test.txt". is there anyway to workaroun...

If my makefile rule changes directories, does it need to change back before finishing?

If I have a rule in my makefile like this: subdir/object: cd subdir && do_stuff_to_build_object Do I need to add && cd .. to the end of the rule, so that make ends up in the same directory at the end of running it as it started? Or does make run the rule in a subshell or otherwise shield itself from things like changing directorie...

Eclipse CDT created makefile cannot "clean" on Windows

Hi, I have a makefile project with makefiles generated by Eclipse CDT (Helios, MinGW). The "clean" command does not work because the "del" command is executed with arguments like ./src/myfile.o, but on Windows this doesn't work (should be .\src\myfile.o). How can I either tell Eclipse to use the Windows Path Separator or otherwise may...

Can a Makefile target invoke commands even if a prerequisite fails?

Here's a skeleton Makefile just to make it easier to describe the problem: all_tests : unit_tests other_tests_1 other_tests_2 ... other_tests_N unit_tests : set1_summary.txt set2_summary.txt ... setN_summary.txt %_summary.txt : %_details.txt perl createSummary.pl --in $^ -out $@ %_details.txt : test_harness ./test_harness --t...

Automatic dependency tracking with NMAKE

Is possible to detect automatically source dependency in a NMake makefile using VS 2005 compiler (as actually possible with GNU make and GCC compiler)? Look at the '-M' option of GCC. Including the outputted text of GCC in the makefile cause to automatically track source dependencies without maintaining them, since the GCC invocation ca...

Kernel Module Make file problem

Hi, This is the first time I am trying to build kernal module. Following is make file. On running make command. I get the error /bin/sh: Syntax error: "(" unexpected make: * [all] Error 2 obj-m =mod.o obj-m +=depmod.o obj-m +=mod1.o obj-m +=mod2.o obj-m +=mod3.o KDIR=/lib/modules/$(shell uname -r)/build all: $(MAKE) -C $...

Building GMP under MinGW - makefile problems

Downloaded and installed latest MinGW yesterday, and GMP 4.3.2 $ ./configure ran just fine. On running make check, The first problem was $ make check makefile:15: *** missing separator. Stop. OK, so, I put the TAB char at the beginning of line 15. Next problem is $ make check makefile:15: *** commands commence before first targe...

How to understand makefiles and python

I'm trying to understand how a makefile works for compiling some .ui files to .py (PyQt -> Python). This is the makefile that I am using that was autogenerated: # Makefile for a PyQGIS plugin UI_FILES = Ui_UrbanAnalysis.py RESOURCE_FILES = resources.py default: compile compile: $(UI_FILES) $(RESOURCE_FILES) %.py : %.qrc pyrc...

Makefile for Eclipse C/C++ in Linux

Hello, i'm using Eclipse 3.6 for C/C++ for Linux. I need to compile existing project with my own working makefile. This makefile works well from the command line, but when I imported my project into Eclipse and try to use Build, it doesn't work, seems that it try to use makefile automatically created by Eclipse. I unchecked the switch "G...

Do you have to jailbreak the iPhone to install Apps compiled by "Makefile"?

I come across some projects, e.g. the Stumbler (which use private framework for WiFi signal strength), the source code does not have the usual .xcodeproj project file. Instead, it has a "Makefile". I searched around and get an impression that I need to use "Toolchain" to compile the "Makefile", and then "SCP or WinSCP" to the iPhone? I a...

Makefile circular dependency

New to the idea of makefiles. Here is my Makefile: .PHONY: all homework1 CFLAGS= -g -O0 -Wall -Werror -Wno-unused-function LDFLAGS= -lm all : homework1 homework1 : program.tab.o program.lex.o %.o : %.c gcc -o$@ -c $(CFLAGS) $< %.lex.c : %.lex %.tab.h flex -o$@ $< %.tab.c %.tab.h : %.y bison --verbose -o$@ -d $< Whenever ...

Makefile variable substitution sometimes ignored

Compiling a CUDA enabled version of aircrack-ng that hasn't been bug-fixed in a while so needed a bit of patching to get most of the way there. Basically, the make cannot find the relevant compiler (nvcc) for this one section of code; Relevent Makefile section ifeq ($(CUDA), true) CFLAGS += -DCUDA_ENABLED NVCC := $(CUDA_BIN)/nvcc IN...

Exiting from a make file if the state of two shell variables are a certain state

So I need to make sure that if I am cross-compiling for a specific target that a shell variable is set. If the variable is not set then make should display a message and then exit. I have the following rule in my makefile: .PHONY: checksource all: checksource default checksource: $(if $(and $(ifeq ($(CROSS_COMPILE), whatever)), ...