-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
74 lines (65 loc) · 1.99 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
include makefile.inc
# in future we add new p2test in $(EXE)
all: $(EXE) static
# for future p2test
p%test:
$(MAKE) -C example $@
mkdir -p bin
# copy p%test in bin/ only if date of file is newer
cp -u example/$@ bin/
static $(LIBS):
$(MAKE) -C src $@
mkdir -p lib
cp -u src/*.a lib/
source:
tar --exclude=*.tar.gz \
--exclude=*.sha1sum \
--exclude=*.o \
--exclude=*.a \
--exclude=p1test \
--exclude=p2test \
--exclude=bin \
--exclude=lib \
--transform='s|^|yaeos/|' \
-czf $(SRCTAR).tar.gz *
gzip -t $(SRCTAR).tar.gz
sha1sum $(SRCTAR).tar.gz > $(SRCTAR).sha1sum
echo [OK] $(SRCTAR).tar.gz
release: all
tar --exclude=*.tar.gz \
--exclude=*.sha1sum \
--exclude=*.o \
--exclude=example \
--exclude=src \
--exclude=makefile \
--exclude=makefile* \
--transform='s|^yaeos/bin|usr/bin|' \
--transform='s|^yaeos/lib|usr/lib/$(PROJ)|' \
--transform='s|^yaeos/doc|usr/share/doc/$(PROJ)|' \
--transform='s|^yaeos/include|usr/include/$(PROJ)|' \
--transform='s|^|yaeos/|' \
-czf $(RELTAR).tar.gz *
gzip -t $(RELTAR).tar.gz
sha1sum $(RELTAR).tar.gz > $(RELTAR).sha1sum
echo [OK] $(RELTAR).tar.gz
clean:
$(MAKE) -C src clean
$(MAKE) -C example clean
cleanall: clean
-rm -f -r bin lib *tar.gz *.sha1sum
help:
echo "OPTIONS: [all][p1test][static][libpcb][libasl]"
echo " [source][release][cleanall][help]"
echo
echo "[all] p1test and static"
echo "[p1test] executable p1test"
echo "[static] static libraries libpcb and libasl"
echo "[libpcb] static library libpcb"
echo "[libasl] static library libasl"
echo "[source] tar.gz of source with sha1sum (require optional deps)"
echo "[release] tar.gz of release with sha1sum (require optional deps)"
echo "[clean] clean subdirectory example/ and src/"
echo "[cleanall] clean subdirectory and remove bin/ lib/ *tar.gz *.sha1sum"
echo "[help] show this message"
echo
.PHONY: all p%test static source release clean cleanall help