diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 0000000..73d430e --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,4 @@ +;;; Directory Local Variables -*- no-byte-compile: t -*- +;;; For more information see (info "(emacs) Directory Variables") + +(("nil-mode" . ((compile-command . "make -f el.make")))) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 954626e..e7809ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,4 +35,4 @@ jobs: - uses: actions/checkout@v4 - name: Run tests - run: make all + run: make -f el.make all diff --git a/.gitignore b/.gitignore index e0062bb..257c9f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ *.elc -/org-journal-autoloads.el +*-autoloads.el diff --git a/Makefile b/Makefile deleted file mode 100644 index 5edb6c0..0000000 --- a/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -EMACS = emacs -BATCH = $(EMACS) -Q -batch -L . - -export LC_ALL=C - -all: clean compile gen-autoloads test - -# Forcefully remove files ignored by Git. -clean: - git clean -Xf - -compile: - $(BATCH) -f batch-byte-compile org-journal.el - -gen-autoloads: - $(BATCH) \ - --eval "(require 'autoload)" \ - --eval '(setq make-backup-files nil)' \ - --eval "(setq generated-autoload-file (concat command-line-default-directory \"/\" \"org-journal-autoloads.el\"))" \ - -f batch-update-autoloads "." - -test: - $(BATCH) -l tests/org-journal-test -f ert-run-tests-batch-and-exit diff --git a/el.make b/el.make new file mode 100644 index 0000000..7c4f516 --- /dev/null +++ b/el.make @@ -0,0 +1,73 @@ +## +# this file is part of el.make +# +# copyright: 2024- christian schwarzgruber (c.schwarzgruber.cs@gmail.com) +# +# version: 0.1.0 +# +# source: https://github.com/casch-at/el.make +# +# +## +#### +## +# el.make is free software: you can redistribute it and/or modify it +# under the terms of the gnu general public license as published by the free +# software foundation, either version 3 of the license, or +# (at your option) any later version. +# +# el.make is distributed in the hope that it will be useful, +# but without any warranty; without even the implied warranty of +# merchantability or fitness for a particular purpose. see the +# gnu general public license for more details. +# +# you should have received a copy of the gnu general public license along +# with el.make. if not, see . +## +#### +## +# hier koennte ihre werbung stehen +# +# el.make +# +# an emacs lisp `make` file +## + +# todo(cschwarzgruber): hmm? +export LC_ALL = C + +emacs = emacs +flags = -Q --batch --no-site-file +batch = $(emacs) $(flags) + +## test directory +test-d = tests + +## source directory +src-d = src + +## all source files +el-f = $(wildcard $(src-d)/*.el) + +## all test files +test-f = $(wildcard $(test-d)/*.el) + +## all compiled files +elc-f = $(addprefix $(src-d)/, $(notdir $(el-f:.el=.elc))) + +.phony: all compile test clean + +all: compile test + +compile: $(elc-f) + +test: $(elc-f) + @echo "running tests... " + @$(batch) -L $(src-d) -l $(test-f) -f ert-run-tests-batch-and-exit + +$(src-d)/%.elc: $(src-d)/%.el + @echo "compiling $<..." + @$(batch) -f batch-byte-compile $< + +clean: + rm -f $(elc-f) diff --git a/org-journal.el b/src/org-journal.el similarity index 100% rename from org-journal.el rename to src/org-journal.el