diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 46 |
1 files changed, 41 insertions, 5 deletions
@@ -95,6 +95,21 @@ ifndef CHKCONFIG CHKCONFIG:=: endif +ifneq ($(wildcard .version),) + ZAPTELVERSION:=$(shell cat .version) +endif + +# CVS mirrors of SVN have .svnrevision files showing +# which SVN revision they are based on, and .svnbranch +# showing the branch they are made from +ifneq ($(wildcard .svnrevision),) + ZAPTELVERSION:=SVN-$(shell cat .svnbranch)-r$(shell cat .svnrevision) +else + ifneq ($(wildcard .svn),) + ZAPTELVERSION=SVN-$(shell build_tools/make_svn_branch_name) + endif +endif + TZOBJS:=zonedata.lo tonezone.lo LIBTONEZONE_SO:=libtonezone.so LIBTONEZONE_SO_MAJOR_VER:=1 @@ -137,13 +152,20 @@ obj-m := $(MODULESO) MOD_DESTDIR:=zaptel +version.h: FORCE + ZAPTELVERSION="${ZAPTELVERSION}" build_tools/make_version_h > $@.tmp + if cmp -s $@.tmp $@ ; then echo; else \ + mv $@.tmp $@ ; \ + fi + rm -f $@.tmp + devel: tor2ee tests: patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify timertest tor2.o: tor2-hw.h tor2fw.h zaptel.h -zaptel.o: zaptel.h digits.h arith.h sec.h mec.h sec-2.h mec2.h mec3.h zconfig.h +zaptel.o: zaptel.h digits.h arith.h sec.h mec.h sec-2.h mec2.h mec3.h zconfig.h version.h torisa.o: zaptel.h torisa.h @@ -206,7 +228,7 @@ gendigits: gendigits.o zaptel.c: tones.h -prereq: tones.h tor2fw.h radfw.h +prereq: tones.h tor2fw.h radfw.h version.h zttool.o: zttool.c zaptel.h @@ -400,12 +422,24 @@ config: update: @if [ -d .svn ]; then \ echo "Updating from Subversion..." ; \ - svn update -q; \ + svn update | tee update.out; \ + rm -f .version; \ + if [ `grep -c ^C update.out` -gt 0 ]; then \ + echo ; echo "The following files have conflicts:" ; \ + grep ^C update.out | cut -b4- ; \ + fi ; \ + rm -f update.out; \ elif [ -d CVS ]; then \ echo "Updating from CVS..." ; \ - cvs -q -z3 update -Pd; \ + cvs -q -z3 update -Pd | tee update.out; \ + rm -f .version; \ + if [ `grep -c ^C update.out` -gt 0 ]; then \ + echo ; echo "The following files have conflicts:" ; \ + grep ^C update.out | cut -d' ' -f2- ; \ + fi ; \ + rm -f update.out; \ else \ - echo "Not under version control"; \ + echo "Not under version control"; \ fi clean: @@ -421,3 +455,5 @@ clean: rm -f fxotune rm -f core rm -f ztcfg-shared fxstest + +FORCE: |