make-asdf.sh 2.1 KB
Newer Older
1
#!/bin/sh
2
# Usage: ./make-asdf.sh [keyword=argument ...] <command>
3
# See the Makefile for the list of acceptable keyword arguments
4 5 6 7

here="$(dirname $0)"

header_lisp="header.lisp"
8
driver_lisp="uiop/package.lisp uiop/common-lisp.lisp uiop/utility.lisp uiop/version.lisp uiop/os.lisp uiop/pathname.lisp uiop/filesystem.lisp uiop/stream.lisp uiop/image.lisp uiop/lisp-build.lisp uiop/launch-program.lisp uiop/run-program.lisp uiop/configuration.lisp uiop/backward-driver.lisp uiop/driver.lisp"
9
defsystem_lisp="upgrade.lisp session.lisp component.lisp operation.lisp system.lisp system-registry.lisp action.lisp lisp-action.lisp find-component.lisp forcing.lisp plan.lisp operate.lisp find-system.lisp parse-defsystem.lisp bundle.lisp concatenate-source.lisp package-inferred-system.lisp output-translations.lisp source-registry.lisp backward-internals.lisp backward-interface.lisp interface.lisp user.lisp footer.lisp"
10 11 12

all () {
  # Default action: bootstrap asdf.lisp
13
  build_asdf
14
}
15
build_asdf () {
16
  # That's the only thing that we really need before we may invoke asdf-tools.
17 18 19 20 21 22 23 24 25
  mkdir -p build
  a=build/asdf.lisp
  cat ${header_lisp} ${driver_lisp} ${defsystem_lisp} > ${a}.tmp
  if [ -f ${a} ] && cmp -s ${a} ${a}.tmp ; then
    rm -rf ${a}.tmp
  else
    mv -f ${a}.tmp ${a}
  fi
}
26 27 28 29 30 31 32 33 34
build_asdf_tools () {
  if [ -x build/asdf-tools ] ; then
    : "Reusing existing asdf-tools."
  else
    : "Building asdf-tools."
    build_asdf
    ${here}/tools/asdf-tools build-asdf-tools
  fi
}
35 36 37 38 39 40 41 42
ext () {
  # Download all the development-time dependencies of ASDF:
  git submodule update --init
}
noext () {
  # Remove all the development-time dependencies of ASDF:
  git submodule deinit .
}
43
driver_files () {
44 45 46
  # These targets are used during tests to ensure the Makefile is in synch with the .asd files.
  echo ${driver_lisp}
}
47
defsystem_files () {
48 49 50 51 52 53
  # These targets are used during tests to ensure the Makefile is in synch with the .asd files.
  echo ${defsystem_lisp}
}

case "$1" in
  "") all ;;
54 55
  all|build_asdf|build_asdf_tools|ext|noext|driver_files|defsystem_files) "$@" ;;
  *) build_asdf_tools ; exec ${here}/build/asdf-tools env "$@" ;;
56
esac ; exit