build: moving error page processing out of makefile