1 |
# |
2 |
# $Id$ |
3 |
# Version: $Rev$ |
4 |
# LastMod: $Date$ |
5 |
# Source: $URL$ |
6 |
# |
7 |
|
8 |
|
9 |
####################################################### |
10 |
# |
11 |
# General settings |
12 |
# |
13 |
####################################################### |
14 |
|
15 |
.PHONY: release minorversion majorversion tagversion |
16 |
.PHONY: pack rpm pkg prep clean dist userdoc apidoc check |
17 |
.PHONY: checkmndfiles checkcfgtags checkdprfiles |
18 |
.PHONY: checksrctags header help tagstable markobsolete |
19 |
|
20 |
#################################################################### |
21 |
# Linux specific settings |
22 |
#################################################################### |
23 |
# |
24 |
# |
25 |
|
26 |
CFG_MK = config.mk |
27 |
include $(CFG_MK) |
28 |
_module = $(NAME) |
29 |
_vpfx = $(NAME)_ |
30 |
_vtag = $(subst -,_,$(subst .,_,$(_vpfx)$(VERSION)$(BRANCH))) |
31 |
_prodname = $(NAME)-$(VERSION)$(BRANCH) |
32 |
_prodtar = $(_prodname).src.tgz |
33 |
|
34 |
# if INSTALLPREFIX is defined, install files go there. |
35 |
# Otherwise use TARGPREFIX also as place to install files. |
36 |
|
37 |
ifeq ($(INSTALLPREFIX),) |
38 |
INSTALLPREFIX := $(TARGPREFIX) |
39 |
endif |
40 |
|
41 |
# some SVN commands (ckeckout, update, commit) are by default quiet unless |
42 |
# SVN_VERB is defined |
43 |
_svn := svn --quiet |
44 |
ifneq ($(SVN_VERB),) |
45 |
_svn := svn |
46 |
endif |
47 |
|
48 |
_os := $(shell uname -s) |
49 |
_date := $(shell date '+%d/%m/%y %H:%M') |
50 |
|
51 |
############################################################################### |
52 |
# Macros |
53 |
############################################################################### |
54 |
|
55 |
# _error, message |
56 |
# _warn, message |
57 |
# _fatal,err msg,exit code: print "err msg" and quit with "exit code" (the if |
58 |
# clause is just used to group the commands) |
59 |
_fatal = if true; then echo "[FATAL] $(1)">&2; exit $(2); fi |
60 |
_error = echo "[ERROR] $(1)">&2 |
61 |
_warn = echo "[WARN] $(1)">&2 |
62 |
|
63 |
############################################################################### |
64 |
# SVN |
65 |
############################################################################### |
66 |
_SVN_BRNCH_SDIR := branches |
67 |
_SVN_TAG_SDIR := tags |
68 |
_SVN_TRNK_SDIR := trunk |
69 |
_SVN_ROOT_PATH := $(shell svn info | grep "Repository Root" | awk '{print $NF}') |
70 |
|
71 |
################################################################### |
72 |
# Create linux specific build directories |
73 |
################################################################### |
74 |
|
75 |
envdir:: $(_srcrpmdir) $(_rpmdir) |
76 |
$(_srcrpmdir): |
77 |
_rpmbuild := $(shell [ -x /usr/bin/rpmbuild ] && echo rpmbuild || echo rpm) |
78 |
_builddir := $(shell rpm --eval %_builddir) |
79 |
_specdir := $(shell rpm --eval %_specdir) |
80 |
_sourcedir := $(shell rpm --eval %_sourcedir) |
81 |
_srcrpmdir := $(shell rpm --eval %_srcrpmdir) |
82 |
_rpmdir := $(shell rpm --eval %_rpmdir) |
83 |
|
84 |
|
85 |
_rpm := $(_rpmbuild) --quiet |
86 |
ifneq ($(RPM_VERB),) |
87 |
_rpm := $(_rpmbuild) |
88 |
endif |
89 |
mkdir -p $(_srcrpmdir) |
90 |
$(_rpmdir): |
91 |
mkdir -p $(_rpmdir) |
92 |
|
93 |
#################################################################### |
94 |
# Create new release/version/majorversion |
95 |
#################################################################### |
96 |
# |
97 |
# These targets update the X.Y.Z components of the version in the |
98 |
# config file and then commit the current version, tagging all |
99 |
# files with the release number from the config file. Also |
100 |
# wires the current date and time into the config file. Also |
101 |
# adds an entry to the ChangeLog. |
102 |
|
103 |
# check that the requested operation is allowed: |
104 |
# - refuse to run if SVN passwords/credentials caching is off |
105 |
# - forbid committing in tags/ directory |
106 |
|
107 |
release: config.tmp |
108 |
@echo '${_SVN_ROOT_PATH}' |
109 |
|
110 |
minorversion: _checkop config.tmp |
111 |
@echo '[INFO] increasing minorversion number x.<X>.x and timestamp..' |
112 |
@perl <config.tmp >$(CFG_MK) -e 'while (<>) ' \ |
113 |
-e '{ s/^(VERSION=\d+\.)(\d+)(\..*)$$/$$1.($$2+1).".0"/e;' \ |
114 |
-e ' s/^(RELEASE=)(\d+)(.*)$$/$$1."1".$$3/e; print; }' |
115 |
@$(MAKE) tagversion |
116 |
|
117 |
majorversion: _checkop config.tmp |
118 |
@echo '[INFO] increasing majorversion number <X>.x.x and timestamp..' |
119 |
@perl <config.tmp >$(CFG_MK) -e 'while (<>)' \ |
120 |
-e '{ s/^(VERSION=)(\d+)(\..*)$$/$$1.($$2+1).".0.0"/e;' \ |
121 |
-e ' s/^(RELEASE=)(\d+)(.*)$$/$$1."1".$$3/e; print; }' |
122 |
@$(MAKE) tagversion |
123 |
|
124 |
config.tmp: $(CFG_MK) |
125 |
@$(_svn) update . |
126 |
@sed <$(CFG_MK) >config.tmp '/^DATE=/d' |
127 |
@echo 'DATE=$(_date)' >>config.tmp |
128 |
@cp $(CFG_MK) $(CFG_MK)~ |
129 |
|
130 |
tagversion: _checkop |
131 |
@echo "[INFO] svn committing new release: $(VERSION)" |
132 |
@rm -f config.tmp |
133 |
@perl -e '$$date=`date +%Y-%m-%d`;' \ |
134 |
-e 'chomp($$date);' \ |
135 |
-e '$$login=getlogin();' \ |
136 |
-e '$$logstr="<unknown>";' \ |
137 |
-e '$$logstr=(getpwnam($$login))[6] if defined $$login;' \ |
138 |
-e 'print $$date." $$logstr\n\n"; '\ |
139 |
-e 'print "\t* Release: $(NAME)-$(VERSION)\n";' >ChangeLog.tmp |
140 |
@if [ "$(EDITOR)" -a -x "$(EDITOR)" ]; then \ |
141 |
perl -e 'print "\t- [your comment here]"' >>ChangeLog.tmp; \ |
142 |
$(EDITOR) ChangeLog.tmp; \ |
143 |
perl -e '$$/=undef; $$text=<>; $$text =~ s/\s*\n*$$//s;' \ |
144 |
-e 'print "$$text\n\n"' < ChangeLog.tmp > ChangeLog.tmp2; \ |
145 |
mv ChangeLog.tmp2 ChangeLog.tmp; \ |
146 |
else \ |
147 |
echo "[INFO] Enter ChangeLog comment (hit CTRL+D to stop):"; \ |
148 |
perl -e '$$text=""; while(<>) { $$text .= "\t$$_" };' \ |
149 |
-e '$$text =~ s/^\s*(.+?)\s*\n*$$/$$1/s;' \ |
150 |
-e 'chomp($$text); print "\t- $$text\n\n"' >>ChangeLog.tmp; \ |
151 |
fi |
152 |
@if [ ! -r ChangeLog ] ; then touch ChangeLog ; $(_svn) add ChangeLog ; fi |
153 |
@cp ChangeLog.tmp /tmp/ChangeLog.tmp.$$$ |
154 |
@cat ChangeLog >>ChangeLog.tmp |
155 |
@mv ChangeLog.tmp ChangeLog |
156 |
@$(_svn) commit -F /tmp/ChangeLog.tmp.$$$ |
157 |
@rm -f /tmp/ChangeLog.tmp.$$$ |
158 |
@$(MAKE) _tag_dir=$(_vtag) svntag |
159 |
@$(MAKE) _tag_dir=latest _trg_tag=$(_vtag) svnextag |
160 |
@$(MAKE) tagstable |
161 |
|
162 |
# auxiliary target to build an SVN tag. Input parameter is _tag_dir, which |
163 |
# is the leaf subdirectory (intermediate subdirectories are built transparently); |
164 |
# _co_root is the checkout root, |
165 |
# _co_locl is the local path to the module in the checkout |
166 |
# _co_subd is the sub-path to the module in the checkout |
167 |
# that is: |
168 |
# $pwd == $_co_root/$_co_locl == $_co_root/$_co_subd/$_module |
169 |
# |
170 |
_svn_root = $(shell svn info | sed -nr 's/^.+Root:\s+(\S+)$$/\1/ p') |
171 |
_svn_url = $(shell svn info | sed -nr 's/^URL:\s+(\S+)$$/\1/ p') |
172 |
_co_locl = $(shell echo $(_svn_url) | sed -nr 's%^\S+?/$(_SVN_TRNK_SDIR)/%% p') |
173 |
_co_subd = $(shell echo $(_co_locl) | sed -nr 's%/$(_module)$$%% p') |
174 |
# don't ask me why this doesn't work... |
175 |
# _co_root = $(shell echo -n $(PWD) |\ |
176 |
# sed -r 's%^(.+?)/(\S*$(_SVN_TRNK_SDIR)/)?$(_co_locl)$$%\1%' | sed -r 's%/*$$%%') |
177 |
_co_root = $(shell pwd | \ |
178 |
perl -e '$$a=<>; $$a=~s%^(\S+?)/([^/]*$(_SVN_TRNK_SDIR)/)?$(_co_locl)$$%$$1%; print $$a' |\ |
179 |
sed -r 's%/*$$%%') |
180 |
ifneq ($(QTTR_CO_ROOT),) |
181 |
_co_root = $(QTTR_CO_ROOT) |
182 |
endif |
183 |
svntag: _checkop |
184 |
@if [ "$(DEBUG)" ]; then\ |
185 |
echo "[DEBUG] _svn_root=$(_svn_root)" >&2;\ |
186 |
echo "[DEBUG] _svn_url=$(_svn_url)" >&2;\ |
187 |
echo "[DEBUG] _co_locl=$(_co_locl)" >&2;\ |
188 |
echo "[DEBUG] _co_subd=$(_co_subd)" >&2;\ |
189 |
echo "[DEBUG] _co_root=$(_co_root)" >&2;\ |
190 |
fi |
191 |
@[ "$(_tag_dir)" ] || $(call _fatal,no tag directory specified,1) |
192 |
@[ "$(_co_root)" -a "$(_svn_root)" ]\ |
193 |
|| $(call _fatal,checkout and/or SVN root not defined,2) |
194 |
@echo "[INFO] svn tagging new release: $(_tag_dir)" |
195 |
@src_path=$$PWD;\ |
196 |
dst_url=$(_svn_root)/$(_SVN_TAG_SDIR)/$(_co_subd)/$(_module);\ |
197 |
dst_path=$(_co_root)/$(_SVN_TAG_SDIR)/$(_co_subd)/$(_module);\ |
198 |
[ "$(DEBUG)" ] && echo "[DEBUG] dst_url=$$dst_url" >&2;\ |
199 |
[ "$(DEBUG)" ] && echo "[DEBUG] dst_path=$$dst_path" >&2;\ |
200 |
aux=$(_co_subd);\ |
201 |
[ "$(DEBUG)" ] && echo "[DEBUG] aux=$$aux" >&2;\ |
202 |
saux='';\ |
203 |
made_sdir=0;\ |
204 |
tag_mod_root='';\ |
205 |
while [ "$$aux" ]; do\ |
206 |
sdir=`echo -n $$aux | sed -nr 's%^([^/]+).*?$$%\1% p'`;\ |
207 |
[ $$made_sdir -eq 0 ] && tag_mod_root=$$sdir;\ |
208 |
[ "$(DEBUG)" ] && echo "[DEBUG] sdir=$$sdir" >&2;\ |
209 |
saux=$$saux/$$sdir;\ |
210 |
dst_surl=$(_svn_root)/$(_SVN_TAG_SDIR)/$$saux;\ |
211 |
[ "$(DEBUG)" ] && echo "[DEBUG] dst_surl=$$dst_surl" >&2;\ |
212 |
if (svn info $$dst_surl 2>&1 | egrep "\(Not a valid URL\)") >/dev/null; then\ |
213 |
$(_svn) mkdir $$dst_surl -m "Made directory $(_SVN_TAG_SDIR)$$saux" \ |
214 |
|| $(call _fatal,$$dst_surl: cant make svn dir,3);\ |
215 |
fi;\ |
216 |
aux=`echo -n $$aux | sed -nr "s%^$$sdir/%% p"`;\ |
217 |
[ "$(DEBUG)" ] && echo "[DEBUG] aux=$$aux" >&2;\ |
218 |
made_sdir=1;\ |
219 |
done;\ |
220 |
if (svn info $$dst_url 2>&1 | egrep "\(Not a valid URL\)") >/dev/null; then\ |
221 |
[ "$(DEBUG)" ] && echo "[DEBUG] svn mkdir $$dst_url" >&2;\ |
222 |
$(_svn) mkdir $$dst_url -m "Made directory $(_SVN_TAG_SDIR)/$(_co_subd)/$(_module)"\ |
223 |
|| $(call _fatal,$$dst_url: cant make svn dir,4);\ |
224 |
fi;\ |
225 |
[ "$(DEBUG)" ] && echo "[DEBUG] svn copy $$src_path $$dst_url/$(_tag_dir)" >&2;\ |
226 |
$(_svn) copy $$src_path $$dst_url/$(_tag_dir) -m "Added tag $(_module)/$(_tag_dir)" \ |
227 |
|| $(call _fatal,$$src_path: cant svn copy to $$dst_url/$(_tag_dir),5);\ |
228 |
[ "$(DEBUG)" ] && echo "[DEBUG] svn co $$dst_url/$(_tag_dir) $$dst_path/$(_tag_dir)" >&2;\ |
229 |
$(_svn) checkout $$dst_url/$(_tag_dir) $$dst_path/$(_tag_dir) \ |
230 |
|| $(call _fatal,$$dst_url/$(_tag_dir): cant svn check out,6) |
231 |
|
232 |
|
233 |
svnextag: _checkop |
234 |
@[ "$(_tag_dir)" ] || $(call _fatal,no tag directory specified,1) |
235 |
@[ "$(_trg_tag)" ] || $(call _fatal,no target tag specified,2) |
236 |
@echo "[INFO] svn tagging external reference: $(_tag_dir) -> $(_trg_tag)" |
237 |
@[ "$(_co_root)" -a "$(_svn_root)" ]\ |
238 |
|| $(call _fatal,checkout and/or SVN root not defined,3) |
239 |
@src_sdir=$(_SVN_TAG_SDIR)/$(_co_subd)/$(_module)/$(_trg_tag);\ |
240 |
src_url=$(_svn_root)/$$src_sdir;\ |
241 |
src_path=$(_co_root)/$$src_sdir;\ |
242 |
dst_sdir=$(_SVN_TAG_SDIR)/$(_co_subd)/$(_module)/$(_tag_dir);\ |
243 |
dst_url=$(_svn_root)/$$dst_sdir;\ |
244 |
dst_path=$(_co_root)/$$dst_sdir;\ |
245 |
if (svn info $$dst_url 2>&1 | egrep "\(Not a valid URL\)") >/dev/null; then\ |
246 |
$(_svn) mkdir $$dst_url -m "Made directory $$dst_surl"\ |
247 |
|| $(call _fatal,$$dst_surl: cant make svn dir,4);\ |
248 |
cd $(_co_root)/$(_SVN_TAG_SDIR);\ |
249 |
$(_svn) checkout $$dst_url $$dst_path \ |
250 |
|| $(call _fatal,$$dst_url: cant svn check out,5);\ |
251 |
else\ |
252 |
$(_svn) checkout $$dst_url $$dst_path \ |
253 |
|| $(call _fatal,$$dst_url: cant svn check out,6);\ |
254 |
$(_svn) propdel svn:externals $$dst_path \ |
255 |
|| $(call _fatal,$$dst_path: cant delete svn:externals,7);\ |
256 |
rm -rf $$dst_path/*;\ |
257 |
fi;\ |
258 |
ext_rev=`svn info $$src_url | sed -nr 's%^Revision:\s+(\S+)$$%\1% p'`;\ |
259 |
[ "$$ext_rev" ] || $(call _fatal,cant determine external revision,8);\ |
260 |
$(_svn) propset svn:externals "$(_trg_tag) -r$$ext_rev $$src_url" $$dst_path \ |
261 |
|| $(call _fatal,$$dst_path: cant set svn:externals,9);\ |
262 |
$(_svn) commit $$dst_path -m "Added tag $(_module)/$(_tag_dir) -> $(_trg_tag)" \ |
263 |
|| $(call _fatal,$$dst_path: cant svn commit,10);\ |
264 |
$(_svn) update $$dst_path || $(call _fatal,$$dst_path: cant svn update,11) |
265 |
|
266 |
|
267 |
tagstable: _checkop |
268 |
@echo "[INFO] tagging 'stable' release" |
269 |
@prompt='Do you want to tag this release as 'stable'? [no]: ';\ |
270 |
while read -p "$$prompt" ans || exit 1; do\ |
271 |
[ -z $$ans ] && ans='no';\ |
272 |
case $$ans in\ |
273 |
[Yy]|[Yy]es)\ |
274 |
_tag_dir=stable _trg_tag=$(_vtag) $(MAKE) svnextag;\ |
275 |
break;\ |
276 |
;;\ |
277 |
[Nn]|[Nn]o)\ |
278 |
break;\ |
279 |
;;\ |
280 |
*)\ |
281 |
prompt='Answer either "yes" or not at all: ';\ |
282 |
esac;\ |
283 |
done |
284 |
|
285 |
|
286 |
# mark as OBSOLETE (no SVN tag is added). A message to be added to config.mk |
287 |
# can be passed through the variable OBSOLETE_MSG |
288 |
markobsolete: _checkop |
289 |
@[ -w config.mk ]\ |
290 |
|| $(call _fatal,config.mk: file missing or not writable,1) |
291 |
@if [ "`sed -nr '/^\s*OBSOLETE/ p' config.mk`" ]; then\ |
292 |
$(call _fatal,already marked as OBSOLETE,2);\ |
293 |
fi |
294 |
@echo "[INFO] marking as OBSOLETE" |
295 |
@obs_msg='1';\ |
296 |
if [ ! -z "$$OBSOLETE_MSG" ]; then\ |
297 |
obs_msg="$$OBSOLETE_MSG";\ |
298 |
fi;\ |
299 |
echo OBSOLETE="$$obs_msg" >> config.mk |
300 |
@$(_svn) commit -m 'Module marked as OBSOLETE'\ |
301 |
|| $(call _fatal,cant svn commit,3) |
302 |
|
303 |
|
304 |
|
305 |
#################################################################### |
306 |
# Build distributions in tar & RPM/PKG format |
307 |
#################################################################### |
308 |
# |
309 |
# These targets make distribution tar files and PKGs/RPMs from the |
310 |
# CVS repository, using the version declared in the config file. |
311 |
# The checked-out files in the current directory are neither |
312 |
# modified, nor read (apart from the config file). |
313 |
# |
314 |
# "pack" and "rpm" built from the sources in the current directory. |
315 |
# |
316 |
# |
317 |
# The prep:: target allows the including makefile to specify actions |
318 |
# required to process the files at distribution pack time. |
319 |
# |
320 |
# These targets make distribution tar files and PKGs/RPMs based on the |
321 |
# checked-out sources in the current directory. No connection to |
322 |
# the CVS repository is required, and the files do not need to be |
323 |
# committed. The RPM version numbers are generated from the |
324 |
# version number specified in the config file. |
325 |
# |
326 |
|
327 |
pack: envdir |
328 |
@echo packing distribution... |
329 |
@rm -rf $(_builddir)/$(_prodname) |
330 |
@rm -f $(_sourcedir)/$(_prodtar) |
331 |
@mkdir -p $(_builddir)/$(_prodname) |
332 |
@find . -path '*CVS*' -prune -o -type f -print >files.tmp |
333 |
@tar cfT - files.tmp |(cd $(_builddir)/$(_prodname) ; tar xf -) |
334 |
@rm -f files.tmp |
335 |
@[ ! -f specfile.spec -a -f specfile.cin ] \ |
336 |
&& cp specfile.cin \ |
337 |
$(_builddir)/$(_prodname)/specfile.spec \ |
338 |
|| : ; |
339 |
@cp cl2rpm \ |
340 |
$(_builddir)/$(_prodname)/ > /dev/null 2>&1 \ |
341 |
|| : ; |
342 |
@cd $(_builddir)/$(_prodname) ; \ |
343 |
sed <$(CFG_MK) >config.tmp \ |
344 |
-e 's%^RELEASE=\(.*\)%RELEASE=\1%' \ |
345 |
-e 's%^VERSION=.*%&$(BRANCH)%' ; \ |
346 |
mv config.tmp $(CFG_MK) ; \ |
347 |
echo 'TARFILE=$(_prodtar)' >>$(CFG_MK) ; \ |
348 |
echo 'PROD=\#' >>$(CFG_MK) ; \ |
349 |
$(MAKE) config.sh ;\ |
350 |
$(MAKE) prep ;\ |
351 |
test -n "$(_test_dep)" && rm -f $(_test_dep) ;\ |
352 |
rm -f config.sh |
353 |
@cd $(_builddir) ; tar czf $(_sourcedir)/$(_prodtar) $(_prodname) |
354 |
|
355 |
filelist: install |
356 |
# |
357 |
# ---- DO NOT MODIFY BELOW THIS LINE --- NEEDED FOR SPECFILE |
358 |
# |
359 |
@find $(INSTALLPREFIX) -type d | sed -e 's^$(INSTALLPREFIX)g' -e 's/^/%dir /' >> $(INSTALLPREFIX)/.filelist |
360 |
@find $(INSTALLPREFIX) ! -type d -a ! -name ".filelist" | sed -e 's^$(INSTALLPREFIX)g' >> $(INSTALLPREFIX)/.filelist |
361 |
@echo File found in distribution |
362 |
@cat $(INSTALLPREFIX)/.filelist |
363 |
|
364 |
spec: pack |
365 |
@echo generating specfile.spec ... |
366 |
@cd $(_builddir)/$(_prodname) ; \ |
367 |
$(MAKE) config.sh ;\ |
368 |
./config.sh <specfile.spec >$(_specdir)/$(_prodname).spec |
369 |
@test -f ChangeLog && \ |
370 |
cl2rpm ChangeLog \ |
371 |
>>$(_specdir)/$(_prodname).spec || true |
372 |
|
373 |
rpm: spec |
374 |
@echo building rpm ... |
375 |
@cd $(_specdir) ; $(_rpmbuild) -ba $(_specdir)/$(_prodname).spec |
376 |
|
377 |
pkg: spec |
378 |
@echo building pkg ... |
379 |
@cd $(_specdir) ; $(_pkgbuild) -f $(_specdir)/$(_prodname).spec |
380 |
|
381 |
prep:: |
382 |
|
383 |
##################################################################### |
384 |
# Create substitution script |
385 |
#################################################################### |
386 |
# |
387 |
# This target reads the config file and creates a shell script which |
388 |
# can substitute variables of the form @VAR@ for all config |
389 |
# variables VAR. The messing around with the temporary makefile is |
390 |
# to ensure that any recursive or external references in the |
391 |
# variable values are evaluated by "make" in the same context as |
392 |
# when the config file is included in the makefile. |
393 |
|
394 |
config.sh: Makefile $(_test_dep) |
395 |
@cp /dev/null makefile.tmp |
396 |
@echo include $(CFG_MK) >>makefile.tmp |
397 |
@echo dumpvars: >>makefile.tmp |
398 |
@cat $(CFG_MK) paths.mk | \ |
399 |
perl >>makefile.tmp -e 'my $$fmt = "\t\@echo \"-e \\\"s\@%s\@\$$(%s)g\\\" \\\\\"" ; while (<>) { $$v{$$1}=1 if /^([A-Za-z0-9_]+)\s*:?=.*$$/; } map { printf "$$fmt >>config.sh\n", $$_, $$_; } sort(keys(%v)); print "\n"; ' |
400 |
@echo '#!/bin/sh' >config.sh |
401 |
@echo 'sed \' >>config.sh |
402 |
@$(MAKE) -f makefile.tmp dumpvars >/dev/null |
403 |
@echo ' -e "s/\@MSG\@/ ** Generated file : do not edit **/"'>>config.sh |
404 |
@chmod oug+x config.sh |
405 |
@rm makefile.tmp |
406 |
|
407 |
#################################################################### |
408 |
# Configure |
409 |
#################################################################### |
410 |
|
411 |
%:: %.cin config.sh |
412 |
@echo configuring $@ ... |
413 |
@rm -f $@ ; cp $< $@ |
414 |
@./config.sh <$< >$@ ; chmod oug-w $@ |
415 |
|
416 |
%.$(MANSECT):: %.$(MANSECT).man.cin |
417 |
@echo creating $@ ... |
418 |
@./config.sh <$< >$@ ; chmod oug-w $@ |
419 |
|
420 |
configure: $(shell find . -name \*\.cin 2>/dev/null | sed -e 's/.cin//' || echo) |
421 |
|
422 |
#################################################################### |
423 |
# Install |
424 |
#################################################################### |
425 |
|
426 |
install: configure |
427 |
@echo installing in $(INSTALLPREFIX) ... |
428 |
# |
429 |
# MODIFY location of installed scripts/binaries here |
430 |
# |
431 |
|
432 |
ifdef MYMODS |
433 |
@mkdir -p $(INSTALLPREFIX)/$(MODSUFFIX) |
434 |
for i in $(MYMODS) ; do \ |
435 |
install -m 0444 $$i $(INSTALLPREFIX)/$(MODSUFFIX) ; \ |
436 |
done || : |
437 |
endif |
438 |
|
439 |
ifdef MYDOCS |
440 |
@mkdir -p $(INSTALLPREFIX)/$(DOCSUFFIX) |
441 |
for i in $(MYDOCS) ; do \ |
442 |
install -m 0444 $$i $(INSTALLPREFIX)/$(DOCSUFFIX) ; \ |
443 |
done || : |
444 |
endif |
445 |
|
446 |
ifdef MYCONFIGS |
447 |
@mkdir -p $(INSTALLPREFIX)/$(CONFIGSUFFIX) |
448 |
@for i in $(MYCONFIGS) ; do \ |
449 |
install -m 0444 $$i $(INSTALLPREFIX)/$(CONFIGSUFFIX) ; \ |
450 |
done || : |
451 |
endif |
452 |
|
453 |
ifdef MYSCRIPTS |
454 |
@mkdir -p $(INSTALLPREFIX)/$(SCRIPTSUFFIX) |
455 |
@for i in $(MYSCRIPTS) ; do \ |
456 |
install -m 0555 $$i $(INSTALLPREFIX)/$(SCRIPTSUFFIX) ; \ |
457 |
done || : |
458 |
endif |
459 |
|
460 |
ifdef MYTESTFILES |
461 |
@mkdir -p $(INSTALLPREFIX)/$(TESTSUFFIX) |
462 |
@for i in $(MYTESTFILES) ; do \ |
463 |
install -m 0555 $$i $(INSTALLPREFIX)/$(TESTSUFFIX) ; \ |
464 |
done || : |
465 |
endif |
466 |
|
467 |
ifdef MYPLUGINS |
468 |
@mkdir -p $(INSTALLPREFIX)/$(PLUGINSUFFIX) |
469 |
@for i in $(MYPLUGINS) ; do \ |
470 |
install -m 0555 $$i $(INSTALLPREFIX)/$(PLUGINSUFFIX) ; \ |
471 |
done || : |
472 |
endif |
473 |
|
474 |
#################################################################### |
475 |
|
476 |
clean:: |
477 |
@echo cleaning common files ... |
478 |
@rm -f config.sh config.tex |
479 |
@rm -f `find . -name '*~'` |
480 |
@rm -f `find . -name '*#'` |
481 |
@rm -f `find . -name '*.tmp'` |
482 |
@rm -f `find . -name \*\.cin 2>/dev/null | sed -e 's/.cin//'` |
483 |
dist: pack |
484 |
|
485 |
|
486 |
|