Moving logic to makefile.