473,383 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Reduce Dependency ?

I'm compiling a huge(900 files ) embedded application written in C .
Over a period of time , the code has developed a lot of inter crossed
dependenc. The current scenario is , i make a change to one header file
, it begins to compile all the .c files in the project.
Is there a tool/algorithm to remove all the unecessary
dependency ? How do i clean up my code ?

Any help in this regard is highly appreciated.

Feb 14 '06 #1
3 1816
In article <11**********************@f14g2000cwb.googlegroups .com>,
<pr**********@gmail.com> wrote:
I'm compiling a huge(900 files ) embedded application written in C .
Over a period of time , the code has developed a lot of inter crossed
dependenc. The current scenario is , i make a change to one header file
, it begins to compile all the .c files in the project.
Is there a tool/algorithm to remove all the unecessary
dependency ?


This is outside of the C standard itself, which does not talk much
about how compiling actually happens.

On Unix-type systems there is often a command named something like
"makedepend". It fishes through the given set of source files and
builds a hierarchy of dependancies, and writes that out in Makefile
format. Most of the time you can set it up so that the Makefile
itself is updated, so that you can

make depends

and it updates the Makefile so that the build goes properly.
Some compilers (SGI IRIX I know; gcc 3 + if I recall correctly) have
this or similar facilities built right into the compilers, so it can
automatically update the configuration file during the compilation phase
itself -- usually quite efficient since it is already looking at all the
source.
--
Okay, buzzwords only. Two syllables, tops. -- Laurie Anderson
Feb 14 '06 #2

<pr**********@gmail.com> wrote
I'm compiling a huge(900 files ) embedded application written in C .
Over a period of time , the code has developed a lot of inter crossed
dependenc. The current scenario is , i make a change to one header file
, it begins to compile all the .c files in the project.
Is there a tool/algorithm to remove all the unecessary
dependency ? How do i clean up my code ?

Any help in this regard is highly appreciated.

It is probably cross-compiled on a compiler that runs on a PC.
So buying a faster PC might be the easiest solution.

Really you need to restructure the code by going through each file one by
one, and reorganising it, placing functions in a pyramid, with as few as
possible at the top depending on everything else, and as many as possible
lower down depending only on the standard library.

However this will be a huge job. I think there might be tools that can help
you, but in the nature of things it cannot be automated.
Feb 14 '06 #3
On 14 Feb 2006 13:52:08 -0800, pr**********@gmail.com wrote in
comp.lang.c:
I'm compiling a huge(900 files ) embedded application written in C .
Over a period of time , the code has developed a lot of inter crossed
dependenc. The current scenario is , i make a change to one header file
, it begins to compile all the .c files in the project.
Is there a tool/algorithm to remove all the unecessary
dependency ? How do i clean up my code ?

Any help in this regard is highly appreciated.


I have seen two answers to your question, but I don't think either of
them answers the question that I think you are asking.

A dependency tool, or the dependency generation option of some
compilers, merely lists the includes in the file, then recursively
checks each included file for more includes, until finally it has
listed every file included in the original source once, no matter how
many levels it is nested.

I don't know of any tool that will automatically remove unnecessary
inclusions, but there is one commercial tool that will identify. Then
you need to edit the source and remove the unnecessary ones by hand.

Check out PC Lint at http://www.gimpel.com. It also does a lot of
other vary valuable things.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Feb 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

226
by: Stephen C. Waterbury | last post by:
This seems like it ought to work, according to the description of reduce(), but it doesn't. Is this a bug, or am I missing something? Python 2.3.2 (#1, Oct 20 2003, 01:04:35) on linux2 Type...
9
by: Kyle Root | last post by:
I'm working on a little practice program, but I've become stuck and am now utterly confused :? I've created a jumble of python modules, in each one is a tuple that goes something like, deps =...
2
by: Chris Capel | last post by:
Say ... does anyone know of a good (perhaps free) .NET assembly dependency walker? Because when you have a project A with a reference B which is also a reference of C, and C is also a reference of...
0
by: Michael R. Pierotti | last post by:
Has anyone seen this error before when trying to make the install on a program. ------ Starting pre-build validation for project 'HafaSMPPInstall' ------ WARNING: Unable to find dependency...
5
by: Jay A. Moritz | last post by:
Error: The dependency '<my dll>' in project '<my project>' cannot be copied to the run directory because it would conflict with dependency '<my dll>'. I am getting a dependency error building...
3
by: DJTN | last post by:
I'm getting the following error when I try to compile my setup project in VS 2002. I have re-installed the .net framework 1.1 and it didnt solve the problem. WARNING: Unable to find dependency...
9
by: Brett Romero | last post by:
I have two projects in one solution - a library and executable. Each have a namespace such as: ROOT.myapp.Functional ROOT.myapp.UI However, each cannot reference the other. myapp.UI is...
1
by: =?Utf-8?B?SmFzb24gUmljaG1laWVy?= | last post by:
I came across a code sample in a book that I am reading that uses a dependency property. I looked at some of the documentation for dependency properties but, for some reason, the concept is not...
1
by: vincentt | last post by:
Hi, We code DLL's and so far it was done using VS6.0. We are planning to migrate the VS.NET 2005 and use the VS6 VC++ code which generated the DLL to VS 2005 VC++.NET. However we donot plan to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.