> At Thu 7/27/2000 4:35 AM, Anthony Stone wrote:
> Probably a more reliable method would be to invoke a recursive make
> for each module, which would force make to re-evaluate the
> dependencies. They would still need to be listed in the right order.
>
> Anthony's solution has been very beneficial in preventing unnecessary
> compilations in our large project. Due to the environment in which we
> build
> our applications, we had to write a program to generate:
> 1) A list of module object files in the correct order of compilation
> 2) A makefile that is invoked recursively, as Anthony mentioned above.
>
> Some other problems that we encountered are:
>
> SGI .mod Naming Convention
> We run on multiple UNIX platforms (IBM, SGI and Sun). SGI's compiler's
> .mod
> files are generated with the module name in upper case, while IBM and Sun
> generates them in lower case. For example, when a module called "stuff",
> is
> compiled the following files would be generated:
>
> IBM (XL) and Sun (SunSoft and Fujitsu):
> stuff.o
> stuff.mod
> SGI:
> stuff.o
> STUFF.mod
>
> This means that we have to use different object file dependency lists on
> the
> SGI platform, for example:
> IBM (XL) and Sun (SunSoft and Fujitsu):
> suba.o: suba.f stuff.mod
> SGI:
> suba.o: suba.f STUFF.mod
>
> This is handled by the same program that generates the recursive makefile.
>
> We also have to handle the SGI upper case names when saving, comparing and
> restoring .mod files. The Bourne shell, in which GNU Make executes
> commands, does not have a built-in capability for changing case, but the
> Korn Shell does have that facility. So, we resolved this issue by using a
> Korn shell script wrapper to do the moving, comparing and restoration
> steps.
> The following GNU makefile segment shows how we do this, where MODULEOBJS
> is the list of the Modules to be built in the correct order of
> compilation:
>
> $(MODULEOBJS): %.o: %.f
> @ $(PROJECTDIR)/sbin/savemod $*
> $(FC) $(FFLAGS) -c $< -o $@
> @ $(PROJECTDIR)/sbin/restoremod $*
>
> GNU Make Assumption about the .mod File Extension
> When using this Make scheme, files with the .mod extension are never
> listed
> in targets. Since GNU Make assumes that files with the .mod extension are
> Modula program source files, we had to override that assumption. We are
> currently using:
>
> %.mod :
> @touch $@
>
> When the project is initially built, this has a side effect of creating
> empty .mod files, which end up unnecessarily being renamed, compared and
> then discarded. However, since they are empty, this takes place very
> quickly and it only occurs for the initial build.
>
> IBM .mod Files Contain a Time Stamp
> IBM's Fortran adds a time stamp to the end of their .mod files, so they
> always show up as different when using "cmp". We had to write our own
> compare program to handle this. The time stamp comes after the string
> "@(#)Module", so it is easy to find; however, if IBM changes this at some
> later date, then we will have to change our compare program.
>
> There may be better solutions, but this one does work well for our very
> large project.
>
> Ms. Beverly K. Pope
> Chevron Petroleum Technology Co., Reservoir Simulation Support Team
> 2811 Hayes Rd., Houston, TX 77082
> email: [log in to unmask] phone: (281) 596-2314
>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|