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 (112 lines) | stat: -rwxr-xr-x 2,040 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
#
# Simple shell script for building SPLAT! and associated utilities.
# Written by John A. Magliacane, KD2BD May 2002.  Updated January 2014.
#

build_citydecoder()
{
	echo -n "Compiling citydecoder... "
	cc -O2 -s -fomit-frame-pointer citydecoder.c -o citydecoder

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

build_usgs2sdf()
{
	echo -n "Compiling usgs2sdf... "
	cc -O2 -s -fomit-frame-pointer usgs2sdf.c -o usgs2sdf

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

build_srtm2sdf()
{
	echo -n "Compiling srtm2sdf... "
	cc -O2 -s -fomit-frame-pointer srtm2sdf.c -lbz2 -o srtm2sdf
	rm -f srtm2sdf-hd
	ln -s srtm2sdf srtm2sdf-hd

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

}

build_fontdata()
{
	echo -n "Compiling fontdata... "
	cc -O2 -s -fomit-frame-pointer fontdata.c -lz -o fontdata

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

}

build_bearing()
{
	echo -n "Compiling bearing... "
	cc -O2 -s -fomit-frame-pointer bearing.c -lm -o bearing

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

}

if [ "$#" = "0" ]; then
	echo "Usage: build  { citydecoder, srtm2sdf, usgs2sdf, fontdata, bearing all }"
else

	if [ "$1" = "citydecoder" ]; then
		build_citydecoder
	fi

	if [ "$1" = "usgs2sdf" ]; then
		build_usgs2sdf
	fi

	if [ "$1" = "srtm2sdf" ]; then
		build_srtm2sdf
	fi

	if [ "$1" = "fontdata" ]; then
		build_fontdata
	fi

	if [ "$1" = "bearing" ]; then
		build_bearing
	fi

	if [ "$1" = "clean" ]; then
		rm -f citydecoder usgs2sdf fontdata
	fi

	if [ "$1" = "all" ]; then
		build_citydecoder
		build_usgs2sdf
		build_srtm2sdf
		build_fontdata
		build_bearing
	fi

	if [ "$1" != "citydecoder" ] && [ "$1" != "srtm2sdf" ] && [ "$1" != "usgs2sdf" ] && [ "$1" != "fontdata" ] && [ "$1" != "bearing" ] && [ "$1" != "clean" ] && [ "$1" != "all" ]; then
		echo "Usage: build { citydecoder, srtm2sdf, usgs2sdf, fontdata, bearing, all }"
	fi
fi