From 36bce2959a15014a8df8d739b9603f66e0d836c8 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 19 May 2020 16:28:03 +0800 Subject: [PATCH] build: Remove the duplicated definition Signed-off-by: Xiang Xiao --- Make.defs | 54 ++++------------------- import/Make.defs | 112 +---------------------------------------------- 2 files changed, 10 insertions(+), 156 deletions(-) diff --git a/Make.defs b/Make.defs index 5e4b33a1d..82e2b7f14 100644 --- a/Make.defs +++ b/Make.defs @@ -73,6 +73,14 @@ BINDIR ?= $(APPDIR)$(DELIM)bin BIN ?= $(APPDIR)$(DELIM)libapps$(LIBEXT) +# Tools + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + MKKCONFIG ?= $(APPDIR)$(DELIM)tools$(DELIM)mkkconfig.bat +else + MKKCONFIG ?= $(APPDIR)$(DELIM)tools$(DELIM)mkkconfig.sh +endif + # Invoke make define MAKE_template @@ -89,7 +97,6 @@ endef # Builtin Registration BUILTIN_REGISTRY = $(APPDIR)$(DELIM)builtin$(DELIM)registry - DEPCONFIG = $(TOPDIR)$(DELIM).config define REGISTER @@ -105,51 +112,6 @@ define ARLOCK $(Q) flock $1.lock $(call ARCHIVE, $1, $(2)) endef -# Tools - -ifeq ($(DIRLINK),) -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.bat - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.bat -else ifeq ($(CONFIG_WINDOWS_MSYS),y) - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh -else - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh -ifeq ($(CONFIG_CYGWIN_WINTOOL),y) - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh -else - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh -endif -endif -endif - -ifeq ($(INCDIR),) -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - INCDIR = $(TOPDIR)$(DELIM)tools$(DELIM)incdir.bat -else - INCDIR = $(TOPDIR)$(DELIM)tools$(DELIM)incdir.sh -endif -endif - -ifeq ($(DEFINE),) -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - DEFINE = $(TOPDIR)$(DELIM)tools$(DELIM)define.bat -else - DEFINE = $(TOPDIR)$(DELIM)tools$(DELIM)define.sh -endif -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - MKKCONFIG = $(APPDIR)$(DELIM)tools$(DELIM)mkkconfig.bat -else - MKKCONFIG = $(APPDIR)$(DELIM)tools$(DELIM)mkkconfig.sh -endif - -ifeq ($(CONFIG_CYGWIN_WINTOOL),y) - INCDIR += -w -endif - # Standard include path CFLAGS += ${shell $(INCDIR) "$(CC)" "$(APPDIR)$(DELIM)include"} diff --git a/import/Make.defs b/import/Make.defs index 454444c5f..7764b0aca 100644 --- a/import/Make.defs +++ b/import/Make.defs @@ -33,118 +33,10 @@ # ############################################################################ +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk include $(TOPDIR)/scripts/Make.defs -# Control build verbosity -# -# V=1,2: Enable echo of commands -# V=2: Enable bug/verbose options in tools and scripts - -ifeq ($(V),1) -export Q := -else -ifeq ($(V),2) -export Q := -else -export Q := @ -endif -endif - -# Some defaults just to prohibit some bad behavior if for some reason they -# are not defined - -OBJEXT ?= .o -LIBEXT ?= .a - -# Common default definitions -# -# PREPROCESS - Default macro to run the C pre-processor -# COMPILE - Default macro to compile one C file -# COMPILEXX - Default macro to compile one C++ file -# ASSEMBLE - Default macro to assemble one assembly language file - -define PREPROCESS - @echo "CPP: $1->$2" - $(Q) $(CPP) $(CPPFLAGS) $($(strip $1)_CPPFLAGS) $1 -o $2 -endef - -define COMPILE - @echo "CC: $1" - $(Q) $(CC) -c $(CFLAGS) $($(strip $1)_CFLAGS) $1 -o $2 -endef - -define COMPILEXX - @echo "CXX: $1" - $(Q) $(CXX) -c $(CXXFLAGS) $($(strip $1)_CXXFLAGS) $1 -o $2 -endef - -define ASSEMBLE - @echo "AS: $1" - $(Q) $(CC) -c $(AFLAGS) $($(strip $1)_AFLAGS) $1 -o $2 -endef - -# Environment-specific definitions -# -# DELIM - Environment-specific file path separator -# ARCHIVE - Add a list of files to an archive -# DELFILE - Delete one file -# DELDIR - Delete one directory -# MOVEFILE - Move one file -# CLEAN - Default clean target - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - -DELIM = $(strip \) - -define ARCHIVE - $(AR) $1 $(2) -endef - -define DELFILE - $(Q) if exist $1 (del /f /q $1) -endef - -define DELDIR - $(Q) if exist $(1) (rmdir /q /s $(1)) -endef - -define MOVEFILE - $(Q) if exist $1 (move /Y $1 $2) -endef - -define CLEAN - $(Q) if exist *$(OBJEXT) (del /f /q *$(OBJEXT)) - $(Q) if exist *$(LIBEXT) (del /f /q *$(LIBEXT)) - $(Q) if exist *~ (del /f /q *~) - $(Q) if exist (del /f /q .*.swp) -endef - -else - -DELIM = $(strip /) - -define ARCHIVE - $(AR) $1 $(2) -endef - -define DELFILE - $(Q) rm -f $1 -endef - -define DELDIR - $(Q) rm -rf $(1) -endef - -define MOVEFILE - $(Q) mv -f $1 $2 -endef - -define CLEAN - $(Q) rm -f *$(OBJEXT) *$(LIBEXT) *~ .*.swp -endef - -endif - # Tool related definitions # Compiler