General :: Writing Else If Condition In Makefile?

Mar 18, 2010

I need to write an else-if condition in a makefile, and though the format is posted on several websites, nothing seem to be working, andI get an error everytime. Could anybody please write a small example with an else-if conditional in a maekefile?

View 1 Replies


Slackware :: Makefile:535: /usr/src/linux- No Such File Or Directory

May 31, 2010

I just downloaded slackware 13.1(x86) and i'm trying to compile ndiswrapper-1.56 using the slackbuild from and i'm getting this error:


Makefile:535: /usr/src/linux- No such file or directory
make[2]: *** No rule to make target `/usr/src/linux-'. Stop.
make[1]: *** [modules] Error 2
make: *** [all] Error 2

looks like the folder i486 doesn't exist

View 2 Replies View Related

General :: Grep - Filtering Output By OR Condition

Aug 13, 2010

Is there some way to filter output of command by OR condition in Linux? There is filtering by AND condition with grep in way like:
ls -l | grep "^a" | grep "z$"

That says: list all files that beggins with "a" AND ends with "z" (so there is shorter way to write this: grep "^a.*z$", but it is not matter). Is there some way to perform test by OR condition? For example: files that starts exactly with "xen" OR files that ends exactly with ".rpm". But exactly, not something like:
grep "[xen]{0,3}.*[.rpm]{0,4}"

View 2 Replies View Related

General :: Command Line - Recursive Rm With Condition?

Mar 13, 2011

I have the following folder structure:

- folder1
- main1.x
- main1.y


So, how can I achieve this?

View 2 Replies View Related

General :: Put ELSE For Condition Block Of Procmailrc Recipes

May 2, 2011

How can I have ELSE condition in procmailrc I mean if the mail was from X and Subject has Y OR .... DO something ELSE DO SOMETHING ELSE. I do not want to use two different conditions for each state I want use just one condition and its ELSE because putting too recipes in procmailrc make it too slow .

View 2 Replies View Related

General :: Syntax Error In Shell Script While Using If Condition?

May 28, 2011

I am writing a simple shell script where it checks the condition using if condition.

if [ $name == "JOHN" ] then admin='YES'; fi
if I use like this I am getting below error


View 1 Replies View Related

General :: Use A Global Variable To Apply A Condition Within A Script

Feb 28, 2011

I'm trying to use a global variable to apply a condition within a script.

The idea is to use this variable set to e.g. 1 or 2 to run a different part of the script accordingly. I can set the global variable with e.g.

export WL0=1

run my part of script, increment it by 1 with e.g.


but if I re-run the script my WL0 is still set to 1!

I've also tried to add an

export $WL0 at the very end of my script (after the math) but this doesn't change the global variable apparently.

View 15 Replies View Related

General :: Remort Loging - Check For A File Existince And Display A Message - If Condition

May 31, 2010

I want to ssh and check for a file, I hve came up with following, and its not working,

Is this possible or do I have to do this in a another way.

View 5 Replies View Related

General :: Debugging A Makefile ?

Feb 24, 2011

Is it possible to debug a makefile? In a bash script I can use "set -x" so that all variables are shown with their values. I am looking for such feature in makefile to see the variables and their values.

View 2 Replies View Related

General :: What Is Purpose Of Makefile In Nis Server

Aug 17, 2010

can anybody tell the use of make file in Nis server.

View 1 Replies View Related

General :: Why Some Makefile Is Missing After ./configure

Sep 1, 2010

I have encountered some cases that the ./configure log says:

config.status: creating xxx/Makefile

but when make fails on:

make[2]: Entering directory xxx
make[2]: *** No rule to make target `all', Stop

and xxx/Makefile is absent in the disk. Why does it happened?

View 1 Replies View Related

General :: Can Source Filename Be Used In Makefile

May 7, 2010

in directory a_dir, have a file named a_file.i can type "source a_file" under directory a_dir and execute successfully.but if i write the command to a Makefile under directory b_dir, the "source" function can't be executed well. it will generate some error message like this:

