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.

[Code]...

View 1 Replies


ADVERTISEMENT

Programming :: Make Recursive Makefile Work?

Jun 8, 2011

I'm trying to make recursive makefile work but it's giving me two problems. I have a top folder with the main Makefile and one Makefile for each sub folder 'one' and 'two'. Makefile in subfolder 'one' and 'two' are identical. The top Makefile (still a bit messy) looking like this:

Code:
# Directories
CC = gcc
CFLAGS = -Wall -Wextra
TARGET_DIR = bin
MAIN_FILE = one.c

[Code]...

View 4 Replies View Related

Programming :: Compiling Recursive Makefile In Directory Structure

May 18, 2011

I'm having problems with compiling recursive Makefiles in my directory structure:
My folder layout is:
top/|- one/|- one.c (With main function)|- zero.c|- two/|- two.cin my top folder the make file looks like:

Code:
MAKE_DIRECTORIES = one two
.PHONY: all
all: $(MAKE_DIRECTORIES)

.PHONY: $(MAKE_DIRECTORIES)
$(MAKE_DIRECTORIES):
@echo $@
$(MAKE) --directory=$@
in my one and two folder I have the following Makefile:

Code:
.PHONE: all
all:
@echo $@
$(CC) $(CFLAGS) *.c
But when I compile it from top folder: make

I get following output:
Code:
one
two
Which states that directory statement by echo in main Makefile is ok but the files are not compiled in one and two.

View 5 Replies View Related

General :: Recursive Write Permission On Cifs Mounted File System

May 14, 2010

I have mounted a iomega file system on a cetos os machine using

mount.cifs //filserver-ip/directory /home/my-home/mounted-file -o
user=username

(** mounted as root) The mounting works fine.

The problem arises when I try to create a sub-directory inside the mounted directory. All the newly created sub directories become write protected.

I am accessing this file system from R software and it needs to write/create directories in side this mounted directory.

how can newly created sub-directories will become automatically writable, so that R can create new sub-directories and write data inside those directories.

View 2 Replies View Related

Programming :: Write A Makefile For CUDA/C++ Code?

Jun 19, 2010

I'd like to write a Makefile for my CUDA/C++ code but I didn't know how things work with CUDA, I mean there is a nvcc compiler but I don't know what I've got to do with this.
Do I have to firstly run nvcc and then g++ or only nvcc to compile my CUDA/C++ code ? I found nothing on the web explaining such basic things .

View 1 Replies View Related

Slackware :: Makefile:535: /usr/src/linux-2.6.33.4/arch/i486/Makefile: 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 slackbuils.org and i'm getting this error:

Code:

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

looks like the folder i486 doesn't exist

View 2 Replies View Related

General :: Command Line - Recursive Rm With Condition?

Mar 13, 2011

I have the following folder structure:

parent
- folder1
- main1.x
- main1.y

[Code].....

So, how can I achieve this?

View 2 Replies View Related

General :: Recursive String-search In Files?

Oct 28, 2009

find out a command to search among all *.dat files in a certain path (including subdirectories) looking for the following text in them:

Code:

--------------------------------------------------------------------------------
Elements with small area
Element Adjusted nodes
--------- --------------
16294 NO
17889 NO

and getting the list of elements with small area printed in a file "ErrorEl.txt". The output should have this form:

"/path/01/A.dat
bad-el#01
bad-el#02

[code]....

I know already how to find out the dat files containg a certain string

Code:

c=/path/
grep -R --include="*.dat" "Elements with small area" $c | cut -d: -f1>> ErrorEl.txt

but I don't know then how to get the element numbers(16294 and 17889 in the example above)

View 11 Replies View Related

General :: Recursive Delete Specific Files From Sub-directories?

Mar 4, 2011

I would like to be able to recursively delete specific various files from a directory and sub-directories. For example:

Dir/
|_sub1/
|
|_ _rm *file1 *file2 *file3

[code]....

View 11 Replies View Related

General :: Recursive Searching Files In Directory Matching Given Name?

