ob-doc-makefile.org 3.2 KB

Org Mode support for `make'

Template Checklist [12/12] noexport

Introduction

  • [X] Revise #+TITLE:
  • [X] Indicate #+AUTHOR:
  • [X] Add #+EMAIL:
  • [X] Revise banner source block [3/3]
  • [X] Add link to a useful language web site
  • [X] Replace "Language" with language name
  • [X] Find a suitable graphic and use it to link to the language
  • web site
  • [X] Write an Introduction
  • [X] Describe Requirements and Setup
  • [X] Replace "Language" with language name in Org Mode Features for Language Source Code Blocks
  • [X] Describe Header Arguments
  • [X] Describe support for Sessions
  • [X] Describe Result Types
  • [X] Describe Other differences from supported languages
  • [X] Provide brief Examples of Use
  • The =make= program is a dependency-tracking build utility that is distributed with *nix systems. There are several =make= programs, but they each generally look for a file named =makefile= or =Makefile=, which contains rules for building one or more targets. =ob-makefile.el= helps the =Org mode= user tangle a =makefile= using source code blocks.

Requirements and Setup

Currently, ob-makefile.el is useful only for tangling a =makefile=. Hopefully, at some point in the future it will support variables.

The make program is a somewhat unusual *nix utility because the =TAB= character is an important part of the syntax.

Emacs includes a makefile-mode for editing the makefile code.

For tangling to work, the variable org-src-preserve-indentation must be non-nil, so that tabs aren't lost in the Org mode buffer.

(setq org-src-preserve-indentation t)

Currently, there is no need to activate makefile with =org-babel-do-load-languages=, but it won't hurt to do so.

(org-babel-do-load-languages 'org-babel-load-languages '((makefile . t)))

Org Mode Features for Makefile Source Code Blocks

Header Arguments

Sessions

There are no language-specific default values or header arguments for makefile. =makefile= doesn't support sessions.

Result Types

makefile source code blocks currently don't return results. They exist solely for tangling.