打印

qnx make

[复制链接]
7091|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
keer_zu|  楼主 | 2021-6-9 11:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
QNX, ST, TE, nex, RS, FOR
#
#   Generally useful recursive makefile.
#
#   Finds any subdirectories with "Makefile" in them, and
#   recurses into them, issuing "make" with the specified
#   target. Do not recurse into a directory if there is
#   a "Makefile.dnm" file present.
#

export
unexport PWD
unexport LIST
unexport makelist
unexport makefiles
unexport mkfile
unexport force_dirs
unexport qbdir
unexport firstdir
unexport restdir
unexport ignore
unexport sep
unexport makecmd
unexport inc_list
unexport exc_list
unexport tmp
unexport reallist
unexport MAKEFILE
unexport goal
unexport dnm_list

goals:=$(if $(MAKECMDGOALS),$(MAKECMDGOALS),all)

ifndef MAKEFILE
MAKEFILE=[Mm]akefile
endif

makefiles:=$(wildcard */$(MAKEFILE))
mkfile:=$(notdir $(firstword $(makefiles)))
makelist:=$(sort $(patsubst %/,%,$(dir $(makefiles))))

dnm_list:=$(patsubst %/,%/.$(firstword $(goals)),$(subst Makefile.dnm,,$(wildcard */[Mm]akefile.dnm*)))
x_list:=$(foreach tmp,$(dnm_list), $(subst ., ,$(notdir $tmp)))
dnm_list:=$(foreach tmp,$(dnm_list), $(if $(filter $(goals), $(subst ., ,$(notdir $(tmp)))),$(patsubst %/,%,$(dir $(tmp)))))

makelist:=$(filter-out $(dnm_list),$(makelist))

ifneq ($(filter CPU OS,$(LIST)),)
#
# If we're working on a CPU or OS list, figure out what target systems we
# can actually build based on the host system we're running on.
#
ifndef QBUILDLIST
QBUILDLIST=buildlist.mk
ifdef QCONFIG
qbdir=$(dir $(QCONFIG))
endif
endif
-include $(qbdir)$(QBUILDLIST)
endif

ifneq (,$(LIST))
ifdef CHECKFORCE
force_dirs:=$(patsubst %/,%,$(dir $(wildcard */[Mm]akefile.force)))
endif

inc_list:=.BUGFIX. $(sort $(foreach var, $(LIST), $($(var)LIST)))
inc_list:=$(filter-out .BUGFIX., $(inc_list))
exc_list:=.BUGFIX. $(sort $(foreach var, $(LIST), $(EXCLUDE_$(var)LIST)))
exc_list:=$(filter-out .BUGFIX., $(exc_list))

ifneq (,$(exc_list))
makelist:=$(filter-out $(filter-out $(force_dirs), $(foreach dir,$(makelist),$(if $(filter $(subst ., ,$(subst -, ,$(dir))),$(subst /, ,$(exc_list))),$(dir)))),$(makelist))
endif

ifneq (,$(inc_list))
reallist:=$(foreach var,$(LIST),$(if $($(var)LIST),$(var),))
makelist:=$(filter-out $(filter-out $(force_dirs), $(foreach dir,$(makelist),$(foreach var,$(reallist),$(if $(filter $(subst ., ,$(subst -, ,$(dir))),$(subst /, ,$($(var)LIST))),,$(dir))))),$(makelist))
endif
endif

makelist:=$(foreach dir,$(EARLY_DIRS),$(filter $(dir),$(makelist))) $(filter-out $(EARLY_DIRS) $(LATE_DIRS), $(makelist)) $(foreach dir,$(LATE_DIRS),$(filter $(dir),$(makelist)))
firstdir:=$(firstword $(makelist))
restdir :=$(filter-out $(firstdir), $(makelist))

ifneq ($(findstring k,$(MFLAGS)),)
ignore=-
endif
# define the separator as a newline character - handles differences
# between Unix and Win32 style shells.
define sep


endef

makecmd = $(ignore)$(MAKE) -j $(firstword $(JLEVEL) 1) -C$(dir) -f$(mkfile) $(if $(MAKECMDGOALS),$@)

$(goals):
    $(foreach dir, $(firstdir), $(makecmd))$(foreach dir, $(restdir), $(sep) $(makecmd))



使用特权

评论回复

相关帖子

