#!/bin/bash _clean () { git clean -dfx ctags *.c *.h } _configure () { # XXX breaks when building Compress::Raw::Zlib, nobody else can reproduce? # ./Configure -des -Dusedevel -DDEBUGGING -Dusethreads -Uversiononly -Accflags="-Wall -Wextra" -Doptimize="-g -O0 -ggdb3" # can't do this with -Werror, not everything (external modules, say) is # -Werror clean # ./Configure -des -Dusedevel -Accflags="-Wall -Wextra" ./Configure -des -Dusedevel -DDEBUGGING } _make () { if [[ ! -e Makefile ]]; then _configure fi # -Werror at configure time seems to confuse Configure, so do it here make -j9 OPTIMIZE="-g -Werror" } _test () { if [[ ! -e perl ]]; then _make fi export TEST_JOBS=9 if [ -n "$*" ]; then make test_harness TEST_FILES="$*" else make test_harness fi } _test_porting () { if [[ ! -e perl ]]; then _make fi export TEST_JOBS=9 if [ -n "$*" ]; then make test_porting TEST_FILES="$*" else make test_porting fi } cmd=$1 shift case $cmd in cl|clean) _clean $@ ;; c|conf|configure) _configure $@ ;; m|make) _make $@ ;; t|test) _test $@ ;; tp|test_porting) _test_porting $@ ;; a|all) _clean _test ;; *) echo "Usage: p [args...]" 1>&2 exit 1 ;; esac