makefiles in a directory and subdirectories


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers makefiles in a directory and subdirectories
# 1  
Old 10-28-2005
makefiles in a directory and subdirectories

I need to develop a makefile that spans across directories. For example, let's say i have an upper level directory (main) and about 2 subdirectories. I want my .cpp files and .o files to be in one subdirectory. I want my .a files to be in the other subdirectory. The .a files are made up of the .o files in the other subdirectory. Does anyone know how to do the makefiles for this? I can have a makefile at each subdirectory and then one in the upper level directory. I would like to use VPATH for this is possible. Sorry if this is confusing, I am rather new to Linux. Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help on Backing up all the files in the subdirectories under a parent directory

Hi, I am not too familiar with Unix scripting but I have to write code to find all the files under all the sub directories under a parent directory of unix location and move them to the corresponding Windows location. For eg: I have \home\sreenu\Files\ Under neath this I have multiple sub... (3 Replies)
Discussion started by: raj.sreenu
3 Replies

2. UNIX for Dummies Questions & Answers

recursive copy into a directory and all its subdirectories...

I want to copy a file from the top directory into all the sub-folders and all of the sub-folders of those sub-folder etc. Does anyone have any idea how to do this? Thanks in advance of any help you can give. (3 Replies)
Discussion started by: EinsteinMcfly
3 Replies

3. Shell Programming and Scripting

Find files only in current directory...not subdirectories

Hi, I have to find files only in the current directory...not in the sub directories. But when I use Find command ... it searches all the files in the current directory as well as in the subdirectories. I am using AIX-UNIX machine.Please help..I tried to use maxdepth..but it is not working in AIX. (2 Replies)
Discussion started by: vsachan
2 Replies

4. Shell Programming and Scripting

Copying subdirectories of a directory to some other directory and renaming them

Hi, I am a newbie in shell scripting. I have to copy a particular sub-directory (data) from a large no. of directories (all in the same folder) and paste them to another directory ( /home/hubble/data ) and then rename all the subdirectories (data) as the name of its parent directory. please... (8 Replies)
Discussion started by: sholay
8 Replies

5. Shell Programming and Scripting

Find directory name while traversing subdirectories

Hi, I have a parent directory in which I have sub directories of different depth /usr/usr1/user2/671 /usr/usr1/672 /usr/user2/user1/673 /usr/user2/user3/user4/674 And I need the names of all the directories that which starts only with 6 in a file. Thanks, (12 Replies)
Discussion started by: arun_maffy
12 Replies

6. Shell Programming and Scripting

Bash: Gzip files in Directory and itīs Subdirectories

Hello dear Community, I have a task to wrtie a script which will gzip not zipped files in a directory and itīs subdirectories. I succeeded in gzippung the directory but not the subdirectories: #/bin/bash #go to the directory where to zip cd $1 #Zip unzipped files for i in `ls | xargs... (2 Replies)
Discussion started by: JamesCarter
2 Replies

7. UNIX for Dummies Questions & Answers

Find Files in a Directory Excluding Subdirectories

Hi, I have a filename Location.txt in a directory /abc. Similar name file is present in its subdirectory /abc/xyz. I want to find the file which is present only in /abc and not in /abc/xyz. Please any1 of u can provide a quick suggestion. Its very urgent. Thanks, Amol (2 Replies)
Discussion started by: Amol_Dicholkar
2 Replies

8. UNIX for Dummies Questions & Answers

How to remove directory with subdirectories and files?

I'm trying to remove several directories which contains sun-dirs and files inside. I used the command rm -r <dirname> But, it always ask "examine file in directory <dirname> yes/no?" line by line. So, i need to write "y" for every line. How can i skip this step and remove all directories with... (9 Replies)
Discussion started by: ppa108
9 Replies

9. Shell Programming and Scripting

search files in a directory and its subdirectories

Hello my friends, I need to write a simple shell bad file :D that search and delete a file it's name 'Microsoft.txt' in the current directory and its subdirectories? So can you help to guide me how i can write this shell, Just give me the beginning :o thank you. (1 Reply)
Discussion started by: Net-Man
1 Replies

10. Shell Programming and Scripting

How Can I Make Subdirectories In A Directory?

I cant remember how, i use to know but its been like 2 years since ive used shell can anyone help me? (7 Replies)
Discussion started by: kprescod4158
7 Replies
Login or Register to Ask a Question
md(1)							    BSD General Commands Manual 						     md(1)

NAME
md -- process raw dependency files produced by cpp -MD SYNOPSIS
md [-d] [-f] [-m makefile] [-u makefile] [-o outputfile] [-v] [-x] [-D c|d|m|o|t|D] DESCRIPTION
The md command basically does two things: Process the raw dependency files produced by the cpp -MD option. There is one line in the file for every #include encountered, but there are repeats and patterns like .../dir1/../dir2 that appear which should reduce to .../dir2. md canonicalizes and flushes repeats from the depen- dency list. It also sorts the file names and "fills" them to a 78 character line. md also updates the makefile directly with the dependency information, so the .d file can be thrown away (see d option). This is done to save space. md assumes that dependency information in the makefile is sorted by .o file name and it procedes to merge in (add/or replace [as appropriate]) the new dependency lines that it has generated. For time effeciency, md assumes that any .d files it is given that were cre- ated before the creation date of the "makefile" were processed already. It ignores them unless the force flag [f] is given. FLAG SUMMARY
-d delete the .d file after it is processed -f force an update of the dependencies in the makefile even though the makefile is more recent than the .n file (This implies that md has been run already.) -m makefile specify the makefile to be upgraded. The defaults are makefile and then Makefile -u makefile like -m above, but the file will be created if necessary -o outputfile specify an output file for the dependencies other than a makefile -v set the verbose flag -x expunge old dependency info from makefile -D c|d|m|o|t|D subswitch for debugging. can be followed by any of "c", "d", "m", "o", "t", "D" meaning: c show file contents d show new dependency crunching m show generation of makefile o show files being opened t show time comparisons D show very low level debugging SEE ALSO
make(1) BUGS
Old, possibly not used by anyone. HISTORY
The md utility was written by Robert V Baron at Carnegie-Mellon University. BSD
June 2, 2019 BSD