沙发
keer_zu|  楼主 | 2021-6-9 12:02 | 只看该作者
#
#        Generally useful recursive makefile.
#
#        Finds any subdirectories with "Makefile" in them, and
#        recurses into them, issuing "make" with the specified
#        target. Do not recurse into a directory if there is
#   a "Makefile.dnm" file present.
#

export
unexport PWD
unexport LIST
unexport makelist
unexport makefiles
unexport mkfile
unexport force_dirs
unexport qbdir
unexport firstdir
unexport restdir
unexport ignore
unexport sep
unexport makecmd
unexport inc_list
unexport exc_list
unexport tmp
unexport reallist
unexport MAKEFILE
unexport goal
unexport dnm_list

goals:=$(if $(MAKECMDGOALS),$(MAKECMDGOALS),all)

ifndef MAKEFILE
MAKEFILE=[Mm]akefile
endif

makefiles:=$(wildcard */$(MAKEFILE))
mkfile:=$(notdir $(firstword $(makefiles)))
makelist:=$(sort $(patsubst %/,%,$(dir $(makefiles))))

dnm_list:=$(patsubst %/,%/.$(firstword $(goals)),$(subst Makefile.dnm,,$(wildcard */[Mm]akefile.dnm*)))
x_list:=$(foreach tmp,$(dnm_list), $(subst ., ,$(notdir $tmp)))
dnm_list:=$(foreach tmp,$(dnm_list), $(if $(filter $(goals), $(subst ., ,$(notdir $(tmp)))),$(patsubst %/,%,$(dir $(tmp)))))

makelist:=$(filter-out $(dnm_list),$(makelist))

ifneq ($(filter CPU OS,$(LIST)),)
#
# If we're working on a CPU or OS list, figure out what target systems we
# can actually build based on the host system we're running on.
#
ifndef QBUILDLIST
QBUILDLIST=buildlist.mk
ifdef QCONFIG
qbdir=$(dir $(QCONFIG))
endif
endif
-include $(qbdir)$(QBUILDLIST)
endif

ifneq (,$(LIST))
ifdef CHECKFORCE
force_dirs:=$(patsubst %/,%,$(dir $(wildcard */[Mm]akefile.force)))
endif

inc_list:=.BUGFIX. $(sort $(foreach var, $(LIST), $($(var)LIST)))
inc_list:=$(filter-out .BUGFIX., $(inc_list))
exc_list:=.BUGFIX. $(sort $(foreach var, $(LIST), $(EXCLUDE_$(var)LIST)))
exc_list:=$(filter-out .BUGFIX., $(exc_list))

ifneq (,$(exc_list))
makelist:=$(filter-out $(filter-out $(force_dirs), $(foreach dir,$(makelist),$(if $(filter $(subst ., ,$(subst -, ,$(dir))),$(subst /, ,$(exc_list))),$(dir)))),$(makelist))
endif

ifneq (,$(inc_list))
reallist:=$(foreach var,$(LIST),$(if $($(var)LIST),$(var),))
makelist:=$(filter-out $(filter-out $(force_dirs), $(foreach dir,$(makelist),$(foreach var,$(reallist),$(if $(filter $(subst ., ,$(subst -, ,$(dir))),$(subst /, ,$($(var)LIST))),,$(dir))))),$(makelist))
endif
endif

makelist:=$(foreach dir,$(EARLY_DIRS),$(filter $(dir),$(makelist))) $(filter-out $(EARLY_DIRS) $(LATE_DIRS), $(makelist)) $(foreach dir,$(LATE_DIRS),$(filter $(dir),$(makelist)))
firstdir:=$(firstword $(makelist))
restdir :=$(filter-out $(firstdir), $(makelist))

ifneq ($(findstring k,$(MFLAGS)),)
ignore=-
endif
# define the separator as a newline character - handles differences
# between Unix and Win32 style shells.
define sep


endef

makecmd = $(ignore)$(MAKE) -j $(firstword $(JLEVEL) 1) -C$(dir) -f$(mkfile) $(if $(MAKECMDGOALS),$@)

$(goals):
        $(foreach dir, $(firstdir), $(makecmd))$(foreach dir, $(restdir), $(sep) $(makecmd))

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:qq群:49734243 Email:zukeqiang@gmail.com

1351

主题

12429

帖子

53

粉丝