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 9e425d1
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 17 deletions.
83 changes: 66 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,72 @@
EMACS = emacs
BATCH = $(EMACS) -Q -batch -L .
# this file is part of el.make.
#
# copyright: 2024- christian schwarzgruber ([email protected])
#
# 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 <http://www.gnu.org/licenses/>.
##
####
##
# hier koennte ihre werbung stehen
#
# el.make
#
# a 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 9e425d1

Please sign in to comment.