This repository has been archived by the owner on Dec 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
91 lines (70 loc) · 2.14 KB
/
Makefile
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
prefix=/usr/local
bindir=$(prefix)/bin
datadir=$(prefix)/share
docdir=$(datadir)/doc
DESTDIR=
INSTALL=install
INSTALL_DATA=install -m 644
INSTALL_DIR=install -d
UNINSTALL=rm
UNINSTALL_DIR=rm -r
pkg_datadir=$(datadir)/cjc
pkg_docdir=$(docdir)/cjc
VERSION=1.2.1
SNAPSHOT=
PY_DIRS=cjc cjc/ui plugins
DOCS=doc/manual.html COPYING ChangeLog README TODO
EXTRA_DIST=cjc.in cjc.py doc/manual.xml doc/Makefile
.PHONY: all version dist cosmetics ChangeLog
all: cjc.inst $(DOCS) version
doc/manual.html: doc/manual.xml
cd doc; make
version:
if test -d ".git" ; then \
echo "version='$(VERSION)+git'" > cjc/version.py || : ; \
fi
cjc.inst: cjc.in
sed -e 's,BASE_DIR,$(pkg_datadir),' < cjc.in > cjc.inst
ChangeLog:
test -d .git && make cl-stamp || :
cl-stamp: .git
git log > ChangeLog
touch cl-stamp
cosmetics:
./aux/cosmetics.sh
clean:
-rm -f cjc.inst
install: all
for d in $(PY_DIRS) ; do \
$(INSTALL_DIR) $(DESTDIR)$(pkg_datadir)/$$d ; \
$(INSTALL_DATA) $$d/*.py $(DESTDIR)$(pkg_datadir)/$$d ; \
done
python -c "import compileall; compileall.compile_dir('$(DESTDIR)$(pkg_datadir)', ddir='$(pkg_datadir)')"
$(INSTALL_DIR) $(DESTDIR)$(pkg_docdir)
$(INSTALL_DATA) $(DOCS) $(DESTDIR)$(pkg_docdir)
$(INSTALL_DIR) $(DESTDIR)$(bindir)
$(INSTALL) cjc.inst $(DESTDIR)$(bindir)/cjc
uninstall:
for d in $(PY_DIRS) ; do \
$(UNINSTALL_DIR) $(DESTDIR)$(pkg_datadir)/$$d ; \
done || :
$(UNINSTALL_DIR) $(DESTDIR)$(pkg_datadir) || :
$(UNINSTALL_DIR) $(DESTDIR)$(pkg_docdir) || :
$(UNINSTALL) $(DESTDIR)$(bindir)/cjc || :
dist: all
echo "version='$(VERSION)$(SNAPSHOT)'" > cjc/version.py ; \
version=`python -c "import cjc.version; print cjc.version.version"` ; \
distname=cjc-$$version ; \
for d in $(PY_DIRS) ; do \
$(INSTALL_DIR) $$distname/$$d || exit 1 ; \
cp -a $$d/*.py $$distname/$$d || exit 1 ; \
done || exit 1 ; \
for f in $(DOCS) $(EXTRA_DIST) ; do \
d=`dirname $$f` ; \
$(INSTALL_DIR) $$distname/$$d || exit 1; \
cp -a $$f $$distname/$$d || exit 1; \
done ; \
sed -e "s/^SNAPSHOT=.*/SNAPSHOT=$(SNAPSHOT)/" Makefile > $$distname/Makefile ; \
mkdir -p dist ; \
tar czf dist/$${distname}.tar.gz $$distname && \
rm -r $$distname