From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Mattie Newsgroups: gmane.emacs.help Subject: Re: help with makefile command line Date: Tue, 25 Mar 2008 21:25:53 -0700 Message-ID: <20080325212553.00102be1@reforged> References: <000001c88e79$86451340$33160e98@ece.ncsu.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/KpoJjX/Obf8JnDIUc/ZUckQ"; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Trace: ger.gmane.org 1206505874 28006 80.91.229.12 (26 Mar 2008 04:31:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Mar 2008 04:31:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 26 05:31:45 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JeNId-0004MY-Ta for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Mar 2008 05:31:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JeNI2-0002sU-BU for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Mar 2008 00:31:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JeNHM-0002bH-0i for help-gnu-emacs@gnu.org; Wed, 26 Mar 2008 00:30:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JeNHI-0002XB-Pg for help-gnu-emacs@gnu.org; Wed, 26 Mar 2008 00:30:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JeNHI-0002Wv-Jl for help-gnu-emacs@gnu.org; Wed, 26 Mar 2008 00:30:20 -0400 Original-Received: from wa-out-1112.google.com ([209.85.146.178]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JeNHI-0002qM-7W for help-gnu-emacs@gnu.org; Wed, 26 Mar 2008 00:30:20 -0400 Original-Received: by wa-out-1112.google.com with SMTP id k34so4355271wah.10 for ; Tue, 25 Mar 2008 21:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:from:to:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type; bh=RuerEIiSa4ZtGz6xAJOT7WdutK20XaBHlOFU6ww8ym0=; b=UE5afLS+iBS7w48PyHRBZ65wTt5w7euwZhAqkiYzhMbBTZWI4v/qrGP17mPaCq7MgNos1Cjv4Anrixq6YCqPWEbind3VY/2WJBYdG1vHXwqAfw6gtB28oSkJeDqIEaSLQPl81sqVeahn9670PX0zjmvbhC7uNWs0yH7TEl9rwwI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type; b=PlIYAnauNTQy96q+jtuk1g/aU9QG9E6vgDiZCM2TmoQ/L29JMd2qmCW2pZa5QVNhdZ4mvaTHPTgQjl8vQqjLEREAuYEZsEGi103xNavzb18egbPs1H6RLaU4cj7eoJKTKFtoG627gBcf+R4RwvNnxlqBzNhvALlNCzkoyOKg+Ok= Original-Received: by 10.114.197.1 with SMTP id u1mr14736740waf.61.1206505819310; Tue, 25 Mar 2008 21:30:19 -0700 (PDT) Original-Received: from reforged ( [71.217.206.83]) by mx.google.com with ESMTPS id m29sm1245749poh.3.2008.03.25.21.30.18 (version=SSLv3 cipher=OTHER); Tue, 25 Mar 2008 21:30:19 -0700 (PDT) In-Reply-To: X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.8; i686-pc-linux-gnu) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52692 Archived-At: --Sig_/KpoJjX/Obf8JnDIUc/ZUckQ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 26 Mar 2008 06:19:17 +0200 Eli Zaretskii wrote: > > From: "Balaji V. Iyer" > > Date: Tue, 25 Mar 2008 09:09:56 -0400 > >=20 > > I use the compile option extenstively in emacs. When I type "M-x > > compile" the default line is "make -k" Many times I do not have a > > make file >=20 > You don't need a Makefile to perform simple tasks, because Make knows > a lot of built in rules out of the box. For example, to compile a .c > source file foo.c into a program foo, all you need is say "make -k > foo", and Make will do it even without a Makefile. >=20 > > thus I would lke the default line to be > > =20 > > "gcc -ansi -O4 -Wall " > > =20 > > How do I do this? >=20 > Customize the variable compile-command. >=20 > > I tried the following command but it doesn't seem to work (If anyone > > have a better idea please let me know). > > =20 > > (function > > (lambda () > > (unless (or (file-exists-p "makefile") > > (file-exists-p "Makefile")) > > (setq compile-command > > (concat "gcc -Wall -O3 -o" > > (file-name-sans-extension (file-name-nondirectory > > buffer-file -name)) > > " " > > (file-name-nondirectory buffer-file-name)))))) >=20 > Where did you put this and how did you use it? >=20 >=20 btw , you don't have to setq. You can bind a value to compile-command with = let as well, calling compile within the let form. --Sig_/KpoJjX/Obf8JnDIUc/ZUckQ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFH6dBRdfRchrkBInkRAusnAJ4veH1NJLN/ej3fVAI3LSlRUG7XHACgrVLH mJWg8zujpS4mrbmk254OWzI= =/Z4D -----END PGP SIGNATURE----- --Sig_/KpoJjX/Obf8JnDIUc/ZUckQ--