Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!jahangir!marc From: marc@jahangir.UUCP (Marc Rossner) Newsgroups: comp.unix.questions Subject: Re: Makefile for Compressed files (.o.Z) Message-ID: <540@jahangir.UUCP> Date: 11 Apr 91 21:53:09 GMT References: <1991Apr8.194733.17653@berlioz.nsc.com> Organization: Springfield (I swear) Lines: 34 In article <1991Apr8.194733.17653@berlioz.nsc.com>, nelson@desktop.uiuc.edu (Taed Nelson) writes: > > I've been trying to create a makefile which automatically uncompresses > the appropriate file when it is needed. Let's limit the discussion > to just .o files. > > It seems that one would want to define a rule to take *.o.Z files and > make them into *.o files: > .o.Z.o: > uncompress $< I tried this out exactly as you have it -- and lo' and behold -- it works! (Did you try it out?). Here is my Makefile: .SUFFIXES: .o .o.Z .o.Z.o: uncompress $< Now if I have a file called "blah.o.Z" and type "make blah.o" it works like a charm. Seems like a suffix-rule will look for the longest possible suffix at the beginning of the rule. Of course, you will still be left with uncompressed .o files unless you explicitly recompress them after linking them. I.e. you might want all: various real targets compress *.o if you know that all the .o files should be recompressed. Marc Rossner jahangir!marc@uunet.uu.net