File: rebuild

package info (click to toggle)
dosemu 1.4.0+svn.1999-2
  • links: PTS
  • area: contrib
  • in suites: squeeze
  • size: 15,552 kB
  • ctags: 22,600
  • sloc: ansic: 136,915; asm: 4,107; sh: 1,606; perl: 1,411; makefile: 974; tcl: 599; awk: 404; yacc: 300; lex: 157
file content (52 lines) | stat: -rwxr-xr-x 1,002 bytes parent folder | download | duplicates (7)
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
#!/bin/bash
#
# properly clean source tree, configure and recompile dosemu
# (this is here just for developer's convenience, not for general usage)
#
# USAGE:
#
#   rebuild [all] [inst] [static]
#
#      all    force a complete rebuild, don't rely on previous make
#      inst   test install of the binary (if running root) suid-root in $TGT
#      static build portable static binaries
#
#
TGT=/usr/bin
#

ALL=0
INST=0
PORTABLE=0

while [ -n "$1" ]; do
  case $1 in
    all)   ALL=1 ;;
    inst)  INST=1 ;;
    static) PORTABLE=1 ;;
    *) ;;
  esac
  shift
done

if [ $ALL = 1 -o ! -f Makefile ]; then
  if [ -f Makefile.conf ]; then
    make distclean
  fi
fi
if [ $PORTABLE = 1 -a ! -f Makefile.conf ]; then
  ./default-configure --enable-linkstatic
fi

make 'WAIT=' 2>&1 | tee -a gen.log
# grep 'warning' gen.log

if [ "$UID" = "0" -a $INST = 1 ]; then
  #
  # special installs
  #
  rm -f ${TGT}/dos
  install -s -m 4755 bin/dosemu.bin ${TGT}/dos
  install -s -m 4755 bin/dosdebug ${TGT}
fi
sync