File: cx.sgi

package info (click to toggle)
xbs 0-8
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 444 kB
  • ctags: 333
  • sloc: ansic: 2,758; makefile: 60; csh: 55; perl: 15
file content (47 lines) | stat: -rwxr-xr-x 776 bytes parent folder | download | duplicates (9)
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
#!/bin/csh -f  etc
# compile and link with xwindow routines - SGI version
if ($#argv == 0) goto help
  set n = $#argv
  set p = $argv[$n]
  @ m = $n - 1
  set ops = ( $argv[1-$m] )  

if (X$p == X-h) goto help
if (! -e $p.c) then
   echo 'Not found:' $p.c 
   exit 2
endif

set echo
rm -f $p.o

# ------ compile -------
set i1 = '-I/usr/include/X11'
set i2 = ""

# gcc -c -O2 $i1 $i2 $p.c
   cc -c $ops $i1 $i2 $p.c


# ------ link ----------

#set LX = '-L/usr/lpp/X11/lib'
set LX = '-L/usr/lib/X11'

#set libs = '-lX11 -lXm -lXt -lm'
set libs = '-lX11 -lXm -lXt -lm -lU77'
set lmath = '-lm'

#gcc -o $p $p.o $LX $libs
  cc -o $p $p.o $LX $libs

exit


help:
  echo "Usage: cx [ops] prog  -- compile and link with X-window routines"
  echo "  opt  -O  to optimize"
  exit