diff --git a/Makefile b/Makefile index 5edb6c0..9056c69 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,68 @@ -EMACS = emacs -BATCH = $(EMACS) -Q -batch -L . +# This file is part of el.make. +# +# Copyright: 2024- casch-at (Christian Anders Schwarzgruber) +# +# Version: 0.1.0 +## +#### +## +# 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 +# +# a GNU Emacs Lisp `make` file +## -export LC_ALL=C +# TODO(cschwarzgruber): hmm? +export LC_ALL = C -all: clean compile gen-autoloads test +emacs = emacs +flags = -q --batch --no-site-file +batch = $(emacs) $(flags) -# Forcefully remove files ignored by Git. -clean: - git clean -Xf +## test directory +testdir = tests + +## source directory +srcdir = src + +## all source files +elfiles = $(wildcard $(srcdir)/*.el) + +## all test files +testfiles = $(wildcard $(testdir)/*.el) + +## all compiled files +elcfiles = $(addprefix $(srcdir)/, $(notdir $(elfiles:.el=.elc))) -compile: - $(BATCH) -f batch-byte-compile org-journal.el +.phony: all compile test clean -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 "." +all: compile test -test: - $(BATCH) -l tests/org-journal-test -f ert-run-tests-batch-and-exit +compile: $(elcfiles) + +test: $(elcfiles) + @echo "running tests... " + @$(batch) -L $(srcdir) -l $(testfiles) -f ert-run-tests-batch-and-exit + +$(srcdir)/%.elc: $(srcdir)/%.el + @echo "compiling $<..." + @$(batch) -f batch-byte-compile $< + +clean: + rm -f $(elcfiles) diff --git a/el.make b/el.make new file mode 120000 index 0000000..33ceb8f --- /dev/null +++ b/el.make @@ -0,0 +1 @@ +Makefile \ No newline at end of file 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