Makefile.dev 2.19 KB
Newer Older
1
2
#######################################################################################
# Workflow:
3
# C=make cia ;  A=make amend ; U=make uv ; P=make opam-rel
erwan's avatar
erwan committed
4
5
6
7
# - to make sure the sha and the version are good, one should never
#   do U and then A.
# - to make sure gtit is not confused, one should never do A and the P
#
8
# therefore, to avoid such problems, legal trace are defined by this automata:
9
10
# 0 -C-> 1
# 1 -A-> 1
erwan's avatar
erwan committed
11
12
# 1 -P-> 2
# 2 -U-> 0
13
14
# 1 -U-> 0
# to implement such a workflow, C puts a lock (state 1) and U removes it (state 0)
erwan's avatar
erwan committed
15

16

17
###############################
18
# typical workflow:
erwan's avatar
erwan committed
19
#    uv -> [cia -> amend*]+ -> push ->
20
21
22
#       wait for gitlab release job -> pull (to get the release tag) 
# and then; optionnaly, to release an opam version:
#       opam-rel
23
24
25

uv:update_version
update_version:
26
	git pull
27
28
29
30
31
32
33
34
35
	rm -f lutin/src/version.ml
	make lutin/src/version.ml
	cp _oasis _oasis.save
	cat _oasis.save | sed "s/^Version:.*/Version:     $(VERSION)/" > _oasis
	rm -f committed
	git add lutin/src/version.ml  _oasis
	make clean && make


erwan's avatar
erwan committed
36
cia: test man cia-no-test 
37
cia-no-test:
38
39
40
41
42
	test -f committed && \
   echo "*** I won't commit!\n*** until you 'make update_version'!" \
      || (git commit -a -F log && touch committed)


43
push: opam-test
44
	git push 
erwan's avatar
erwan committed
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
amend:
	test -f committed && git commit -a -F log --amend 

dif:
	git --no-pager diff  --color-words
diff:dodiff
	echo "il y a $(shell grep "+" diff.diff | wc -l) + et $(shell grep "-" diff.diff | wc -l) -"

dodiff:
	git diff HEAD -w  > diff.diff 


# diff of the lastly commited change
cdiff:
	git diff -w "HEAD^" HEAD > diff.diff


###############################
# tags

OTAGS=otags
# otags don't manage to parse gnuplotRif.ml
NO_TAGS=gnuplotRif.ml
tags:
	$(OTAGS) -v $(shell ocamlc -where)/*.mli  $(shell ls src/*.ml | grep -v $(NO_TAGS))


###############################
# opam-ing

NAME=lutin
78

79
80
81
82
83
opam-rel :
	make-opam-pack $(NAME)

opam-test :
	make-opam-pack $(NAME) -test
84

85
86
87
88
opam-pr:
	cp -rf $(OPAM_DIR) /home/jahier/local/opam-repository/packages/lutin/


89
.PHONY:install $(WWW)/pool/$(PACKNAME).tgz  $(WWWTEST)/pool/$(PACKNAME).tgz
90
91
92
93
94
95
96
97
98
oi:install
or:reinstall
ob:build
oc:clean
clean:
	ocaml setup.ml -clean
	rm -f setup.data
	cd polka; make clean
	cd lutin-utils/src/ ; make clean