Replace shell script with makefile