Cleanup build setup

This commit is contained in:
2016-12-23 14:40:01 -06:00
parent 666f455cfd
commit 880c697a39
6 changed files with 53 additions and 47 deletions
+23 -15
View File
@@ -1,23 +1,25 @@
OS=$(shell uname | tr [:upper:] [:lower:])
TARGET=${OS}-$(shell uname -m)
DEVENV=devenv$(shell pwd | sed 's/\//-/g')
ifeq ($(shell docker inspect --format="{{.State.Status}}" ${DEVENV} 2>&1),running)
ENV_RUN=docker exec --user $(shell id -u ${USER}) ${DEVENV}
endif
make:
${ENV_RUN} make -j -C build
${ENV_RUN} make -j -C build TARGET=${TARGET}
preinstall:
${ENV_RUN} make -j -C build ARGS="preinstall"
${ENV_RUN} make -j -C build ARGS="preinstall" TARGET=${TARGET}
install:
${ENV_RUN} make -j -C build ARGS="install"
${ENV_RUN} make -j -C build ARGS="install" TARGET=${TARGET}
clean:
${ENV_RUN} make -j -C build ARGS="clean"
${ENV_RUN} make -j -C build ARGS="clean" TARGET=${TARGET}
purge:
${ENV_RUN} rm -rf $(shell find build -mindepth 1 -maxdepth 1 -type d)
test:
${ENV_RUN} make -j -C build ARGS="test"
${ENV_RUN} make -j -C build ARGS="test" TARGET=${TARGET}
run: make
./build/current/src/wombat/wombat -debug
debug: make
gdb: make
gdb ./build/current/src/wombat/wombat
devenv:
docker pull wombatant/devenv
@@ -29,17 +31,17 @@ devenv-destroy:
devenv-shell:
docker exec -i --user $(shell id -u ${USER}) ${DEVENV} ls /usr/bin/x86_64-w64-mingw32-g++
native:
${ENV_RUN} rm -rf build/release
${ENV_RUN} ./scripts/setup_build
release:
${ENV_RUN} rm -rf build/${TARGET}-release
${ENV_RUN} ./scripts/setup_build ${TARGET}
${ENV_RUN} rm -f build/current
${ENV_RUN} ln -s release build/current
${ENV_RUN} ln -s ${TARGET}-release build/current
native_debug:
${ENV_RUN} rm -rf build/debug
${ENV_RUN} ./scripts/setup_build_debug
debug:
${ENV_RUN} rm -rf build/${TARGET}-debug
${ENV_RUN} ./scripts/setup_build ${TARGET} debug
${ENV_RUN} rm -f build/current
${ENV_RUN} ln -s debug build/current
${ENV_RUN} ln -s ${TARGET}-debug build/current
windows:
${ENV_RUN} rm -rf build/windows
@@ -47,8 +49,14 @@ windows:
${ENV_RUN} rm -f build/current
${ENV_RUN} ln -s windows build/current
windows-debug:
${ENV_RUN} rm -rf build/windows
${ENV_RUN} ./scripts/setup_build windows debug
${ENV_RUN} rm -f build/current
${ENV_RUN} ln -s windows build/current
gba:
${ENV_RUN} rm -rf build/gba
${ENV_RUN} ./scripts/setup_build_gba
${ENV_RUN} ./scripts/setup_build gba
${ENV_RUN} rm -f build/current
${ENV_RUN} ln -s gba build/current