File: //opt/perf/examples/arm/Make.armsample
#!/bin/sh
# Make.armsample is a script (not a Makefile) to compile ARM example programs.
# Pre-compiled versions of these programs reside in the perftool bin directory.
# compiled output will end up in OUTPUT directory (edit as desired):
OUTPUT=/usr/tmp
# directory that performance agent installs under:
PERFROOT=/opt/perf
# path for ANSI-C compiler:
CC=cc
# extra link and compiler flags:
CF=""
# special cases for certain platforms:
case `uname -s` in
HP-UX) CC=/opt/ansic/bin/cc; CF=-Ae ;;
AIX) PERFROOT=/usr/lpp/perf ;;
SINIX* | Reliant*) LF="-lrpcsvc -lnsl" ;;
Linux)
if [ `uname -p` = ppc64 ]; then
CF="-m64"
fi ;;
SunOS)
LF=-lrt
if [ `uname -p` = i386 ]; then
CF="-DSUNOS_x86"
fi ;;
esac
# locations for arm.h and libarm:
INCLUDE=$PERFROOT/include
LIB=$PERFROOT/lib
# special-case for hpux IA:
case `uname -r` in
B.11.[23]*) LIB=$PERFROOT/lib/hpux64 ;;
esac
# special-case for Linux IA:
case `uname -s` in
Linux)
BITS=`getconf LONG_BIT 2>/dev/null`
if [ $BITS == 64 -o `uname -p` = ppc64 ]; then
LIB="/opt/perf/lib64";
fi
LF="-Xlinker -rpath -Xlinker ${LIB}"
;;
esac
for i in 1 2 3 4; do
cmd="${CC} armsample${i}.c -o ${OUTPUT}/armsample${i} ${CF} -I${INCLUDE} -L${LIB} -larm ${LF}"
echo $cmd
$cmd
done