Apr 16, 2010

I am writing a shell script that finds all files named <myFile> in a directory <dir> or any of its subdirectories, recursively. I also need to take care of symbolic links that may form cycles, to avoid infinite loops. I am not supposed to use find command for the same

I started writing the code but got stuck. I thought using recursion may be a smart way, but its not working.

Code:
#!/bin/sh
findFiles()
{
thisDIR=$1
#cd $thisDIR
code....

View 5 Replies View Related

General :: Recursive Filesystem Notifications (inotify) For Karmic Koala?

Mar 11, 2010

I need a program which generates events when a file is moved, removed or its extended attributes are changed. I'm running Ubuntu Karmic Koala 32-bit desktop.inotify is the standard solution for such problems, but inotify cannot install a recursive watch, so the only option is to the equivalent of find on the filesystem, and add an inotify watch on each node. This is what e.g. inotifywatch does. This won't work for me, because my filesystem has 1 million files, and installing watches to all of them takes forever.

fanotify could work except that I would have to patch the kernel for that (I'm currently running 2.6.31-20), and maintaining patches to the Linux kernel is beyond my time commitment.I used to use rfsdelta (whose kernel module is similar to rlocate), but it just doesn't compile on 2.6.31, because it uses obsolete Linux security framework APIs.

View 1 Replies View Related

General :: Recursive Search For Files That Hold Some Specific Text?

Jan 18, 2011

How do I recursively generate a text file which has a list of all files on my server which contain a specific string anywhere in the files?

I know the following command can be used to replace a string recursively

find /var/www -type f -print0 | xargs -0 sed -i 's/old string/new string/g'

I do not want to replace the string, I just want a list of all files which contain the string.

View 4 Replies View Related

General :: Make A Cronjob Who Makes A Tag.gz Of Everything Inside A Directory In A Recursive Way?

Mar 23, 2011

I would like to make a cronjob who makes a tag.gz of everything inside a directory in a recursive way. BUT there is a HUGE directory full of jpg's. I don't want this one in the backup.Additional points if it can backup symbolic links.

View 2 Replies View Related

General :: Cp -ru -> Using The Recursive Copy And Update From Internal Drive To A Mounted Nas

May 4, 2011

I've mounted my NAS drive under the /media/ directory. I've copied a bunch of files from my current /var/www directory, using cp -Rpv (preserve). Now I want to do a cp -Rup /var/www/ /media/magneto/testing.cdw/ Based on the fact that these are two different file systems, i.e. one is a networked NAS connected through Samba, and the other is my computers internal drive. Will I run into problems with the date and time? how can I check before I run the copy?

View 4 Replies View Related

General :: Finding A Recursive Shell Or Perl Script To Delete Files With The Same Name As The Parent Folder?

Jun 29, 2010

is there a recursive shell or Perl script to delete files with the same name as the parent folder? i wish to include the starting folder name as argument to the script.

View 2 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 :: Write A Shell Script Which Will Simultaneously Collect OS User Information And Write In An Individual Text Files?

Feb 17, 2010

I want to write a shell script which will simultaneously collect OS user information and write in an individual text files.Can anyone tell me the syntax of the script.N.B. The user name will be mentioned in an array within the shell script.

View 8 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 :: 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 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
or
> 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

Code:

clean:

tar:

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

Code:

The error msg is:

Code:

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:
CC=gcc
CFLAGS=-c -Wall
PROGS = hello
INSTDIR = $(prefix)/usr/bin/
INSTMODE = 0755
INSTOWNER = root
INSTGROUP = root

all: $(PROGS)
$(PROGS): main.o
$(CC) main.o
main.o: main.c
$(CC) $(CFLAGS) main.c
install:$(PROGS)
$(INSTALL) $(INSTDIR)
$(INSTALL) $(INSTMODE) $(INSTOWNER) -o $(INSTGROUP) $(PROGS) $(INSTDIR)
clean:
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







Copyrights 2005-15 www.BigResource.com, All rights reserved