From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lee Sau Dan Newsgroups: gmane.emacs.help Subject: Re: java and M-x compile Date: 02 Oct 2005 19:11:23 +0800 Organization: InterNetNews at News.BelWue.DE (Stuttgart, Germany) Message-ID: <871x34yy04.fsf@informatik.uni-freiburg.de> References: <16586b516572c9.16572c916586b5@net.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=big5 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1128252248 18632 80.91.229.2 (2 Oct 2005 11:24:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 2 Oct 2005 11:24:08 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 02 13:24:04 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EM1wB-0006J5-1p for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Oct 2005 13:23:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EM1wA-0004K3-5i for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Oct 2005 07:23:22 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!news.belwue.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-NNTP-Posting-Host: gela.informatik.uni-freiburg.de Original-X-Trace: news.BelWue.DE 1128251484 20524 132.230.167.5 (2 Oct 2005 11:11:24 GMT) Original-X-Complaints-To: news@news.belwue.de Original-NNTP-Posting-Date: Sun, 2 Oct 2005 11:11:24 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Original-Xref: shelby.stanford.edu gnu.emacs.help:134287 Original-To: help-gnu-emacs@gnu.org 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:29859 Archived-At: >>>>> "Peter" =3D=3D Peter Dyballa writes: Peter> Am 30.09.2005 um 11:37 schrieb LENNART BORGMAN: >> but could make -k work by default, or does it need a makefile? Peter> make needs a makefile. No. GNUmake doesn't require a Makefile. It has default rules built-in, so that it can handle the trivial cases without a Makefile. e.g. you have a source file called xyz.cc and you type "make xyz". GNUmake will automatically invoke "g++ -o xyz xyz.cc" to compile it. Behind the scene, GNUmake applies the default rule: %: %.cc # commands to execute (built-in): $(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@ where=20 LINK.cc =3D $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) CXX =3D g++ and all other variables that occurred above undefined. This makes it possible to override certain behaviours without writing a Makefile. e.g. "make CXX=3Dmy_c++_compiler xyz" will compile it with "my_c++_compiler" instead of "g++". I most often use "make xyz CXXFLAGS=3D-O3\ -Wall LDFLAGS=3D-s" to compile an optimized executable without debug symbols. No makefiles are needed for such a simple scenario. You can have a look at the default rule of GNUmake with "make -p -n". --=20 Lee Sau Dan =A7=F5=A6u=B4=B0 ~= {@nJX6X~} E-mail: danlee@informatik.uni-freiburg.de Home page: http://www.informatik.uni-freiburg.de/~danlee