2016-12-23 17:29:19 -06:00
|
|
|
OS=$(shell uname | tr [:upper:] [:lower:])
|
|
|
|
TARGET=${OS}-$(shell uname -m)
|
2016-12-22 13:16:05 -06:00
|
|
|
DEVENV=devenv$(shell pwd | sed 's/\//-/g')
|
2016-12-22 20:28:48 -06:00
|
|
|
ifeq ($(shell docker inspect --format="{{.State.Status}}" ${DEVENV} 2>&1),running)
|
|
|
|
ENV_RUN=docker exec --user $(shell id -u ${USER}) ${DEVENV}
|
|
|
|
endif
|
2016-12-18 15:54:13 -06:00
|
|
|
|
2016-03-26 15:49:05 -05:00
|
|
|
make:
|
2016-12-23 17:29:19 -06:00
|
|
|
${ENV_RUN} make -j -C build TARGET=${TARGET}
|
2016-03-26 15:49:05 -05:00
|
|
|
preinstall:
|
2016-12-23 17:29:19 -06:00
|
|
|
${ENV_RUN} make -j -C build ARGS="preinstall" TARGET=${TARGET}
|
2016-03-26 15:49:05 -05:00
|
|
|
install:
|
2016-12-23 17:29:19 -06:00
|
|
|
${ENV_RUN} make -j -C build ARGS="install" TARGET=${TARGET}
|
2016-03-26 15:49:05 -05:00
|
|
|
clean:
|
2016-12-23 17:29:19 -06:00
|
|
|
${ENV_RUN} make -j -C build ARGS="clean" TARGET=${TARGET}
|
|
|
|
purge:
|
|
|
|
${ENV_RUN} rm -rf $(shell find build -mindepth 1 -maxdepth 1 -type d)
|
2016-03-26 15:49:05 -05:00
|
|
|
test:
|
2016-12-23 17:29:19 -06:00
|
|
|
${ENV_RUN} make -j -C build ARGS="test" TARGET=${TARGET}
|
2016-03-26 15:49:05 -05:00
|
|
|
run: make
|
|
|
|
./build/current/src/wombat/wombat -debug
|
2016-12-23 17:29:19 -06:00
|
|
|
gdb: make
|
2016-03-26 15:49:05 -05:00
|
|
|
gdb ./build/current/src/wombat/wombat
|
2016-12-18 15:54:13 -06:00
|
|
|
devenv:
|
|
|
|
docker pull wombatant/devenv
|
2016-12-22 20:28:48 -06:00
|
|
|
docker run -d -v $(shell pwd):/usr/src/project \
|
|
|
|
-e LOCAL_USER_ID=$(shell id -u ${USER}) \
|
|
|
|
--name ${DEVENV} -t wombatant/devenv bash
|
2016-12-18 15:54:13 -06:00
|
|
|
devenv-destroy:
|
|
|
|
docker rm -f ${DEVENV}
|
2016-12-23 17:29:19 -06:00
|
|
|
devenv-shell:
|
|
|
|
docker exec -i --user $(shell id -u ${USER}) ${DEVENV} ls /usr/bin/x86_64-w64-mingw32-g++
|
2016-03-26 15:49:05 -05:00
|
|
|
|
2016-12-23 17:29:19 -06:00
|
|
|
release:
|
|
|
|
${ENV_RUN} rm -rf build/${TARGET}-release
|
|
|
|
${ENV_RUN} ./scripts/setup_build ${TARGET}
|
|
|
|
${ENV_RUN} rm -f build/current
|
|
|
|
${ENV_RUN} ln -s ${TARGET}-release build/current
|
2016-03-26 15:49:05 -05:00
|
|
|
|
2016-12-23 17:29:19 -06:00
|
|
|
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 ${TARGET}-debug build/current
|
|
|
|
|
|
|
|
windows:
|
|
|
|
${ENV_RUN} rm -rf build/windows
|
|
|
|
${ENV_RUN} ./scripts/setup_build 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
|
2016-03-26 15:49:05 -05:00
|
|
|
|
|
|
|
gba:
|
2016-12-23 17:29:19 -06:00
|
|
|
${ENV_RUN} rm -rf build/gba-release
|
|
|
|
${ENV_RUN} ./scripts/setup_build gba
|
|
|
|
${ENV_RUN} rm -f build/current
|
|
|
|
${ENV_RUN} ln -s gba-release build/current
|