Commit a1ba0788 authored by Pavel Emelyanov's avatar Pavel Emelyanov

make: Add .config file processing (v3)

In this file one can add options with which to build CRIU.
Each line is (for now) expanded into CONFIG_$(TEXT) macros
defined in config.h that can be tested later in the code.

v2: Add .config to .gitignore
v3: Don't check that make mrproper removes .config

https://github.com/xemul/criu/issues/235
travis-ci: success for Don't compile in binfmt_misc dumping code by default (rev3)
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Reviewed-by: 's avatarDmirty Safonov <dsafonov@virtuozzo.com>
parent 1821aced
.config
*.o
*.d
*.a
......
......@@ -14,6 +14,11 @@ endif
export LIBS += $(LIBS_FEATURES)
CONFIG_FILE = $(SRC_DIR)/.config
$(CONFIG_FILE):
touch $(CONFIG_FILE)
export DEFINES += $(FEATURE_DEFINES)
export CFLAGS += $(FEATURE_DEFINES)
......@@ -29,12 +34,13 @@ endif
endef
define config-header-rule
$(CONFIG_HEADER): $(SRC_DIR)/scripts/feature-tests.mak
$(CONFIG_HEADER): $(SRC_DIR)/scripts/feature-tests.mak $(CONFIG_FILE)
$$(call msg-gen, $$@)
$(Q) @echo '#ifndef __CR_CONFIG_H__' > $$@
$(Q) @echo '#define __CR_CONFIG_H__' >> $$@
$(Q) @echo '' >> $$@
$(call map,gen-feature-test,$(FEATURES_LIST))
$(Q) @cat $(CONFIG_FILE) | sed -n -e '/^[^#]/s/^/#define CONFIG_/p' >> $$@
ifeq ($$(VDSO),y)
$(Q) @echo '#define CONFIG_VDSO' >> $$@
$(Q) @echo '' >> $$@
......
......@@ -28,4 +28,4 @@ RUN make mrproper
RUN make -j $(nproc) CC=$CC criu/parasite-syscall.o
RUN make -j $(nproc) CC=$CC
RUN make mrproper
RUN bash -c 'CLEAN="$(git clean -ndx --exclude=scripts/build)"; echo "${CLEAN}"; test -z "${CLEAN}"; exit $?'
RUN bash -c 'CLEAN="$(git clean -ndx --exclude=scripts/build --exclude=.config)"; echo "${CLEAN}"; test -z "${CLEAN}"; exit $?'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment