🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #38398

makefile .c -> .o

#38398
From: Bill Shirley [CSC]
Date: Mon, 08 Jun 1992 15:44
51 lines
2333 bytes
CROSSPOST: 	followup --> gnu.gcc.help


I am trying to us a makefile to do a compile.
I am using RCS.
I wan't to recompile the .c file in two different cases

1) the file in the current directory has been edited
2) the RCS file has been updated

(I am putting object files in a subdirectory)

The two rules I have are:
$(OBJ)/%.o:: RCS/%.c,v
        -$(CO) $*.c
        $(COMPILE.c) -o $(OBJ)/$*.o $*.c

$(OBJ)/%.o:: %.c
        $(COMPILE.c) -o $(OBJ)/$*.o $*.c


but whichever rule come first is the only one seen.

I have tried using only one colon(:).
I have tried putting both dependencies to the right of the colon

	:: RCS/%.c,v  %.c
 this caused an error (More than one % pattern on left hand side) at make
 time

How do I accomplish my desired goal?


Also, I was using one Imake rule to make the Make rules, but I don't think
that was causing a problem:


#define MakeSources()                                           @@\
$(OBJ)/%.o::    RCS/%.c,v                                       @@\
        -$(CO) $*.c                                             @@\
        $(COMPILE.c) -o $(OBJ)/$*.o $*.c                        @@\
                                                                @@\
$(OBJ)/%.o::    %.c                                             @@\
        $(COMPILE.c) -o $(OBJ)/$*.o $*.c


email appreciated, or folowup to gnu.gcc.help
		(is somewhere else more appropriate?)
-- 
Bill Shirley
shirley@krakatoa.jsc.nasa.gov
Technical Details
Message-ID: <1992Jun8.104444@gothamcity.jsc.nasa.gov>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!bcm!aio!shirley

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,ef9aee79047facb1,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: fc89c,ef9aee79047facb1,start
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 103734,ef9aee79047facb1,start
X-Google-Attributes: gid103734,public
X-Google-ArrivalTime: 1992-06-08 00:58:28 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!bcm!aio!shirley
From: shirley@gothamcity.jsc.nasa.gov (Bill Shirley [CSC])
Newsgroups: comp.windows.x,comp.unix.programmer,gnu.gcc.help
Subject: makefile .c -> .o
Keywords: imake make rcs gcc SunOS sparc
Message-ID: <1992Jun8.104444@gothamcity.jsc.nasa.gov>
Date: 8 Jun 1992 15:44:43 GMT
Sender: news@aio.jsc.nasa.gov (USENET News System)
Followup-To: gnu.gcc.help
Organization: Software Technology Lab - NASA/Johnson Space Center
Lines: 51