File: Makefile

package info (click to toggle)
systemd-el 1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 128 kB
  • sloc: lisp: 370; makefile: 36
file content (43 lines) | stat: -rw-r--r-- 1,172 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
SRC = systemd.el
DATA = unit-directives.txt network-directives.txt nspawn-directives.txt
DISTFILES := Makefile $(SRC) $(DATA) LICENSE README systemd-pkg.el test

VERSION := $(shell awk '/^;; Version:/ {print $$3}' $(SRC))

PREFIX = /usr/local
datarootdir := $(PREFIX)/share
emacsdir := $(datarootdir)/emacs/site-lisp

EMACS = emacs

all: $(SRC:.el=.elc)

systemd-pkg.el: $(SRC)
	printf "(define-package \"systemd\" \"%s\" " $(VERSION) > $@
	echo "\"Major mode for editing systemd units\")" >> $@

systemd.elc: $(DATA)

check: test/systemd-tests.el systemd.elc
	@$(EMACS) -Q --batch -L . --eval "(progn \
		(load-file \"test/systemd-tests.el\") \
		(ert-run-tests-batch-and-exit))"

clean:
	$(RM) $(SRC:.el=.elc) systemd-pkg.el

dist: clean systemd-pkg.el
	mkdir systemd-$(VERSION)
	cp -r $(DISTFILES) systemd-$(VERSION)
	tar cf systemd-$(VERSION).tar systemd-$(VERSION)
	rm -rf systemd-$(VERSION)

install:
	install -d $(DESTDIR)$(emacsdir)/systemd
	install -m644 $(SRC) $(SRC:.el=.elc) -t $(DESTDIR)$(emacsdir)/systemd
	install -m644 $(DATA) -t $(DESTDIR)$(emacsdir)/systemd

.el.elc:
	$(EMACS) -L . --batch -f batch-byte-compile $<

.PHONY: all check clean dist install