./a_file: line 1: setenv: command not found
./a_file: line 2: setenv: command not found
./a_file: line 3: setenv: command not found
./a_file: line 5: setenv: command not found

View 3 Replies View Related

General :: How To Write Non Recursive Makefile

Dec 14, 2010

I want to write simple non recursive makefile, but I am not getting syntax of it. Please give me example with simple description. I had read docs, html's but I am not getting how that works please give simple example. consider I have following directory structure.


View 1 Replies View Related

General :: Use Make And Makefile To Compile And Link Some .cpp/.h

Sep 20, 2009

I've been trying to figure out how to use make and makefile to compile and link some .cpp/.h. All i seem to find on google says to read the README for the software. But this is my own created c++ project. Im just looking for a simple makefile for my own .cpp/.h files( about 20 total).

I have tried using 2 different makefile "examples" as a template, but neither worked. I am getting error saying "file1.cpp: no newline character at end of file". or something to that degree.

View 5 Replies View Related

General :: Call Makefile From Shell Script

Apr 12, 2011

I can find all kinds of information on calling a script from a makefile but not the other way around.I'm writing a VERY basic shell script, and I need to call a makefile located in a directory lower than the shell script but can't seem to figure it out../dir/make and ./dir/makefile don't work.

View 2 Replies View Related

General :: Make Rules In A Makefile - Debug

Nov 17, 2009

Does anyone know if it is possible to make rules in a Makefile that would work like this:

> make debug module
> make module debug

where module can be any module that has a specific rule in the Makefile.

The thing I have is a Makefile with different rules that I compile like this:

> make module

What I would like is to add an option so I can compile whichever module with debug-information just by adding a debug to the make command. The debug-information I know how to do, the problem is how to make the Makefile work...

View 2 Replies View Related

General :: Compile Multiple File Using Makefile ?

Jun 1, 2011

How to compile single file in Linux environment using gcc. Now i dont know how to use make file to compile multiple file.

View 5 Replies View Related

General :: Set Runtime Library Path In Makefile?

Jun 9, 2010

I would like to set run time library path in my makefile, so that my exe should search run time libraries in that path when executed. How to set this in makefile?

View 3 Replies View Related

General :: Errors - After Editing Makefile In Line 880

Apr 6, 2010

I want to install pgplot on ubuntu 9.10 but I have some errors after editing makefile in line 880

replaced "pndriv.o : ./png.h ./pngconf.h ./zlib.h ./zconf.h" by
"pndriv.o : /usr/local/include/png.h /usr/local/include/pngconf.h /usr/local/include/zlib.h /usr/local/include/zconf.h"
and running code "make" I get this error :
No rule to make target `/usr/local/include/png.h', needed by `pndriv.o'. Stop.
also I tried to uncomment this line got another error :
make: *** [pndriv.o] Error 1
and also replace "pndriv.o : ./png.h ./pngconf.h ./zlib.h ./zconf.h" by "pndrive.o : "
what should I do ?

View 14 Replies View Related

General :: Makefile - Unable To Create For The Ones That Do Involve Database

Nov 23, 2010

I am new to creating make files. I have been able to create simple makefiles for those applications which do not involve database but am unable to create for the ones that do involve database.

That's how my make file looks




There is no error in the code because when I compile the code through the following command, it gives me no error


The error msg is:


Where am I going wrong? Am I not providing the correct mysql path?

View 4 Replies View Related

General :: Make Install Error With Created Makefile

Jun 3, 2011

I am new to Linux and I am trying to install a C program from source using Makefile. So I 've created a "hello world" program and then a Makefile to install it. Then I logged in as root and used
make install

The following error occurs:
make: execvp: /usr/bin: Permission denied
make: *** [install] Error 127

Here is the Makefile:
CFLAGS=-c -Wall
PROGS = hello
INSTDIR = $(prefix)/usr/bin/

