Parametrize with elisp the output files of the project

This commit is contained in:
2021-08-30 19:04:48 +02:00
parent dae1ad10f9
commit 910c19c510
7 changed files with 58 additions and 11 deletions

View File

@@ -1,15 +1,17 @@
ATRIP_ROOT := $(PWD)
CONFIG ?= gcc
include etc/config/$(CONFIG).mk
SOURCES_FILE := Sources.mk
include $(SOURCES_FILE)
include ./etc/emacs.mk
include ./etc/config/$(CONFIG).mk
include ./bench/config.mk
EMACS = emacs -q --batch
define tangle
$(EMACS) $(1) --eval "(require 'org)" --eval '(org-babel-tangle)'
endef
MAIN = README.org
SOURCES = $(shell grep -oe ':tangle \+[^ ]\+' $(MAIN) | awk '{print $$2}' | sort -u)
$(SOURCES_FILE): $(MAIN)
echo -n "SOURCES = " > $@
$(EMACS) --eval '(atrip-print-sources)' >> $@
$(SOURCES): $(MAIN)
$(call tangle,$<)