I want to define a shell function
#!/bin/sh
test ()
{
do_some_complicated_tests $1 $2;
if something; then
build_thisway $1 $2;
else
build_otherway
This is really ghetto, but whatever. I use zsh, but I'm sure there are bash and sh equivalents.
Makefile:
export ZDOTDIR := ./
SHELL := /usr/bin/env zsh
default:
f
.zshenv, same directory as Makefile:
f () { echo 'CHECK OUT THIS AWESOME FUNCTION!' }
The ZDOTDIR variable makes zsh look in the current directory for dotfiles. Then you just stick what you want in .zshenv
.
$ make
f
CHECK OUT THIS AWESOME FUNCTION!