mirror of
https://github.com/falk-werner/webfuse
synced 2024-10-27 20:34:10 +00:00
adds support for build type and allows to run gdb in container
This commit is contained in:
parent
b784652858
commit
8d0f51520e
30
Makefile
30
Makefile
@ -105,7 +105,11 @@ BUILDSILENT := $(if $(BUILDVERBOSE),,1)
|
||||
$(BUILDSILENT)NINJAFLAGS += -v
|
||||
|
||||
DOCKER_RUNFLAGS += --device /dev/fuse
|
||||
DOCKER_RUNFLAGS += --cap-add SYS_ADMIN --security-opt apparmor:unconfined
|
||||
DOCKER_RUNFLAGS += --cap-add SYS_ADMIN
|
||||
DOCKER_RUNFLAGS += --security-opt apparmor:unconfined
|
||||
|
||||
DOCKER_RUNFLAGS += --cap-add SYS_PTRACE
|
||||
DOCKER_RUNFLAGS += --security-opt seccomp=unconfined
|
||||
|
||||
DOCKER_RUNFLAGS += --interactive
|
||||
DOCKER_RUNFLAGS += --rm
|
||||
@ -128,7 +132,7 @@ OUT_TARGETS += $(addprefix $(OUT)/,$(TARGETS))
|
||||
OUT_DIRS += $(OUT)
|
||||
OUT_DIRS += $(OUT)/docker
|
||||
OUT_DIRS += $(OUT)/src
|
||||
OUT_DIRS += $(addsuffix /usr/bin,$(OUT_TARGETS))
|
||||
OUT_DIRS += $(addsuffix /$(BUILDTYPE),$(OUT_TARGETS))
|
||||
|
||||
BUILD_TARGETS += $(addprefix build-,$(TARGETS))
|
||||
CHECK_TARGETS += $(addprefix check-,$(TARGETS))
|
||||
@ -149,29 +153,29 @@ $(VERBOSE)SILENT := @
|
||||
$(HOST_CONTAINER)image_run_volumes += '$(realpath $(PROJECT_ROOT)):$(CONTAINER_PROJECT_ROOT):cached'
|
||||
$(HOST_CONTAINER)image_run_volumes += '$(realpath $(OUT)/$1):$(CONTAINER_OUT)/$1:delegated'
|
||||
|
||||
image_name = $(REGISTRY_PREFIX)$(subst -,/,$1)/$(PROJECT_NAME):$(VERSION)
|
||||
image_run = $(DOCKER) run $(DOCKER_RUNFLAGS) $3 \
|
||||
$(addprefix --volume ,$(call image_run_volumes,$1)) \
|
||||
container_name = $(REGISTRY_PREFIX)$(subst -,/,$1)/$(PROJECT_NAME):$(VERSION)
|
||||
container_run = $(DOCKER) run $(DOCKER_RUNFLAGS) $3 \
|
||||
$(addprefix --volume ,$(call container_run_volumes,$1)) \
|
||||
--workdir '$(CONTAINER_OUT)/$1/$(BUILDTYPE)' \
|
||||
$(call image_name,$1) \
|
||||
$(call container_name,$1) \
|
||||
$2
|
||||
|
||||
image_rule = \
|
||||
$$(OUT)/docker/$1: $$(OUT)/docker/$1.dockerfile $$(EXTRACT_TARGETS) $$(PROJECT_ROOT)/Makefile; \
|
||||
$$(SILENT)$$(call image,$1)
|
||||
image = \
|
||||
$(call echo_if_silent,TARGET=$1 docker build $(call image_name,$1) $(OUT)) \
|
||||
&& $(DOCKER) build $(DOCKER_BUILDFLAGS) --iidfile $@ --file $< --tag $(call image_name,$1) $(OUT)
|
||||
$(call echo_if_silent,TARGET=$1 docker build $(call container_name,$1) $(OUT)) \
|
||||
&& $(DOCKER) build $(DOCKER_BUILDFLAGS) --iidfile $@ --file $< --tag $(call container_name,$1) $(OUT)
|
||||
|
||||
configure_rule = \
|
||||
$$(OUT)/$1/CMakeCache.txt: $$(PROJECT_ROOT)/CMakeLists.txt $$(OUT)/docker/$1 | $$(OUT)/$1/usr/bin/gdb; \
|
||||
$$(OUT)/$1/$$(BUILDTYPE)/CMakeCache.txt: $$(PROJECT_ROOT)/CMakeLists.txt $$(OUT)/docker/$1; \
|
||||
$$(SILENT)$$(call configure,$1)
|
||||
configure = \
|
||||
$(call run,$1,sh -c 'cmake $(CMAKEFLAGS) $(CONTAINER_PROJECT_ROOT) && $(CONTAINER_PROJECT_ROOT)/build/discover_cc_settings.sh $(notdir $@) $(realpath $(dir $@))') \
|
||||
&& touch $(addprefix $(dir $@)/,include_dirs.txt) $@
|
||||
|
||||
build_rule = \
|
||||
build-$1: $$(OUT)/$1/CMakeCache.txt; \
|
||||
build-$1: $$(OUT)/$1/$$(BUILDTYPE)/CMakeCache.txt; \
|
||||
$$(SILENT)$$(call build,$1)
|
||||
build = $(call run,$1,ninja $(PARALLELMFLAGS) $(NINJAFLAGS) $(GOALS))
|
||||
|
||||
@ -186,7 +190,7 @@ memcheck = $(call run,$1,ctest -T memcheck $(CTESTFLAGS))
|
||||
run_rule = \
|
||||
run-$1: $$(OUT)/docker/$1; \
|
||||
$$(SILENT)$$(call run,$1,bash,--tty) || true
|
||||
run = $(call echo_if_silent,TARGET=$1 $2) && $(call container_run,$1,$2,$3)
|
||||
run = $(call echo_if_silent,TARGET=$1 BUILDTYPE=$(BUILDTYPE) $2) && $(call container_run,$1,$2,$3)
|
||||
|
||||
clean_rule = \
|
||||
clean-$1: ; \
|
||||
@ -194,13 +198,13 @@ clean_rule = \
|
||||
clean = rm -rf $(OUT)/$1
|
||||
|
||||
discover_cc_settings_rule = \
|
||||
$$(OUT)/$1/include_dirs.txt: $$(OUT)/$1/CMakeCache.txt; \
|
||||
$$(OUT)/$1/$$(BUILDTYPE)/include_dirs.txt: $$(OUT)/$1/$$(BUILDTYPE)/CMakeCache.txt; \
|
||||
$$(SILENT)$$(call discover_cc_settings,$1)
|
||||
discover_cc_settings = \
|
||||
$(call run,$1,$(CONTAINER_PROJECT_ROOT)/build/discover_cc_settings.sh $(notdir $<) $(realpath $(dir $<)))
|
||||
|
||||
discover_cc_rule = \
|
||||
discover-cc-$1: $$(OUT)/$1/include_dirs.txt; \
|
||||
discover-cc-$1: $$(OUT)/$1/$$(BUILDTYPE)/include_dirs.txt; \
|
||||
$$(SILENT)$$(call discover_cc,$1)
|
||||
discover_cc = cat $<
|
||||
|
||||
|
@ -12,7 +12,6 @@ RUN set -x \
|
||||
pkg-config \
|
||||
rsync \
|
||||
gdb \
|
||||
gdbserver \
|
||||
valgrind \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
@ -14,7 +14,6 @@ RUN set -x \
|
||||
pkg-config \
|
||||
rsync \
|
||||
gdb \
|
||||
gdbserver \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY src /usr/local/src
|
||||
|
Loading…
Reference in New Issue
Block a user