aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-03-08 22:16:16 +0100
committerKarel Kočí <cynerd@email.cz>2017-03-08 22:16:16 +0100
commit171e8e92686ac65e8f9a2962a975e6863c791a4f (patch)
tree42c8ba7caee8d1e6c67eca533350dd003d47d14f /Makefile
parentfbe0e4d00ba7e026b8b848cfcd0ed583a71f8069 (diff)
downloadavr-ioe-171e8e92686ac65e8f9a2962a975e6863c791a4f.tar.gz
avr-ioe-171e8e92686ac65e8f9a2962a975e6863c791a4f.tar.bz2
avr-ioe-171e8e92686ac65e8f9a2962a975e6863c791a4f.zip
Shakeout of makefiles and Kconfigs
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile58
1 files changed, 7 insertions, 51 deletions
diff --git a/Makefile b/Makefile
index 13d281b..ea96319 100644
--- a/Makefile
+++ b/Makefile
@@ -24,19 +24,7 @@ ifeq (,$(filter clean help docs serve-docs clean-docs config oldconfig \
$(MAKECMDGOALS))) # Ignore build targets if goal is not building
include $(CONFIG) # include configuration
-
-### Source files list ###########################
-SRC = base.c
-ifeq (y,$(CONFIG_IOPORTS))
-SRC += ioport.c
-endif
-ifeq (y,$(CONFIG_SPI))
-SRC += spi.c
-endif
-ifeq (y,$(CONFIG_USART))
-SRC += usart.c
-endif
-### End of source files list ####################
+include src/sources.mk
OBJ = $(patsubst %.c,$(O)/build/%.o,$(SRC))
DEP = $(patsubst %.c,$(O)/build/%.d,$(SRC))
@@ -102,52 +90,20 @@ clean-docs:
.PHONY: proper
proper: clean clean-docs
@echo " CLEAN CONFIG"
- $(Q)$(RM) $(CONFIG) $(CONFIG).orig
+ $(Q)$(RM) $(CONFIG) $(CONFIG).orig .config.cmd
.PHONY: help
help:
@echo "all/libioe.a - Build library"
@echo "config - Start configuration program"
- @echo "menuconfig - NCurses based configuration program"
+ @echo "menuconfig - NCurses based configuration program (Kconfig)"
@echo "docs - Build documentation"
@echo "server-docs - Start temporally http server with documentation"
@echo "help - Prints this text"
@echo "clean - Removing all object files generated from source files"
@echo "clean-docs - Remove generated documentation"
+ @echo "proper - Cleans everything including configuration"
-$(CONFIG):
- @echo Please generate configuration first using config or menuconfig target
- @exit 1
-
-# We don't wont pass any variable to Kconfig. This is workaround for that.
-MAKEOVERRIDES =
-
-callconfig = $(Q)\
- [ ! -f "$(CONFIG)" ] || mv "$(CONFIG)" config; \
- IOEROOT=. $(MAKE) -f tools/kconfig/GNUmakefile --no-print-directory \
- TOPDIR=. SRCDIR=tools/kconfig $(1); \
- [ ! -f config ] || mv config "$(CONFIG)"; \
- [ ! -f config.old ] || mv config.old "$(CONFIG).old"
-# Note about this file moving madness:
-# avr-ioe is using Kconfig for configuration and it is not prepared too well for
-# nested projects (at least I don't know way). This unfortunately means that to
-# have configuration in parent project, We have to move it every time we are
-# generating it. Also upper projects can't use Kconfig for its self configuration.
-
--include .config.cmd
-
-.PHONY: oldconfig
-oldconfig: $(deps_config)
- $(call callconfig, oldconfig)
-
-.PHONY: config
-config: $(deps_config)
- $(call callconfig, config)
-
-.PHONY: menuconfig
-menuconfig: $(deps_config)
- $(call callconfig, menuconfig)
-
-.PHONY: allyesconfig
-allyesconfig: $(deps_config)
- $(call callconfig, allyesconfig)
+TOOL_PATH=tools
+IOEROOT=.
+include tools/kconfig.mk