Fix "make doc"
[nasm/avx512.git] / misc / makedist.sh
blobe24afdc156c52361d187ce9999d114ac09554d63
1 #!/bin/sh
2 # * THIS SCRIPT IS OBSOLETE DO NOT USE *
4 MAJORVER=`grep NASM_MAJOR_VER nasm.h | head -1 | cut -f3 -d' '`
5 MINORVER=`grep NASM_MINOR_VER nasm.h | head -1 | cut -f3 -d' '`
6 VERSION=`grep NASM_VER nasm.h | head -1 | cut -f3 -d' ' | sed s/\"//g`
7 DOSVERSION="${MAJORVER}${MINORVER}"
8 NASM_TAR_GZ=dist/nasm-${VERSION}.tar.gz
9 NASM_ZIP=dist/nasm${DOSVERSION}s.zip
10 NASM_DOS_ZIP=dist/nasm${DOSVERSION}.zip
11 NASM_DOC_ZIP=dist/nasm${DOSVERSION}d.zip
13 if [ -d dist ]; then rm -rf dist; fi
14 if [ -d nasm-${VERSION} ]; then rm -rf nasm-${VERSION}; fi
15 if [ ! -d dist ]; then mkdir dist; fi
16 if [ -f dist/nasm.tar.gz ]; then rm dist/nasm.tar.gz; fi
17 mkdir nasm-${VERSION}
18 (cd nasm-${VERSION}; ln -s ../* .;
19 rm -f nasm-${VERSION} dist Checklist GNUmakefile)
20 find nasm-${VERSION}/ -follow -name GNUmakefile > tar-exclude
21 find nasm-${VERSION}/ -follow -name RCS >> tar-exclude
22 find nasm-${VERSION}/ -follow -name '*.exe' >> tar-exclude
23 find nasm-${VERSION}/ -follow -name '*.uu' >> tar-exclude
24 find nasm-${VERSION}/ -follow -name '*,v' >> tar-exclude
25 for i in nasm-${VERSION}/doc/{nasmdoc.hpj,nasmdoc.rtf,nasmdoc.texi,Readme};
26 do echo $i; done >> tar-exclude
27 tar chvfX dist/nasm-${VERSION}.tar tar-exclude nasm-${VERSION}
28 rm -f tar-exclude
29 tar tf dist/nasm-${VERSION}.tar | (echo nasm.doc; sed \
30 -e 's:^nasm-[^/]*/::' \
31 -e 's:/$::' \
32 -e '/install-sh/d' \
33 -e '/makedist\.sh/d' \
34 -e '/exasm\.zip/d' \
35 -e '/config/d' \
36 -e '/doc\/.*\.html/d' \
37 -e '/doc\/Readme/d' \
38 -e '/doc\/nasmdoc\.ps/d' \
39 -e '/doc\/nasmdoc\.txt/d' \
40 -e '/doc\/nasmdoc\.rtf/d' \
41 -e '/doc\/nasmdoc\.hpj/d' \
42 -e '/doc\/nasmdoc\.texi/d' \
43 -e '/doc\/nasmdoc\.hlp/d' \
44 -e '/doc\/nasm\.info/d' \
45 ) | sort > zipfiles
46 sed \
47 -e '/^[^\/]*\.\(c\|h\|pl\|bas\|dat\)$/d' \
48 -e '/^doc\(\/.*\)\?/d' \
49 -e '/standard\.mac/d' \
50 -e '/Makefile/d' \
51 -e '/rdoff/d' \
52 < zipfiles > zipfiles.dos
53 gzip -9 dist/nasm-${VERSION}.tar
54 rm -rf nasm-${VERSION}
55 ln -s doc/nasmdoc.src nasm.doc
56 zip -l -k ${NASM_ZIP} `cat zipfiles`
57 zip -k ${NASM_ZIP} *.exe misc/exasm.zip
58 zip -l -k ${NASM_DOS_ZIP} `cat zipfiles.dos`
59 zip -k ${NASM_DOS_ZIP} *.exe misc/exasm.zip
60 rm -f nasm.doc
61 (cd doc; zip -l -k ../${NASM_DOC_ZIP} \
62 Readme \
63 nasmdoc.src rdsrc.pl \
64 nasmdoc.txt \
65 nasmdoc.ps \
66 *.html
67 zip -k ../${NASM_DOC_ZIP} \
68 nasmdoc.hlp \
69 nasm.info)
70 rm -f zipfiles zipfiles.dos
71 echo Distributions complete.