File: mklib

package info (click to toggle)
saclib 2.2.8-6.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,872 kB
  • sloc: ansic: 40,932; csh: 1,190; asm: 541; awk: 320; sh: 246; perl: 116; makefile: 98; sed: 48
file content (58 lines) | stat: -rw-r--r-- 1,696 bytes parent folder | download | duplicates (18)
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
#! /bin/csh

# USAGE:
#   mklib <std|deb|opt|all>
#
# FUNCTION
#   Creates ".a" files in "$saclib/lib/" depending on the argument:
#   - 'std' causes a standard library to be built. The library file will have
#     the name "saclib.a" and the corresponding object files are in
#     "saclib/lib/obj".   
#   - 'deb' switches on the '-g' option of the compiler which includes 
#     debugging information in the object files. The library file will have
#     the name "saclibd.a" and the corresponding object files are in
#     "saclib/lib/objd".  
#   - 'opt' switches on the '-O' option which produces optimized code. The
#     library file will have the name "saclibo.a" and the corresponding object
#     files are in "saclib/lib/objo".
#   - 'all' builds all three types of libraries.

if ($#argv < 1) then
  echo "USAGE:"
  echo "  mklib <std|deb|opt|all>"
  exit
endif

if (! $?CC) then
  set CC=cc
endif

if ($1 == "std") then
  pushd >/dev/null  $saclib/lib/obj
  make  CC=$CC SACFLAG= EXTENSION=
  popd >/dev/null
else if ($1 == "deb") then
  pushd >/dev/null  $saclib/lib/objd
  make  CC=$CC "SACFLAG=-g -DNO_SACLIB_MACROS" EXTENSION=d
  popd >/dev/null
else if ($1 == "opt") then
  pushd >/dev/null  $saclib/lib/objo
  make  CC=$CC SACFLAG=-O EXTENSION=o
  popd >/dev/null
else if ($1 == "all") then
  pushd >/dev/null  $saclib/lib/obj
  make  CC=$CC SACFLAG= EXTENSION=
  popd >/dev/null
  pushd >/dev/null  $saclib/lib/objd
  make  CC=$CC "SACFLAG=-g -DNO_SACLIB_MACROS" EXTENSION=d
  popd >/dev/null
  pushd >/dev/null  $saclib/lib/objo
  make  CC=$CC SACFLAG=-O EXTENSION=o
  popd >/dev/null
else
  echo "USAGE:"
  echo "  mklib <std|deb|opt|all>"
  exit
endif

echo "mklib done."