Cleanup build system
This commit is contained in:
@@ -1,47 +1,47 @@
|
|||||||
OS=$(shell uname | tr [:upper:] [:lower:])
|
OS=$(shell uname | tr [:upper:] [:lower:])
|
||||||
TARGET=${OS}-$(shell uname -m)
|
HOST_ENV=${OS}-$(shell uname -m)
|
||||||
DEVENV=devenv$(shell pwd | sed 's/\//-/g')
|
DEVENV=devenv$(shell pwd | sed 's/\//-/g')
|
||||||
|
DEVENV_IMAGE=wombatant/devenv
|
||||||
ifeq ($(shell docker inspect --format="{{.State.Status}}" ${DEVENV} 2>&1),running)
|
ifeq ($(shell docker inspect --format="{{.State.Status}}" ${DEVENV} 2>&1),running)
|
||||||
ENV_RUN=docker exec --user $(shell id -u ${USER}) ${DEVENV}
|
ENV_RUN=docker exec --user $(shell id -u ${USER}) ${DEVENV}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
make:
|
make:
|
||||||
${ENV_RUN} make -j -C build TARGET=${TARGET}
|
${ENV_RUN} make -j -C build HOST_ENV=${HOST_ENV}
|
||||||
preinstall:
|
preinstall:
|
||||||
${ENV_RUN} make -j -C build ARGS="preinstall" TARGET=${TARGET}
|
${ENV_RUN} make -j -C build ARGS="preinstall" HOST_ENV=${HOST_ENV}
|
||||||
install:
|
install:
|
||||||
${ENV_RUN} make -j -C build ARGS="install" TARGET=${TARGET}
|
${ENV_RUN} make -j -C build ARGS="install" HOST_ENV=${HOST_ENV}
|
||||||
clean:
|
clean:
|
||||||
${ENV_RUN} make -j -C build ARGS="clean" TARGET=${TARGET}
|
${ENV_RUN} make -j -C build ARGS="clean" HOST_ENV=${HOST_ENV}
|
||||||
purge:
|
purge:
|
||||||
${ENV_RUN} rm -rf $(shell find build -mindepth 1 -maxdepth 1 -type d)
|
${ENV_RUN} rm -rf $(shell find build -mindepth 1 -maxdepth 1 -type d)
|
||||||
test:
|
test:
|
||||||
${ENV_RUN} make -j -C build ARGS="test" TARGET=${TARGET}
|
${ENV_RUN} make -j -C build ARGS="test" HOST_ENV=${HOST_ENV}
|
||||||
run: make
|
run: make
|
||||||
./build/current/src/wombat/wombat -debug
|
./build/current/src/wombat/wombat -debug
|
||||||
gdb: make
|
gdb: make
|
||||||
gdb ./build/current/src/wombat/wombat
|
gdb ./build/current/src/wombat/wombat
|
||||||
|
|
||||||
devenv:
|
devenv:
|
||||||
docker pull wombatant/devenv
|
docker pull ${DEVENV_IMAGE}
|
||||||
docker run -d -v $(shell pwd):/usr/src/project \
|
docker run -d -v $(shell pwd):/usr/src/project \
|
||||||
-e LOCAL_USER_ID=$(shell id -u ${USER}) \
|
-e LOCAL_USER_ID=$(shell id -u ${USER}) \
|
||||||
--name ${DEVENV} -t wombatant/devenv bash
|
--name ${DEVENV} -t ${DEVENV_IMAGE} bash
|
||||||
devenv-destroy:
|
devenv-destroy:
|
||||||
docker rm -f ${DEVENV}
|
docker rm -f ${DEVENV}
|
||||||
devenv-shell:
|
|
||||||
docker exec -i --user $(shell id -u ${USER}) ${DEVENV} ls /usr/bin/x86_64-w64-mingw32-g++
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
${ENV_RUN} rm -rf build/${TARGET}-release
|
${ENV_RUN} rm -rf build/${HOST_ENV}-release
|
||||||
${ENV_RUN} ./scripts/setup_build ${TARGET}
|
${ENV_RUN} ./scripts/setup_build ${HOST_ENV}
|
||||||
${ENV_RUN} rm -f build/current
|
${ENV_RUN} rm -f build/current
|
||||||
${ENV_RUN} ln -s ${TARGET}-release build/current
|
${ENV_RUN} ln -s ${HOST_ENV}-release build/current
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
${ENV_RUN} rm -rf build/${TARGET}-debug
|
${ENV_RUN} rm -rf build/${HOST_ENV}-debug
|
||||||
${ENV_RUN} ./scripts/setup_build ${TARGET} debug
|
${ENV_RUN} ./scripts/setup_build ${HOST_ENV} debug
|
||||||
${ENV_RUN} rm -f build/current
|
${ENV_RUN} rm -f build/current
|
||||||
${ENV_RUN} ln -s ${TARGET}-debug build/current
|
${ENV_RUN} ln -s ${HOST_ENV}-debug build/current
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
${ENV_RUN} rm -rf build/windows
|
${ENV_RUN} rm -rf build/windows
|
||||||
@@ -56,7 +56,7 @@ windows-debug:
|
|||||||
${ENV_RUN} ln -s windows build/current
|
${ENV_RUN} ln -s windows build/current
|
||||||
|
|
||||||
gba:
|
gba:
|
||||||
${ENV_RUN} rm -rf build/gba
|
${ENV_RUN} rm -rf build/gba-release
|
||||||
${ENV_RUN} ./scripts/setup_build gba
|
${ENV_RUN} ./scripts/setup_build gba
|
||||||
${ENV_RUN} rm -f build/current
|
${ENV_RUN} rm -f build/current
|
||||||
${ENV_RUN} ln -s gba build/current
|
${ENV_RUN} ln -s gba-release build/current
|
||||||
|
|||||||
+6
-6
@@ -3,18 +3,18 @@ all: gba_build native_build native_debug_build windows_release windows_debug
|
|||||||
MAKE=make -j
|
MAKE=make -j
|
||||||
|
|
||||||
gba_build:
|
gba_build:
|
||||||
@if [ -d gba ]; then \
|
@if [ -d gba-release ]; then \
|
||||||
${MAKE} -C gba ${ARGS}; \
|
${MAKE} -C gba-release ${ARGS}; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
native_build:
|
native_build:
|
||||||
@if [ -d ${TARGET}-release ]; then \
|
@if [ -d ${HOST_ENV}-release ]; then \
|
||||||
${MAKE} -C ${TARGET}-release ${ARGS}; \
|
${MAKE} -C ${HOST_ENV}-release ${ARGS}; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
native_debug_build:
|
native_debug_build:
|
||||||
@if [ -d ${TARGET}-debug ]; then \
|
@if [ -d ${HOST_ENV}-debug ]; then \
|
||||||
${MAKE} -C ${TARGET}-debug ${ARGS}; \
|
${MAKE} -C ${HOST_ENV}-debug ${ARGS}; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
windows_release:
|
windows_release:
|
||||||
|
|||||||
Reference in New Issue
Block a user