Commit 1dfd7791 authored by Adam Wujek's avatar Adam Wujek

Kconfig: Avoid two .configs for WRPC

make Kconfig_ppsi to be included directly from WRPC repo
Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent 643e153d
This diff is collapsed.
This diff is collapsed.
......@@ -3,14 +3,17 @@
#
# We are now Kconfig-based
-include $(CURDIR)/.config
WRPCSW_ROOT?=.
# Root of the main software, for now used only by WRPC. For other make it a
# current directory (".")
MAINSW_ROOT=$(WRPCSW_ROOT)
-include $(CURDIR)/$(MAINSW_ROOT)/.config
# We still accept command-line choices like we used to do.
# Also, we must remove the quotes from these Kconfig values
PROTO_EXTS ?= $(patsubst "%",%,$(CONFIG_EXTENSIONS))
ARCH ?= $(patsubst "%",%,$(CONFIG_ARCH))
CROSS_COMPILE ?= $(patsubst "%",%,$(CONFIG_CROSS_COMPILE))
WRPCSW_ROOT ?= $(patsubst "%",%,$(CONFIG_WRPCSW_ROOT))
# For "make config" to work, we need a valid ARCH
ifeq ($(ARCH),)
......@@ -54,10 +57,9 @@ export CFLAGS_OPTIMIZATION:= ${shell echo $(CONFIG_OPTIMIZATION)}
CFLAGS += $(CFLAGS_OPTIMIZATION)
CFLAGS += -Iinclude -fno-common
CFLAGS += -I$(MAINSW_ROOT)
CFLAGS += -I$(MAINSW_ROOT)/include
CFLAGS += -DPPSI_VERSION=\"$(VERSION)\"
ifneq ($(WRPCSW_ROOT),)
CFLAGS += -I$(WRPCSW_ROOT)
endif
# to avoid ifdef as much as possible, I use the kernel trick for OBJ variables
OBJ-y := fsm.o diag.o timeout.o msgtype.o
......@@ -113,7 +115,7 @@ $(TARGET).a: $(OBJ-y)
$(AR) rc $@ $(OBJ-y)
$(OBJ-y): .config $(wildcard include/ppsi/*.h)
$(OBJ-y): $(MAINSW_ROOT)/.config $(wildcard include/ppsi/*.h)
# Finally, "make clean" is expected to work
clean::
......@@ -125,8 +127,8 @@ distclean: clean
# Explicit rule for $(CURDIR)/.config
# needed since -include XXX triggers build for XXX
$(CURDIR)/.config:
@# Keep this dummy comment
$(CURDIR)/$(MAINSW_ROOT)/.config:
echo "Keep this dummy comment"
# following targets from Makefile.kconfig
silentoldconfig:
......@@ -143,4 +145,5 @@ defconfig:
@echo "Using unix_defconfig"
@$(MAKE) -f Makefile.kconfig unix_defconfig
.config: silentoldconfig
# "$(MAINSW_ROOT)/.config", when MAINSW_ROOT is "."
./.config .config: silentoldconfig
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