implement part of build.c