Make file optimization


 
Thread Tools Search this Thread
Top Forums Programming Make file optimization
# 1  
Old 02-09-2011
Make file optimization

Hi ,

I need some help on optmizing the make file.
I have the below scenario.

Code:
SOUTHERN_XITEM_PROGS=\
sfmxitem.rel \
sfqxitem.rel
SOUTHERN_XITEM_DEPS= southern_xitem.c

SUPERSVU_XITEM_PROGS=\
su3xitem.rel
SUPERSVU_XITEM_DEPS= supersvu_xitem.c

$(SOUTHERN_XITEM_PROGS) : $$@.o $(SOUTHERN_XITEM_DEPS) $(COMMON_HEADERS) \
        $(XITEM_HEADERS) $(LIB_DEPS) $(XITEM_LIB_DEPS)
        $(CC) $(CFLAGS) $@.o -o $(DEST)/$@ $(LIBS) $(XITEM_LIBS)
        -rm -f $@.o$

$(SUPERSVU_XITEM_PROGS) : $$@.o $(SUPERSVU_XITEM_DEPS) $(COMMON_HEADERS) \
  $(XITEM_HEADERS) $(LIB_DEPS) $(XITEM_LIB_DEPS)
        $(CC) $(CFLAGS) $@.o -o $(DEST)/$@ $(LIBS) $(XITEM_LIBS)
         -rm -f $@.o$

all:$(SUPERSVU_XITEM_PROGS) $(SOUTHERN_XITEM_PROGS)

In the above scenario while am using the make all , all the files are getting updated.But i would like to compile only the modified file.
Can any one help on this?

Moderator's Comments:
Mod Comment Please use [code] and [/code] tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks.

Last edited by zaxxon; 02-09-2011 at 02:57 AM.. Reason: code tags
# 2  
Old 02-09-2011
You just make z out of a.o, b.o, c.o, and a.o out of a.c, so it recompiles a.c and relinks *.o to make z.

If you use a dynamic lib, it can be even simpler, just replace a.o in the lib.

Last edited by DGPickett; 02-09-2011 at 06:41 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Need Optimization shell/awk script to aggreagte (sum) for all the columns of Huge data file

Optimization shell/awk script to aggregate (sum) for all the columns of Huge data file File delimiter "|" Need to have Sum of all columns, with column number : aggregation (summation) for each column File not having the header Like below - Column 1 "Total Column 2 : "Total ... ...... (2 Replies)
Discussion started by: kartikirans
2 Replies

2. Shell Programming and Scripting

Code optimization

Hi all I wrote below code: #!/bin/sh R='\033 do you have any idea how to optimize my code ? (to make it shorter eg.) (11 Replies)
Discussion started by: primo102
11 Replies

3. Shell Programming and Scripting

CPU optimization

hi guys , I have 10 scripts suppose 1.sh , 2.sh ,3.sh ,4.sh ......10.sh each takes some time ( for instance 2 minutes to 40 minutes ) my server can run around 3-4 files at a time suppose, 1.sh , 2.sh , 3.sh are running currently now as soon as ANY ONE of the gets finished i... (4 Replies)
Discussion started by: Gl@)!aTor
4 Replies

4. Shell Programming and Scripting

Script Optimization - large delimited file, for loop with many greps

Since there are approximately 75K gsfiles and hundreds of stfiles per gsfile, this script can take hours. How can I rewrite this script, so that it's much faster? I'm not as familiar with perl but I'm open to all suggestions. ls file.list>$split for gsfile in `cat $split`; do csplit... (17 Replies)
Discussion started by: verge
17 Replies

5. Programming

makeutility: how to get the make-file name inside of the make-file?

How I can get the current make-file name in a make-file So, if I run make with specified file:make -f target.mak is it possible to have the 'target' inside of the that 'target.mak' from the file name? (2 Replies)
Discussion started by: alex_5161
2 Replies

6. Shell Programming and Scripting

sed optimization

I have a process using the following series of sed commands that works pretty well. sed -e 1,1d $file |sed 1i\\"EHLO Broadridge.com" |sed 2i\\"MAIL FROM:${eaddr}"|sed 3i\\"RCPT TO:${eaddr}"|sed 4i\\"DATA"|sed 5s/.FROM/FROM:/|sed 6s/.TO/TO:/|sed 7,7d|sed s/.ENDDATA/./|sed s/.ENDARRAY// >temp/$file... (1 Reply)
Discussion started by: njaiswal
1 Replies

7. Shell Programming and Scripting

AWK optimization

Hello, Do you have any tips on how to optimize the AWK that gets the lines in the log between these XML tags? se2|6|<ns1:accountInfoRequest xmlns:ns1="http://www.123.com/123/ se2|6|etc2"> .... <some other tags> se2|6|</ns1:acc se2|6|ountInfoRequest> The AWK I'm using to get this... (2 Replies)
Discussion started by: majormark
2 Replies

8. Shell Programming and Scripting

script optimization

:o Hi, I am writing a script in which at some time, I need to get the process id of a special process and kill it... I am getting the PID as follows... ps -ef | grep $PKMS/scripts | grep -v grep | awk '{print $2 }'can we optimize it more further since my script already doing lot of other... (3 Replies)
Discussion started by: vivek.gkp
3 Replies

9. UNIX for Dummies Questions & Answers

Help on optimization of the script

Hi, I have prepared script which is taking more time to process. find below script and help me with fast optimized script:- cat name.txt | while read line do name=$(echo $line| awk '{print $8}') MatchRecord=$(grep $name abc.txt | grep -v grep ) echo "$line | $MatchRecord" | awk... (2 Replies)
Discussion started by: aju_kup
2 Replies
Login or Register to Ask a Question