-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
65 lines (49 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
54
55
56
57
58
59
60
61
62
63
64
65
PROJECT=mosquitto-ada
TAG=$(shell python ./helper.py bin/version)
VERSION=${PROJECT}-${TAG}
USER=$(shell python ./helper.py ~/.ssh/github.user)
ACCESS=$(shell python ./helper.py ~/.ssh/github.token)
-include Makefile.conf
all:
Makefile.conf:Makefile # IGNORE
@echo "PERFIX?=$(dir $(shell dirname ${GNATLS}))">${@}
@echo "export PATH:=${PATH}" >>${@}
all:compile test
compile:
gprbuild -p -P mosquitto.gpr
install:
gprinstall -p -P mosquitto.gpr
uninstall:
gprinstall -p -P mosquitto.gpr --uninstall
gen:src/gen/mosquitto-mosquitto_h.ads
src/gen/mosquitto-mosquitto_h.ads: # IGNORE
rm -rf src/gen
mkdir -p src/gen
cd src/gen;echo "#include <mosquitto.h>" >gen.cpp
cd src/gen;gcc -C -c -fdump-ada-spec gen.cpp -fada-spec-parent=mosquitto
cd src/gen;rm gen.*
cd src/gen;sed "s-package mosquitto-private package mosquitto-" -i mosquitto-mosquitto_h.ads
gprbuild -c -p -P mosquitto.gpr mosquitto-mosquitto_h.ads
test:
${MAKE} -C tests
clean:
rm Makefile.conf
rm .obj -rf
rm lib -rf
rm bin/* -rf
check:
@if [ ! -z "`git status --porcelain`" ] ; then \
echo Folder is not clean;\
git status;\
exit -1;\
else\
echo ready for release ${VERSION};\
fi
git pull -q
git push -q
release:check
curl --data '$(shell sed -e "s/@VERSION@/${VERSION}/" -e "s/@TAG@/${TAG}/" github-version.in)' \
"https://api.github.com/repos/${USER}/${PROJECT}/releases?access_token=${ACCESS}"
.PHONY: test-install
test-install:
${MAKE} -C test-install