Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
132 lines (122 loc) · 5.11 KB
/
Copy pathMakefile
File metadata and controls
132 lines (122 loc) · 5.11 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# This file (makefile) was created by Ron Rechenmacher <ron@fnal.gov> on
# Jun 20, 2001. "TERMS AND CONDITIONS" governing this file are in the README
# or COPYING file. If you do not have such a file, one can be obtained by
# contacting Ron or Fermi Lab in Batavia IL, 60510, phone: 630-840-3000.
# $RCSfile: Makefile,v $
# $Revision: 1.41 $
# $Date: 2025/01/14 17:21:32 $
# NOTE: freeze utility is from python distribution directory tree; not
# the installation tree.
# Note: when making frozen, if you get the warning "unknown modules remain"
# and the list contains more then "pcre strop"
# then you may have to rebuild python after uncommenting something in
# the python distribution's Modules/Setup file.
#PYDIST_V=2.2.3
#PYDIST_V=2.5.2 # could not get to work 2010.05.07 from tststnd2.fnal.gov -
# fall back to 2.2.3
#PYDIST_V=2.4.3
PYDIST_V=2.4.6
UPS_PY_V := v$(shell echo ${PYDIST_V} | sed 's/\./_/g')
SYS_PY_V := $(shell echo ${PYDIST_V} | grep -o '^[0-9]\.[0-9]')
default:
@echo make targets are: `grep '^[a-z]*:' Makefile`
.PHONY: sources
sources:
@echo "make sources"
cd rpm; ./maketar
srpm: sources
rpmbuild -bs --define '_sourcedir .' --define '_srcrpmdir .' rgang.spec
frozen:
if [ -f /usr/lib/python${SYS_PY_V}/Tools/freeze/freeze.py ];then\
PYDIST=/usr/lib/python${SYS_PY_V};\
elif [ -f /usr/local/etc/setups.sh ];then\
. /usr/local/etc/setups.sh; setup python ${UPS_PY_V};\
if [ -d /p/python/Python-${PYDIST_V} ];then\
PYDIST=/p/python/Python-${PYDIST_V};\
export PYDIST;\
fi;\
fi;\
if [ "$$PYDIST" = "" ];then\
echo "PYDIST variable not set; unable to make frozen rgang";\
exit 1;\
fi;\
cd bin;\
type python;\
python $$PYDIST/Tools/freeze/freeze.py rgang.py;\
make && strip rgang
tar:
@if [ -d CVS ];then\
product=rgang;\
echo "I hope you remembered to:";\
echo " o make sure debugging if in main() is set correctly (\"if 1:\")";\
echo " o update README: version and date";\
echo " o update bin/rgang.py version to be same as version in README";\
echo " o cvs ci -m'some message' bin/rgang.py # so frozen is synced with .py";\
echo " o make frozen distclean";\
echo " o test: cd test;./test.sh most";\
echo " o cvs -q up;cvs ci changed file to get good comments in release notes";\
echo " o updated doc/RELEASE.NOTES:";\
echo " next_rev=vX_Y_Z # i.e. v3_8_0";\
echo " doc/cvs_rel_notes.sh --update_REL_NOTES \$$next_rev";\
echo " # message/edit the release notes file";\
echo " o update rpm/rgang.spec changelog and version to be same as version in README";\
echo " o cvs ci -m\"next rev (rev \$$next_rev)\" # for release notes";\
echo "and o cvs tag \$$next_rev";\
echo "And the <version>s specified match the version in the README.";\
echo "You quite possibly will be entering that version in response to";\
echo "the next question";\
CVSROOT=`cat CVS/Root`; export CVSROOT;\
if [ "$(TAG)" = "" ];then \
echo -n "enter a tag (or abort now) (\"HEAD\" is valid): "; read ans;\
else \
ans=$(TAG);\
fi;\
if [ ! "$$ans" ];then exit 1;fi;\
dot_ver=`echo $$ans | sed -e 's/^v//;s/_/./g'`;\
for ff in bin/rgang.py README;do \
version=`sed -n -e"/V[eE][rR][sS][iI][oO][nN][:=]/{s/.*V[eE][rR][sS][iI][oO][nN][=:][' ]*//;s/ .*//;p;}" $$ff`;\
if [ "$$version" != $$dot_ver ];then \
echo "updating version=$$version in $$ff";\
need_human_check=1;\
sed -e"/V[eE][rR][sS][iI][oO][nN][:=]/s/$$version/$$dot_ver/" -e"/^Date /s|:.*|: `date +%m/%d/%Y`|" $$ff >$$ff.xx;\
mv $$ff.xx $$ff;\
fi;\
done;\
if [ "$${need_human_check-}" ];then \
cvs -nq up | grep -v '^?';\
echo "renew the changes: cvs -q diff";\
echo "and, if appropriate: cvs ci -m'new rev'";\
exit;\
fi;\
tmpdir=/tmp;\
cd $$tmpdir;\
if [ -d $$product.$$ans ];then\
echo "removing (old/bogus?) $$tmpdir/$$product.$$ans directory";\
/bin/rm -fr $$product.$$ans;\
fi;\
if [ -f $$product.$$ans.tar ];then\
echo "removing (old/bogus?) $$tmpdir/$$product.$$ans.tar file";\
/bin/rm -fr $$product.$$ans;\
fi;\
cvs export -r $$ans -d $$product.$$ans $$product;\
tar cf $$product.$$ans.tar $$product.$$ans;\
tar czf $$product.$$ans.tgz $$product.$$ans;\
echo "tar file is $$tmpdir/$$product.$$ans.tar";\
echo "tgz file is $$tmpdir/$$product.$$ans.tgz";\
echo "After installing the product locally:";\
echo " mv /tmp/rgang.$$ans.* /p/rgang";\
echo " mv /tmp/rgang.$$ans /p/rgang/$$ans";\
echo " ups_flavor.sh --ups /p/rgang/$$ans";\
echo " ups declare -c -rrgang/$$ans -f<flavor> -mrgang.table rgang $$ans";\
echo "do:";\
echo " upd addproduct -c rgang $$ans -f<flavor>";\
else\
echo "this should be done from within a cvs checked-out tree";\
fi
clean:
find . -name '*~' -exec rm {} \;
cd bin; rm -f *~ *.o rgang
# leave frozen rgang
distclean:
find . -name '*~' -exec rm {} \;
cd bin; rm -f *.o M_* Makefile config.c frozen.c