From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Espen Newsgroups: gmane.emacs.help Subject: Re: Emacs users a dying breed? Date: Sat, 23 Jun 2012 20:16:46 -0400 Organization: A noiseless patient Spider Message-ID: References: <1339986746.80168.YahooMailNeo@web161603.mail.bf1.yahoo.com> <871ulch282.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1340497216 31958 80.91.229.3 (24 Jun 2012 00:20:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 24 Jun 2012 00: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 Sun Jun 24 02:20:12 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 1SiaYm-0005QP-8P for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Jun 2012 02:20:12 +0200 Original-Received: from localhost ([::1]:54990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiaYm-0001yG-1B for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Jun 2012 20:20:12 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 89 Injection-Info: mx04.eternal-september.org; posting-host="eEvqGQsJJYL9/mBIdBpRPw"; logging-data="13812"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19z/JIHCFF8oJrgJXcCPmozpW0DfQtZl00=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:E81pmEM4HgL+NiWOypK0+lhzlGs= sha1:rBgMRD4acvlodP2HfrsXJ1youQs= Original-Xref: usenet.stanford.edu gnu.emacs.help:193009 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:85404 Archived-At: notbob writes: > On 2012-06-21, Ken Goldman wrote: > >> I think Pascal was saying that you Makefile (not /usr/bin/make) might >> not be in the same directory as your code. >> >> If you don't have a makefile there, you can also do 'make -f >> pathtomakefile' and emacs will remember it for the next time. >> >> If you don't have a makefile at all, it's time to create one. >> >> Bonus: Check out M-x next-error. I have both compile and next-error >> bound to Fn keys since I use them constantly. > > OK. I'll risk looking stupid one more time. ;) > > What, exactly, is this "Makefile"? A Makefile is a file using that name (Makefile) that you normally keep in the same directory as your source code. In that file you keep the rules it takes to build your source code. Start here for documentation: http://www.gnu.org/software/make/manual/ The basic idea is to list your files, show how they inter-relate and are used to build your project. A simple example of a Makefile: SRC:=hello.c TARG:=$(subst .c,,$(SRC)) all: $(TARG) %: %.c cc $< $@ test: $(TARG) ./$(TARG) Anything starting in column 1 and ending in a ":" is a target. (Something you want to make.) Things listed after the colon (":") are things you need to make the target. Things following a TAB in column 1 are rules. The rules you need to make the target. Makefiles can get a lot more elaborate and can do a lot of things for you. If you need to compile 3 subroutines for a main before you link the main, the makefile can ensure that you do that. Anyway, it's definitely worth the time to learn and a great productivity booster. It's also not only for building programs. I use them to upload web pages to a server. For example: UP_SITE:=ftpmysite.somewhere.net uploads:=$(wildcard *.jpg *.html *.gif *.css ) targets:=$(addprefix .upload/,$(uploads)) all: $(targets) define install_html (\ echo -e "binary\n"\ "cd deck\n"\ "put $(subst .upload/,,$@)\n"\ "close\n"\ "quit\n"\ ) | ftp $(UP_SITE) endef .upload/%: % $(install_html) echo "`date`" > $@ clean: rm .upload/* -- Dan Espen