From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Riley Newsgroups: gmane.emacs.help Subject: Re: Compiling C++ in emacs Date: Sun, 16 Nov 2008 21:41:31 +0100 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1226871694 11821 80.91.229.12 (16 Nov 2008 21:41:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Nov 2008 21:41:34 +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 Nov 16 22:42:36 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 1L1pO8-0000VY-6H for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Nov 2008 22:42:36 +0100 Original-Received: from localhost ([127.0.0.1]:50416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L1pMz-0007Fd-Re for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Nov 2008 16:41:25 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!t-online.de!news.k-dsl.de!news.eternal-september.org!news.motzarella.org!motzarella.org!news.motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 57 Original-X-Trace: news.motzarella.org U2FsdGVkX1+yukwAni8in28aTNk0Kir61d49hCMJ5OdaSahJlLfoHCs5kwQ1bBYWOkGJEMTcaOExmFsJuSst/O+v14ZcdIJT3N3yzRplwhUvkDfvjDqxXDhAJJGCafqoqH+jr8i06+Zt2ylsjXEQlg== Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Sun, 16 Nov 2008 20:41:57 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1+r32wZ6mcWruwRUGH2CN67MMW17w2TeDlBkCRRqthH5A== Cancel-Lock: sha1:CJTo36blmiJvU9EKqilVgTGPIO8= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:164511 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:59845 Archived-At: Corrected a small error so Makefile or makefile works now and also to look for SConstruct file first to use the fantastic scons make tool. ,---- | (defun do-compile() | (compile (make-command)) | ) | | | | (defun make-command() | | (if (or (file-exists-p "makefile") | (file-exists-p "Makefile")) | "make" ) | (if (file-exists-p "SConstruct") | "scons" | (let ((file (file-name-nondirectory buffer-file-name))) | (if (equal (file-name-extension buffer-file-name) "cc") | (progn | (format "%s %s %s -o %s" | (or (getenv "CC") "g++") | (or (getenv "CPPFLAGS")"-Wall -g") "*.cc" | (file-name-sans-extension file) | )) | (format "%s -o %s %s %s %s %s" | (or (getenv "CC") "gcc") | (file-name-sans-extension file) | (or (getenv "GTKFLAGS") "`pkg-config --cflags --libs gtk+-2.0`") | (or (getenv "CPPFLAGS")"-DDEBUG=9") | (or (getenv "CFLAGS") "-std=c99 -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -g") | file) | )))) | | | (defun do-lint() | (interactive) | (set (make-local-variable 'compile-command) | (let ((file (file-name-nondirectory buffer-file-name))) | (format "%s %s %s" | "splint" | "+single-include -strict -compdef -nullpass -preproc +matchanyintegral -internalglobs -I/usr/include/gtk-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo/ -I/usr/include/pangomm-1.4/pangomm/" | file | ))) | (message compile-command) | (compile compile-command) | ) | | (defun do-cdecl () | (interactive) | (shell-command | (concat "cdecl explain \"" (buffer-substring (region-beginning) | (region-end)) "\"")) | ) | `----