File: build

package info (click to toggle)
splat 1.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,332 kB
  • sloc: cpp: 8,650; ansic: 993; sh: 442; lisp: 244; makefile: 31
file content (85 lines) | stat: -rwxr-xr-x 1,612 bytes parent folder | download | duplicates (2)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
#
# Simple shell script for building SPLAT! and associated utilities.
# Written by John A. Magliacane, KD2BD May 2002 -- Last update: February 2014
#

cpu=`uname -m`
model=""

if [ "$cpu" = "x86_64" ]; then
        cpu="x86-64"
	model="-mcmodel=medium"

	if [[ `uname -a` =~ Darwin ]]; then
		model="";   ## for Mac OSX  ## J.V.
	fi

elif [ "$cpu" = "sun4u" ]; then
	cpu=""
	model=""
fi

build_splat()
{
	if [ -r std-parms.h ]; then
		cp std-parms.h splat.h
	else
		echo "/* Parameters for 3 arc-second standard resolution mode of operation */" > std-parms.h

		echo "#define MAXPAGES 9" >> std-parms.h
		echo "#define HD_MODE 0" >> std-parms.h
		cp std-parms.h splat.h
	fi

	echo -n "Compiling SPLAT!... "
	g++ -O2 -s -fomit-frame-pointer -ffast-math -pipe -march=$cpu $model itwom3.0.cpp splat.cpp -lm -lbz2 -o splat

	if [ -x splat ]; then
		echo "Done!"
	else
		echo "Compilation failed!"
	fi

	if [ -r hd-parms.h ]; then
		cp hd-parms.h splat.h
		echo -n "Compiling SPLAT! HD... "
		g++ -O2 -s -fomit-frame-pointer -ffast-math -pipe -march=$cpu $model itwom3.0.cpp splat.cpp -lm -lbz2 -o splat-hd

		if [ -x splat-hd ]; then
			echo "Done!"
		else
			echo "Compilation failed!"
		fi
	fi
}

build_utils()
{
	cd utils
	./build all
	cd ..
}

if [ "$#" = "0" ]; then
	echo "Usage: build  { splat, utils, all }"
else

	if [ "$1" = "splat" ]; then
		build_splat
	fi

	if [ "$1" = "utils" ]; then
		build_utils
	fi

	if [ "$1" = "all" ]; then
		build_splat
		build_utils
	fi

	if [ "$1" != "splat" ] && [ "$1" != "utils" ] && [ "$1" != "all" ]; then
		echo "Usage: build { splat, utils, all }"
	fi
fi