Sha256: 5fd1545dcf1c5ed78892109c91eb3dce8fcfaf9a6f35529d80781fee23c44613

Contents?: true

Size: 1.54 KB

Versions: 3

Compression:

Stored size: 1.54 KB

Contents

#!/bin/bash

READLINK=$(type -p greadlink readlink | head -1)
cd $(dirname $($READLINK -f $0))

if [[ $1 = "-" ]]; then
    # do self build
    case `uname -s` in
        (Linux)
            os="linux"
            ;;
        (Darwin)
            os="darwin"
            ;;
        (*)
            os=""
            ;;
    esac
    case `uname -m` in
        (x86_64|amd64)
            arch="amd64"
            ;;
        (*)
            arch=""
            ;;
    esac

    TARGET=("${os} ${arch}")
else
    # cross build
    TARGET=("linux 386" "linux amd64"  "darwin amd64")
fi

set -e

GO_FILES=$(ls subsystem/*.go)

cat <<EOF > Makefile
# DO NOT EDIT MANUALLY
# generated by build.sh

GOSRC := $(echo ${GO_FILES})

.PHONY: all build clean

all: build

EOF

TARGETS=()

for idx in $(seq 0 $((${#TARGET[@]}-1))); do
    set -- ${TARGET[$idx]}
    export GOOS=$1
    export GOARCH=$2

    for subcmd in recorder player summarizer; do
        TARGETS+=(../lib/exec/perfmonger-${subcmd}_${GOOS}_${GOARCH})

        cat <<EOF >> Makefile

../lib/exec/perfmonger-${subcmd}_${GOOS}_${GOARCH}: perfmonger-${subcmd}.go \$(GOSRC)
	go build -o \$@ perfmonger-$subcmd.go

EOF
    done

    # go build -o ../lib/exec/perfmonger-recorder_${GOOS}_${GOARCH} \
    #     perfmonger-recorder.go &
    # go build -o ../lib/exec/perfmonger-player_${GOOS}_${GOARCH} \
    #     perfmonger-player.go &
    # go build -o ../lib/exec/perfmonger-summarizer_${GOOS}_${GOARCH} \
    #    perfmonger-summarizer.go &

done

cat <<EOF >> Makefile

build: ${TARGETS[*]}

clean:
	rm -f ${TARGETS[*]}

EOF

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
perfmonger-0.8.2 core/build.sh
perfmonger-0.8.1 core/build.sh
perfmonger-0.8.0 core/build.sh