diff options
author | Ralph Amissah <ralph@amissah.com> | 2015-10-20 18:52:12 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2015-10-20 22:13:25 -0400 |
commit | 4b0c115b58211dcc063bcd09f8fe122e558b92ce (patch) | |
tree | b60e38935a4f5fbd723c13a5035d952976c851bf /makefile | |
parent | update minor (diff) |
literate programming introduced, tangle not yet run
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 49 |
1 files changed, 45 insertions, 4 deletions
@@ -31,6 +31,13 @@ PRG_SRC=$(PRG_NAME).d PRG_SRCDIR=./lib/$(PRG_NAME) PRG_BIN=$(PRG_NAME) PRG_BINDIR=bin +# ORG +EMACSLISP=/usr/share/emacs/site-lisp +EMACSLISP_ORG=~/.emacs.d/elpa/org-20151005 +EMACSLISP_ORG_CONTRIB=~/.emacs.d/elpa/org-plus-contrib-20151005 +ORGFILELIST=$(shell echo `ls -1 maker.org org/*.org`) +ORGFILES="" +ORGDIR=$(shell echo `pwd`) all: build @@ -61,16 +68,50 @@ debug_gdc: $(PRG_SRCDIR)/$(PRG_SRC) $(GDC_FLAG_BINOF)$(PRG_BINDIR)/$(PRG_BIN) \ $(PRG_SRCDIR)/$(PRG_SRC) -release: $(PRG_SRCDIR)/$(PRG_SRC) +release: distclean_and_init tangle $(PRG_SRCDIR)/$(PRG_SRC) $(DC) $(DC_FLAGS) $(DC_FLAGS_RELEASE) \ $(DC_FLAG_BINOF)$(PRG_BINDIR)/$(PRG_BIN) \ $(PRG_SRCDIR)/$(PRG_SRC) +init: + mkdir -p $(PRG_SRCDIR); \ + mkdir -p $(PRG_BINDIR); + clean: $(PRG_BINDIR)/$(PRG_BIN).o rm $(PRG_BINDIR)/$(PRG_NAME).o -distclean: $(PRG_BINDIR) - rm -rf $(PRG_BINDIR) +expunge: init $(PRG_BINDIR) + rm -rf $(PRG_BINDIR); \ + rm -rf $(PRG_SRCDIR); + +distclean: init $(PRG_BINDIR) expunge + +distclean_and_init: init $(PRG_BINDIR) expunge + mkdir -p $(PRG_SRCDIR); \ + mkdir -p $(PRG_BINDIR); + +tangle: + for f in $(ORGFILELIST); do \ + ORGFILES="$$ORGFILES \"$$f\""; \ + done; \ + emacs --batch -Q -q \ + --eval "(progn \ + (add-to-list 'load-path \ + (expand-file-name \"$(EMACSLISP)\")) \ + (add-to-list 'load-path \ + (expand-file-name \"$(EMACSLISP_ORG)\" t)) \ + (add-to-list 'load-path \ + (expand-file-name \"$(EMACSLISP_ORG_CONTRIB)\" t)) \ + (require 'org)(require 'ob)(require 'ob-tangle) \ + (mapc (lambda (file) \ + (find-file (expand-file-name file \"$(ORGDIR)\")) \ + (setq-local org-src-preserve-indentation t) \ + (org-babel-tangle) \ + (kill-buffer)) '($$ORGFILES)))" 2>&1 + +gitsnapshot: distclean_and_init tangle + git commit -a .PHONY : all build rebuild debug release \ - clean distclean + clean distclean init \ + tangle |