1 #+OPTIONS: H:3 num:nil toc:2 \n:nil ::t |:t ^:{} -:t f:t *:t tex:t d:(HIDE) tags:not-in-toc
2 #+STARTUP: align fold nodlcheck hidestars oddeven lognotestate hideblocks
3 #+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
4 #+TAGS: Write(w) Update(u) Fix(f) Check(c) noexport(n)
5 #+TITLE: Makefile Source Code Blocks in Org Mode
6 #+AUTHOR: Thomas S. Dye
7 #+EMAIL: tsd[at]tsdye[dot]com
9 #+HTML_LINK_UP: index.html
10 #+HTML_LINK_HOME: https://orgmode.org/worg/
11 #+EXCLUDE_TAGS: noexport
15 <div id="subtitle" style="float: center; text-align: center;">
17 Org Mode support for <a
18 href="http://www.gnu.org/software/make/manual/make.html">`make'</a>
23 * Template Checklist [12/12] :noexport:
25 - [X] Indicate #+AUTHOR:
27 - [X] Revise banner source block [3/3]
28 - [X] Add link to a useful language web site
29 - [X] Replace "Language" with language name
30 - [X] Find a suitable graphic and use it to link to the language
32 - [X] Write an [[Introduction]]
33 - [X] Describe [[Requirements%20and%20Setup][Requirements and Setup]]
34 - [X] Replace "Language" with language name in [[Org%20Mode%20Features%20for%20Language%20Source%20Code%20Blocks][Org Mode Features for Language Source Code Blocks]]
35 - [X] Describe [[Header%20Arguments][Header Arguments]]
36 - [X] Describe support for [[Sessions]]
37 - [X] Describe [[Result%20Types][Result Types]]
38 - [X] Describe [[Other]] differences from supported languages
39 - [X] Provide brief [[Examples%20of%20Use][Examples of Use]]
41 The =make= program is a dependency-tracking build utility that is
42 distributed with *nix systems. There are several =make= programs,
43 but they each generally look for a file named =makefile= or
44 =Makefile=, which contains rules for building one or more targets.
45 =ob-makefile.el= helps the =Org mode= user tangle a =makefile= using
48 Currently, =ob-makefile.el= is useful only for tangling a
49 =makefile=. Hopefully, at some point in the future it will support
51 * Requirements and Setup
53 The =make= program is a somewhat unusual *nix utility because the
54 =TAB= character is an important part of the syntax.
56 Emacs includes a [[http://www.emacswiki.org/emacs/MakefileMode][makefile-mode]] for editing the =makefile= code.
58 For tangling to work, the variable =org-src-preserve-indentation= must
59 be non-nil, so that tabs aren't lost in the Org mode buffer.
61 #+begin_src emacs-lisp :exports code
62 (setq org-src-preserve-indentation t)
65 Currently, there is no need to activate makefile with
66 =org-babel-do-load-languages=, but it won't hurt to do so.
68 #+begin_src emacs-lisp :exports code
69 (org-babel-do-load-languages
70 'org-babel-load-languages
74 * Org Mode Features for Makefile Source Code Blocks
76 There are no language-specific default values or header arguments for =makefile=.
78 =makefile= doesn't support sessions.
81 =makefile= source code blocks currently don't return results. They
82 exist solely for tangling.