on engine-data help sign in
searx/utils/makefile.lxc
32 lines 863 B history raw
1# -*- coding: utf-8; mode: makefile-gmake -*-
2#
3# LXC environment
4# ===============
5#
6# To activate/deactivate LXC makefile environment in a container, set/unset link
7# from root '/.lxcenv.mk' to *this* file::
8#
9# sudo make ./utils/makefile.lxc lxc-activate
10# sudo make ./utils/makefile.lxc lxc-deactivate
12LXC_ENV_FOLDER=lxc-env/$(shell hostname)/
14lxc-help::
15 @echo ' LXC: running in container LXC_ENV_FOLDER=$(LXC_ENV_FOLDER)'
17# If not activated, serve target 'lxc-activate' ..
18ifeq (,$(wildcard /.lxcenv.mk))
19PHONY += lxc-activate
20lxc-activate:
21 ln -s "$(abspath $(lastword $(MAKEFILE_LIST)))" "/.lxcenv.mk"
22else
23# .. and if activated, serve target 'lxc-deactivate'.
24PHONY += lxc-deactivate
25lxc-deactivate:
26 rm /.lxcenv.mk
27$(LXC_ENV_FOLDER):
28 $(Q)mkdir -p $(LXC_ENV_FOLDER)
29 $(Q)echo placeholder > $(LXC_ENV_FOLDER).placeholder
30endif
32.PHONY: $(PHONY)