From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: Compilator en windows Date: Wed, 19 Sep 2012 18:15:59 +0200 Organization: Informatimago Message-ID: <878vc6f0ow.fsf@kuiper.lan.informatimago.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1348071616 10850 80.91.229.3 (19 Sep 2012 16:20:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Sep 2012 16:20:16 +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 Sep 19 18:20:18 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TEN0b-0003M5-MW for geh-help-gnu-emacs@m.gmane.org; Wed, 19 Sep 2012 18:20:17 +0200 Original-Received: from localhost ([::1]:34682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEN0X-0005cp-2T for geh-help-gnu-emacs@m.gmane.org; Wed, 19 Sep 2012 12:20:13 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 72 Original-X-Trace: individual.net fktOHdVCwZtcXrbNjpPJygeCiHmxnrZE3WLvyI1S9uJv0Rl/GR2OTGY/1U5PTzzhfG Cancel-Lock: sha1:YWU4NDYwOTdlZDUzODEwNzgxYTI4MzM1YzQ2NWQ1ZDQxNThkNWRlYw== sha1:shDgPKn9i3NJ4uFc+mlUmxsbrHQ= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:194491 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86832 Archived-At: Jose Cristino Cepeda Uceta writes: > i am new to emacs. I install emacs on windows and I want to configure > it to work with the MinGW compiler but not how Compiling from emacs, is usually done with M-x compile RET By default, it runs the make command. So you'd write a Makefile with rules to call the MinGW compiler. Writing Makefile doesn't concern emacs (emacs just provides an editing mode for Makefiles, with nice colorization). So read the documentation of your make program. Calling the MinGW compiler doesn't concern emacs (emacs just provides a compile mode to launch a compiler, and to analyse error messages). So read the documentation of your MinGW compiler. I know the usual unix or GNU make, but often on MS-Windows people use another make, with I guess a different syntax. The principle would be the same. On unix you'd write a Makefile like this: ----(Makefile)---------------------------------------------------------- # variables: specific to the compilation of a specific program EXE=mypgm OBJ=mymodule.o mypgm.o INCS=-I. LIBS=-lm # CC is usually predefined by make; but you can also define it to point # to a specific compiler; you'd put the path to the MinGW compiler here. CC=gcc # rules: always about the same. all:$(EXE) $(EXE):$(OBJ) $(CC) -o $@ $< $(LIBS) .o.c: ; $(CC) -c $(INCS) -o $@ $< # dependencies: depend on the specific program; can also be generated # automatically from the sources. mymodule.o : mymodule.h mymodule.c mypgm.o : mymodule.h mypgm.c ------------------------------------------------------------------------ If you have a simple single source file program, you can also often compile it just calling the compiler, without a Makefile. Then you can edit the command line proposed by M-x compile to call directly the compiler: M-x compile RET C-a C-k gcc -o mypgm *.c -lm RET ^^^^^^^^^^^^^^^^^^^^ Having read the documentation of the MinGW compiler, you would substitute the part underlined by "^^^^" with the right MinGW compiler invocation. -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}.