Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 19 23:18:16 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m8K6IG0g020558 for ; Fri, 19 Sep 2008 23:18:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m8K6K5Xr024059 for ; Fri, 19 Sep 2008 23:20:05 -0700 Message-Id: <200809200620.m8K6K5Xr024059@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Make file Date: Fri, 19 Sep 2008 23:20:05 -0700 From: Bill Cheng Someone wrote: > I m using command > > gcc -c src1.c src2.c > > it works in same fashion as > > gcc -c src1.c > gcc -c src2.c Then you would probably lose 5 points! According to the spec, it's a *requirement* to use separate compilation. Please see: http://merlot.usc.edu/cs551-f08/makefile.html#requirements -- Bill Cheng // bill.cheng@usc.edu > ----- Original Message ---- > From: Bill Cheng > To: cs551@merlot.usc.edu > Sent: Friday, September 19, 2008 10:37:15 PM > Subject: Re: Make file > > Someone wrote: > >   > This is regarding test case >   > Separate compilation : -10 points >   >        if mm2 is compiled with a single line, >   >            deduct all 10 points >   >        if generates mm2.o and then link to create the >   >            executable in line one, deduct 5 points >   >        if most of the code are in .h files, deduct all 10 points >   >  >   > I have 2 source files which I compile in single command to >   > get mm2.o and then link mm2.o to get mm executable. I dont >   > know whats wrong with that . What is correct way to make? > > If you have 2 source files, let's say, x.c and y.c, you should > compile x.c to x.o and y.c to y.o.  Then you link x.o and y.o > together to create the mm2 executable. > > I'm not sure how you can have 2 source files and you can > create mm2.o from it!  May be you meant one source file and > one header file.  You are asked to *break* this source file > into two and create a header file for each of them. > -- > Bill Cheng // bill.cheng@usc.edu