-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (43 loc) · 1.43 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
# $FreeBSD$
CP?= /bin/cp
CUT?= /usr/bin/cut
MKDIR?= /bin/mkdir
PYTHON?=/usr/bin/env python3
RM?= /bin/rm
SCRIPT= rclint.py
SED?= /usr/bin/sed
TAR?= /usr/bin/tar
VER!= ${PYTHON} ${SCRIPT} --version 2>&1
.for V in ${VER}
VERSION?= ${V:C,^([^-]+).*,\1,}
.endfor
VERSION_MAJOR= ${VERSION:C,([0-9]+).*,\1,}
VERSION_MINOR= ${VERSION:C,[0-9]+\.([0-9]+).*,\1,}
VERSION_MICRO= ${VERSION:C,[0-9]+\.[0-9]+\.([0-9]+).*,\1,}
FILES= ${SCRIPT} errors.en problems.en
.PHONY: majorbump minorbump microbump release
all:
@${ECHO} majorbump, minorbump, microbump and tarball are valid targets
majorbump:
M=$$(expr ${VERSION_MAJOR} + 1); \
${SED} -i '' -e "s,^\(MAJOR = \).*,\1$$M," ${SCRIPT}
${SED} -i '' -e "s,^\(MINOR = \).*,\10," ${SCRIPT}
${SED} -i '' -e "s,^\(MICRO = \).*,\10," ${SCRIPT}
minorbump:
M=$$(expr ${VERSION_MINOR} + 1); \
${SED} -i '' -e "s,^\(MINOR = \).*,\1$$M," ${SCRIPT}
${SED} -i '' -e "s,^\(MICRO = \).*,\10," ${SCRIPT}
microbump:
M=$$(expr ${VERSION_MICRO} + 1); \
${SED} -i '' -e "s,^\(MICRO = \).*,\1$$M," ${SCRIPT}
tarball:
${MKDIR} rclint-${VERSION} && \
${CP} ${FILES} rclint-${VERSION} && \
${TAR} cvfz rclint-${VERSION}.tar.gz rclint-${VERSION} && \
${RM} -rf rclint-${VERSION}
if [ "`id -un`@`hostname -s`" = "crees@pegasus" ]; then \
sudo cp rclint-${VERSION}.tar.gz /usr/local/www/data/dist/rclint/ &&\
scp rclint-${VERSION}.tar.gz freefall.FreeBSD.org:public_distfiles/rclint/; \
fi
clean:
${RM} -f rclint-*.*.*.tar.gz