emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <eric.schulte@gmx.com>
To: Robert McIntyre <rlm@mit.edu>
Cc: emacs-orgmode@gnu.org
Subject: Re: How to build a project from org files using ant/make?
Date: Fri, 02 Mar 2012 13:54:50 -0700	[thread overview]
Message-ID: <877gz2lo4l.fsf@gmx.com> (raw)
In-Reply-To: <CABqqNd04To9iYi7w-aM1uM=Zkx2eMYGvoPN3=SFuVciUaZQ1qA@mail.gmail.com> (Robert McIntyre's message of "Fri, 2 Mar 2012 14:45:09 -0600")

[-- Attachment #1: Type: text/plain, Size: 1758 bytes --]

Robert McIntyre <rlm@mit.edu> writes:

> Hi,
>
> I use org-babel to produce the source and html documentation for my projects.
>
> My projects generally look like this:
>
> [~/tmp/org-project] $ tree
> .
> |-- html
> |   `-- proj.html
> |-- org
> |   `-- proj.org
> `-- src
>     `-- namesace
>         |-- prog_1.clj
>         `-- prog_2.clj
>
> Here prog_1.clj, prog_2.clj, and proj.html are all generated from the
> proj.org file.
>
> Because the source and html files are generated files, I don't include
> them in source control.
>
> When I download my project on another computer, I want to be able to
> generate all these files again, preferably from a makefile/build.xml,
> etc.
>
> What is the best practice for doing this?  Right now, I maintain two
> shell scripts called "tangle" and "weave" that invoke emacs on the
> project, but these rely on my specific emacs setup.  How can I make it
> possible for someone to build my project if they have emacs and
> make/ant?  What are other people doing when it comes to automatically
> building a project whose source files are generated from org files?
>

I've attached the Makefile I use to build a pdf of my proposal from the
Org-mode source.  Notice the EMACS, BATCH_EMACS, and proposal.tex lines.
You should be able to adopt proposal.tex to export source code by
replacing org-export-as-latex with org-babel-tangle.  This setup has
worked very reliably for me and should extend naturally.

I use an init.el file to holds project-specific customization.  If you
can assume that the user has Emacs24 installed, then you need not do
anything special and can omit init.el entirely, otherwise you will have
to ensure that a recent version of Org-mode is installed and loaded.

Hope this helps -- Eric


[-- Attachment #2: Makefile --]
[-- Type: application/octet-stream, Size: 839 bytes --]

EMACS=emacs
BATCH_EMACS=$(EMACS) --batch -Q -l init.el proposal.org

all: proposal.pdf

proposal.html: proposal.org
	$(BATCH_EMACS) -f org-export-as-html

proposal.tex: proposal.org proposal.bib init.el
	$(BATCH_EMACS) -f org-export-as-latex

proposal.bib: tasks.org bib-export.el
	$(BATCH_EMACS) -l bib-export.el

proposal.pdf: proposal.tex gantt.pdf
	rm -f proposal.aux
	if pdflatex proposal.tex </dev/null; then \
		true; \
	else \
		stat=$$?; touch proposal.pdf; exit $$stat; \
	fi
	bibtex proposal
	while grep "Rerun to get" proposal.log; do \
		if pdflatex proposal.tex </dev/null; then \
			true; \
		else \
			stat=$$?; touch proposal.pdf; exit $$stat; \
		fi; \
	done

gantt.pdf: gantt.tex
	./single-fig gantt.tex

clean:
	rm -f *.aux *.log *.dvi *.blg *.bbl *.toc proposal.tex *~ *.out *.html proposal.pdf proposal.bib gantt.pdf

[-- Attachment #3: Type: text/plain, Size: 85 bytes --]


>
> sincerely,
> --Robert McIntyre
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

      reply	other threads:[~2012-03-02 20:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 20:45 How to build a project from org files using ant/make? Robert McIntyre
2012-03-02 20:54 ` Eric Schulte [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877gz2lo4l.fsf@gmx.com \
    --to=eric.schulte@gmx.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rlm@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).