all: $(PROGS)
$(PROGS): main.o
$(CC) main.o
main.o: main.c
$(CC) $(CFLAGS) main.c
rm -rf $(PROGS) *o $(PROGS)
So, where are the errors

View 3 Replies View Related

General :: Using Makefile - 'Multiple Definition' Compile Errors

Mar 1, 2011

As part of an assignment, our class was given a small set of c++ classes which are compiled using a makefile. As part of the assignment, I have created a namespace and saved in it a .cpp file. The functions, constants and typedefs from the namespace are now used in one of the original files, and so I added an <#include MyFile.cpp> to the file I modified, in addition to a using MyNamespace;

When I try to use the original makefile, the compiler gives a lot of errors about multiple definitions of every function in the namespace. What do I need to do to resolve this? Do I need to change the makefile or one of the files themselves? I am new to Linux programming and makesfiles.

View 2 Replies View Related

General :: Compile Multiple Source Using Single Makefile In ECos?

Jun 3, 2010

I'm calling a function defined in "uart.c" from "main.c"

But on "make" using cygwin bash, it's giving an error:"Unreferenced function"...
Pls help me to overcome this problem.

If i'm putting the definition of that function in "main.c" itself, its working.

So pls tell me how to write the make file for it?

View 4 Replies View Related

General :: Makefile - Break Out The Compilation Into Individual Gcc Commands For Each C File

Apr 28, 2010

I have ~200 c files in my makefile[$(SRCS)], and it compiles all of the files using a single gcc command. So each time I make a change in one c file, it ends up re-compiling all the files, then linking to make the
binary. How can I break out the compilation into individual gcc commands for each c file, so that make checks the timestamp and accordingly compiles only the modified files.

My current Makefile looks like this.


View 5 Replies View Related

Programming :: Suspend Pthreads Without Condition

Jun 29, 2010

I just started with Pthreads and don't really know much about it. I want to suspend pthreads but apparently, there is no such function as pthread_suspend. but I don't understand why we need both mutex and condition to suspend and resume a pthread. Is it possible to suspend and resume it without using conditions?

View 1 Replies View Related

Programming :: Awk: Swap Fields Given A Condition?

Oct 8, 2010

I have a file records as follows:

Jane John

How can I get that always first field be given name and second one be the mail address?

I've tried


awk '$1 ~ /@/ { a=$1 ; $1=$2; $2=a; print }' file

But that doesn't worked

View 5 Replies View Related

Programming :: Iptables Script With For Condition?

Apr 28, 2010

i have a question regarding the use of a statement, like following, in a iptables script.

MACS=$(grep -Ev "^#" $BLOCKMAC)


View 2 Replies View Related

Programming :: Update A Line Using AWK With Condition?

Jun 18, 2010

i have a host file called myhosts.txt as follow:

Quote: host1 host2 host3


In my script, i am using NSLOOKUP to get the ip address of a host that just rebooted and connected to my network (this part has been done).But now i want to check the myhosts.txt file if the host has the same or different IP address, if is different then myhosts.txt file must be updated with the new IP.i am using the following AWk command:


awk '/host4/{$1=val}{print}' val= /tmp/myhosts.txt

it prints on screen fine and i see the host4's ip address gets replaced but the actual file does not get updated with the new IP. I might need to use gsub?

View 11 Replies View Related

Ubuntu Installation :: Difference Between "makefile" And ""s

Jan 4, 2010

I'm installing a package but that package doesn't has "makeFile" file, it only has "" and "". therefore when ever i use the "make" command i get: "make: *** No targets specified and no makefile found. Stop."

View 2 Replies View Related

Fedora :: F15 Maintenance For Fast And Furious Condition

Jun 19, 2011

When I used windows, I used to perform following operations on regular basis:
1) disk cleanup
2) disk defragmentation
3) virus/spyware/malware check
4) deleting temp files left by deleted files
5) and many more.......
Does Linux system needs that to be done too? What should be done to maintain Linux in fast & furious it is now.....

View 10 Replies View Related

Copyrights 2005-15, All rights reserved