File: cx

package info (click to toggle)
xbs 0-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 444 kB
  • ctags: 333
  • sloc: ansic: 2,754; csh: 55; makefile: 54; perl: 15
file content (41 lines) | stat: -rwxr-xr-x 638 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
#!/bin/csh -f
# compile and link with xwindow routines
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 = ' '
set i2 = ' '

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


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

set LX = '-L/usr/X11R6/lib'

set libs = '-lX11 -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