Skip to content

Commit

Permalink
Use el.make
Browse files Browse the repository at this point in the history
  • Loading branch information
casch-at committed Feb 19, 2024
1 parent b154887 commit 7ee6944
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 17 deletions.
79 changes: 62 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
##
####
##
# 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)
1 change: 1 addition & 0 deletions el.make
File renamed without changes.

0 comments on commit 7ee6944

Please sign in to comment.