brianr@tekig4.TEK.COM (Brian Rhodefer) (07/27/88)
In using Manx' make utility, I keep wishing it were possible to set up a makefile so that compilations use precompiled include files from RAM:, with the makefile automatically creating the precompiled includes. I'm never able to pull it off, though, and have to do the include file by hand. Can anyone suggest a way to achieve total make nirva... I mean, automation? My unfunctional approach: ----> begin makefile excerpt <----- CFLAGS = -n +Iram:precompiled_include OBJS = a_typical_module.o another_module.o result: $(OBJS) ln -g -o result $(OBJS) -lc $(OBJS): ram:precompiled_include ram:precompiled_include: precompiled_include cp precompiled_include ram: # # Note use of `cp' instead of `copy'. # precompiled_include: includes_everything.c cc -O nil: +Hprecompiled_include includes_everything.c ----> end makefile excerpt <----- I've put the `Xcopy' utility (I think that was its name) was posted awhile back in my C: directory, and renamed it `cp'. This gem behaves like `copy' SHOULD've, in that the copy's file creation date is set to the original's. All well and good, except it doesn't work. I can run `make', and (assuming no objects existed), everything happens as I'd expect: the `includes_everything.c' file is compiled to generate `precompiled_include', which is then copied into ram:, and then all the objects are built and finally linked together. *BUT*, if I immediately re-issue the `make' command, it will RE-COPY the `precompiled_include' file to ram:, and RE-COMPILE ALL THE MODULES, even though everything should be `up to date'. A `list ram:' shows that the creation date for `ram:precompiled_include' is indeed the same as that of `precompiled_include', and BOTH are older than ANY of the module.c files. So why didn't make work right? Is this one of those blessings of a `redundant' DOS? Is `make' looking at different file-creation-date information than `list'? Or is there something funny about RAM:? Obviously, this is not an earthshaking problem, but it is a puzzler, and I thought I'd solicit some expertise. Pre-gratefully, Brian Rhodefer ...!tektronix!tekig4!brianr
ain@s.cc.purdue.edu (Patrick White) (07/27/88)
In article <3047@tekig4.TEK.COM> brianr@tekig4.TEK.COM (Brian Rhodefer) writes: >CFLAGS = -n +Iram:precompiled_include > >OBJS = a_typical_module.o another_module.o > >result: $(OBJS) > ln -g -o result $(OBJS) -lc > >$(OBJS): ram:precompiled_include > >ram:precompiled_include: precompiled_include > cp precompiled_include ram: Wow!! hold the phone.. you are writing a dependent rule for file "ram" that depends on precompiled_include on your disk? No wonder it never works. Best thing I can suggest is to write an execute file that copies it up there if it is needed -- and always execute it. slow and sloppy, but you may win over the whole compile. Hmm.. how about: pgm: $(OBJS) execute copypretoram ln ... Then in the execute script file, do something like this: if (not exists ram:precompiled_include) then copy df0:precompiled_include ram: endif This is the best I can do without Manx make in front of me -- you might also be able to put ()'s or quotes arround the ram: file name so the ":" dosen't interfere with make.. something like: pgm: $(OBJS) (ram:pre_inc) ln ... (ram:pre_inc): pre_inc copy rep_inc ram: >So why didn't make work right? because your makefile dosen't check a file in ram, it it copies the file up there to make a file called "ram" up to date... which is never up to date since it dosen't exist. >Or is there something funny about RAM:? a ":" is a ":" to make.. I'll bet it can't tell a ":" for a device mane from one for a rule. -- Pat White ARPA/UUCP: j.cc.purdue.edu!ain BITNET: PATWHITE@PURCCVM PHONE: (317) 743-8421 U.S. Mail: 320 Brown St. apt. 406, West Lafayette, IN 47906
jimm@amiga.UUCP (Jim Mackraz) (07/28/88)
In article <3047@tekig4.TEK.COM> brianr@tekig4.TEK.COM (Brian Rhodefer) writes:
)In using Manx' make utility, I keep wishing it were possible
)to set up a makefile so that compilations use precompiled
)include files from RAM:, with the makefile automatically
)creating the precompiled includes. I'm never able to pull it off,
)though, and have to do the include file by hand. Can anyone
)suggest a way to achieve total make nirva... I mean, automation?
)
Here's my current way. Hack to suit. Note the use of sysall.h,
my compendium of includes that I won't be changing much.
PREDIR=RAM:
JUNKDIR=RAM:
PRE=foo.pre
CFLAGS=+I$(PREDIR)$(PRE)
LFLAGS=-lc
# this might be what the default does, hence unecessary
.c.o:
cc $(CFLAGS) -o $*.o $*.c
# a file filled with includes and nothing else
PRESRC=sysall.h
# this line get p.pre copied to ram before foo is made
all: $(PREDIR)$(PRE) foo
foo: foo.o
ln foo.o $(LFLAGS) -o $@
#this stuff hangs out at the bottom of all my makefiles
# here is the copying action itself
$(PREDIR)$(PRE): $(PRE)
copy $(PRE) $(PREDIR)
# and the building of the .pre
$(PRE): $(PRESRC)
cc -A -o $(JUNKDIR)pre_garbage.asm +H$(PRE) $(PRESRC)
--
Jim Mackraz, I and I Computing
amiga!jimm BIX:jmackraz
Opinions are my own. Comments regarding the Amiga operating system, and
all others, are not to be taken as Commodore official policy.
cjp@antique.UUCP (Charles Poirier) (07/28/88)
In article <3047@tekig4.TEK.COM> brianr@tekig4.UUCP writes:
<----> begin makefile excerpt <-----
...
<$(OBJS): ram:precompiled_include
<
<ram:precompiled_include: precompiled_include
< cp precompiled_include ram:
<#
<# Note use of `cp' instead of `copy'.
<#
<This gem behaves like `copy' SHOULD've, in that the copy's file
<creation date is set to the original's.
...
<*BUT*, if I immediately re-issue the `make' command, it will RE-COPY
<the `precompiled_include' file to ram:, and RE-COMPILE ALL THE MODULES,
<even though everything should be `up to date'.
Perhaps make is not satisfied that two dependent files have the
same exact age; it could want the dependent file to be strictly more
recent. Thus, the ram:pre file is not up-to-date with respect to
disk:pre, and since $(OBJS) depend on the ram: file, they too are not
up-to-date. Try this scheme with the regular "copy" which does not
preserve dates, and I bet it works fine.
Charles Poirier
--
Charles Poirier (decvax,ucbvax,mcnc,attmail)!vax135!cjp
"Docking complete... Docking complete... Docking complete..."