Groups | Search | Server Info | Login | Register


Groups > comp.os.os2.programmer.tools > #5

makefile help

From "John Small" <zjsmallz@os2world.net>
Message-ID <4rkzjBzzMnpe-pn2-u8c6O7dJXUj4@x.y.z> (permalink)
Newsgroups comp.os.os2.programmer.tools
Subject makefile help
Date 2011-06-03 07:29 -0500

Show all headers | View raw


I am trying to help someone transition the build of his software from 
a large set of inter-connected CMD files to an NMAKE v4.00.001 
makefile.

I have succeeded in doing so as far as I can tell. But I'm hoping to 
simplify the makefile.

There are 50 nearly identical description bloacks in the make file. 
The code specifies an OBJ target file, the C source file and other 
dependent (header) files and the commands to execute. All 50 sets of 
code are the same in the following ways: 
- the base names of the OBJ and C files match
- the directories of all the OBJ files are all the same
- the directories of all the C files are all the same
- the commands to be executed, because of my use of special macros, 
are all identical. 
IOW, the only difference between them are the dependent header files.

Since the commands are 11 lines long, I am hoping there are ways I can
condense this code.

I've considered 
- moving the 11 lines into an !include file
- moving the 11 lines into a secondary makefile
- moving the 11 lines into a CMD file

What are the advantages and disadvantages of each? (I'm especially 
interested in how values of macros would be "passed" to the code and 
how return values, especially errors, are returned.) Are there better 
ideas than these?

These ideas would only shorten the command portion of the 50 
description blocks. Is there some way to reduce the number of 
description blocks?

On a related note, the list of dependent header files in at least some
of these description blocks are out of date. What are good ways to 
handle this?

A brute force way would be: If a header file changes, just do a 
complete rebuild. Although crude, time-consuing and requiring 
discipline on the part of the maintainer, it would have the advantage 
of not requiring the header files in the dependents list. This would 
mean, I think, that I could consense the 50 description blocks into 1!

Are there better approaches? 

Are there any tools which will resursively build a list of "private" 
header files used by a source file?

Thanks for any help on either issue!


-- 

John Small

Back to comp.os.os2.programmer.tools | Previous | NextNext in thread | Find similar


Thread

makefile help "John Small" <zjsmallz@os2world.net> - 2011-06-03 07:29 -0500
  Re: makefile help Dave Yeo <dave.r.yeo@gmail.com> - 2011-06-03 19:35 -0700
  Re: makefile help Paul Ratcliffe <abuse@orac12.clara34.co56.uk78> - 2011-06-04 09:35 +0000

csiph-web