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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
|
#! /bin/sh
modulesfile=modules
topdir=..
output=$topdir/Makefile
cat > $output <<EOF
#
# Makefile for dcmtk (DICOM Toolkit)
#
SHELL = /bin/sh
configdir = config
include \$(configdir)/Makefile.def
.NOTPARALLEL:
EOF
if test -f "$modulesfile" ; then
tmpmodules=`cat $modulesfile`
else
tmpmodules=`(cd $topdir; ls)`
fi
for dir in $tmpmodules; do
if test -d $topdir/$dir ; then
modules="$modules $dir"
fi
done
modules=`echo $modules | sed -e "s/config//g" | sed -e "s/doxygen//g"`
for module in config $modules; do
makeall="$makeall ${module}-all"
if test $module != config ; then
makelibsrcall="$makelibsrcall ${module}-libsrc-all"
fi
maketestsall="$maketestsall ${module}-tests-all"
makeinstall="$makeinstall ${module}-install"
makeinstallbin="$makeinstallbin ${module}-install-bin"
makeinstalldoc="$makeinstalldoc ${module}-install-doc"
makeinstalldata="$makeinstalldata ${module}-install-data"
makeinstalletc="$makeinstalletc ${module}-install-etc"
makeinstalllib="$makeinstalllib ${module}-install-lib"
makeinstallinclude="$makeinstallinclude ${module}-install-include"
makeinstallsupport="$makeinstallsupport ${module}-install-support"
makecheck="$makecheck ${module}-check"
makecheckexhaustive="$makecheckexhaustive ${module}-check-exhaustive"
done
cat >> $output <<EOF
all: $makeall
libsrc-all: $makelibsrcall
tests-all: $maketestsall
install: $makeinstall dcmtk-install-doc install-man
install-all: install install-lib install-html
install-bin: $makeinstallbin
install-doc: $makeinstalldoc
install-data: $makeinstalldata
install-etc: $makeinstalletc
install-lib: $makeinstalllib
install-include: $makeinstallinclude
install-support: $makeinstallsupport
check: tests-all
\$(MAKE) -s check-nosilent
check-nosilent: $makecheck
check-exhaustive: tests-all
\$(MAKE) -s check-nosilent-exhaustive
check-nosilent-exhaustive: $makecheckexhaustive
dcmtk-install-doc:
\$(configdir)/mkinstalldirs \$(DESTDIR)\$(docdir)
for file in ANNOUNCE COPYRIGHT CREDITS FAQ HISTORY VERSION docs/CHANGES.???; do \\
\$(INSTALL_DATA) \$\$file \$(DESTDIR)\$(docdir) ;\\
done
install-man:
(cd doxygen && \$(MAKE) DESTDIR="\$(DESTDIR)" install-man)
install-html:
(cd doxygen && \$(MAKE) DESTDIR="\$(DESTDIR)" install-html)
man:
(cd doxygen && \$(MAKE) DESTDIR="\$(DESTDIR)" man)
html:
(cd doxygen && \$(MAKE) DESTDIR="\$(DESTDIR)" html)
help:
@echo "Some available make targets:"
@echo ""
@echo "all: build all libraries, tests and applications"
@echo "libsrc-all: build all libraries"
@echo "install-all: install the toolkit with its libraries and documentation"
@echo "install: install all applications"
@echo "install-lib: install the libraries"
@echo "install-html: install the HTML documentation"
@echo "html: build the HTML documentation with doxygen"
@echo "man: build the man pages with doxygen"
@echo "check: build and run all tests, not including exhaustive tests"
@echo "check-exhaustive: build and run all tests, including exhaustive tests"
@echo "dependencies: update all Makefile.dep dependency files"
@echo "clean: remove compiler output"
@echo "distclean: remove compiler output and generated build structure"
@echo " (This removes all files generated by configure)"
@echo ""
@echo "Additionally, there are a number of module-specific targets available."
@echo "For example:"
@echo ""
@echo "<module>-all build the complete module"
@echo "<module>-libsrc-all build the module's libraries"
@echo "<module>-install install the module"
@echo "<module>-install-lib install the module's libraries"
@echo "<module>-check build and run the module's tests, not including exhaustive tests"
@echo "<module>-check-exhaustive build and run the module's tests, including exhaustive tests"
@echo ""
@echo "The following modules are available:"
@echo ""
@echo "$modules"
EOF
for module in config $modules; do
cat >> $output <<EOF
${module}-all:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" all)
${module}-libsrc-all:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" libsrc-all)
${module}-tests-all:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" tests-all)
${module}-install:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" install)
${module}-install-bin:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" install-bin)
${module}-install-doc:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" install-doc)
${module}-install-data:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" install-data)
${module}-install-etc:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" install-etc)
${module}-install-lib:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" install-lib)
${module}-install-include:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" install-include)
${module}-install-support:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" install-support)
${module}-check:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" check)
${module}-check-exhaustive:
(cd $module && \$(MAKE) ARCH="\$(ARCH)" DESTDIR="\$(DESTDIR)" check-exhaustive)
EOF
done
for tag in dependencies clean distclean ; do
echo "${tag}:" >> $output
if test $tag = dependencies ; then
echo " -(cd config && \$(MAKE) ${tag})" >> $output
fi
for module in $modules; do
echo " (cd ${module} && \$(MAKE) ${tag})" >> $output
done
if test $tag != dependencies ; then
echo " (cd doxygen && \$(MAKE) ${tag})" >> $output
echo " -(cd config && \$(MAKE) ${tag})" >> $output
fi
if test $tag = clean ; then
echo " rm -f \$(TRASH)" >> $output
elif test $tag = distclean ; then
echo " rm -f \$(TRASH)" >> $output
fi
echo >> $output
done
output=$topdir/configure
cat > $output <<EOF
#! /bin/sh
if test -d config ; then
if test -f config/$modulesfile ; then
tmp=\`cat config/$modulesfile\`
modules=\`ls -d \$tmp\`
else
for dir in \`ls\`; do
if test -d \$dir ; then
modules="\$modules \$dir"
fi
done
fi
modules=\`echo \$modules | sed -e "s/config//g"\`
modules="config \$modules doxygen"
else
echo "Cannot find configure directory (config or ../config)"
exit 1
fi
if test "x--help" = "x\$*"; then
config/configure --help
elif test "x--help=short" = "x\$*"; then
config/configure --help=short
elif test "x--help=recursive" = "x\$*"; then
config/configure --help=recursive
elif test "x--version" = "x\$*"; then
config/configure --version
elif test "x-h" = "x\$*"; then
config/configure -h
elif test "x-V" = "x\$*"; then
config/configure -V
else
args=""
ok=0
while [ \$# -gt 0 ]; do
if test "x--ignore-deprecation" = "x\$1"; then
ok=1
else
args="\$args \$1"
fi
shift
done
if [ \$ok -eq 0 ]; then
echo ""
echo "== DEPRECATION WARNING =="
echo ""
echo "Configuring DCMTK via GNU Autoconf is deprecated and will be removed. Please have"
echo "a look at CMake, which we now consider equally mature. If you run into serious"
echo "problems using CMake or strongly prefer GNU Autoconf for some other reason write"
echo "an email to the"
echo ""
echo " DCMTK Team <bugs@dcmtk.org>"
echo ""
echo "and use"
echo ""
echo " ./configure --ignore-deprecation"
echo ""
echo "to run the old configure script anyway."
echo ""
exit 1
fi
for module in \$modules ; do
echo "Running configure for module \$module."
if test ! -x "\$module/configure" ; then
echo "Module \$module does not contain a configure script!" >&2
exit 1
fi
(cd \$module && ./configure \$args ) || exit 1
done
fi
EOF
chmod 755 $output
|