toupper = $(shell echo $1 |tr '[a-z]' '[A-Z]')
tolower = $(shell echo $1 |tr '[A-Z]' '[a-z]')
mkbat = ./makebat
mkflag = all
first_upper_word = $(call toupper,$(word 1,$(subst __, ,$@)))
second_upper_word = $(call toupper,$(word 2,$(subst __, ,$@)))
mkbsp = $(mkbat) bspver $(mkflag) $(first_upper_word) $(second_upper_word)
mklcardbsp = $(mkbat) bspver $(mkflag) $(second_upper_word) $(first_upper_word)
mklib = $(mkbat) $(call tolower,$(word 2,$(subst __, ,$@))) $(mkflag) $(first_upper_word)
mkcommon = $(mkbat) process $(mkflag) $(second_upper_word) $(first_upper_word) liball
mkproc = $(mkbat) process $(mkflag) $(second_upper_word) $(first_upper_word) allproc
mkboard = $(mkbat) board $(mkflag) $(second_upper_word) $(first_upper_word) allproc
mkprj = $(mkbat) prj $(mkflag) NCPA $(second_upper_word) comprj
mkapp = $(mkbat) process $(mkflag) $(second_upper_word) $(first_upper_word) app
mkallproc = $(mkbat) process $(mkflag) $(second_upper_word) $(first_upper_word) allproc
mklcardadm = $(mkbat) process $(mkflag) COMMON $(first_upper_word) admlinecard
board_cpu = p2020 armadaxp saber
prj_cpu = 83xx armam335x saber armadaxp
lcard_bsp_83xx = $(addsuffix __bspver,$(addprefix 83xx__,61NPC_8313 OIGE8 RMU))
lcard_bsp_arm = $(addsuffix __bspver,$(addprefix am335x__,E1E16))
lcard_app = SAI E1t1_Coeus FEGE E1T1 STM_COEUS GPC RMU
lcard_app_saber = $(addprefix saber__,$(wordlist 2,3,$(lcard_app)))
lcard_app_armadaxp = $(addprefix armadaxp__,$(wordlist 1,3,$(lcard_app)))
lcard_app_p2020 = $(addprefix p2020__,$(wordlist 1,3,$(lcard_app)))
lcard_app_armam335x = $(addprefix armam335x__,$(wordlist 1,3,$(lcard_app)))
lcard_app_83xx = $(addprefix 83xx__,$(wordlist 3,7,$(lcard_app)))
all: sme smk smha lcard_app_83xx lcard_app_armam335x
$(lcard_bsp_arm) $(lcard_bsp_83xx):
$(call mklcardbsp)
p2020__bspver:sme__p2020__bspver
armadaxp__bspver:smk__armadaxp__bspver
saber__bspver:smha__saber__bspver
%__bspver:
$(call mkbsp)
%__tuliplib:%__bspver
$(call mklib)
%__dbscore:%__tuliplib
$(call mklib)
%__COMMON:%__dbscore
$(call mkcommon)
%__NCPA:%__dbscore
$(call mkcommon)
%__COMMON__proc:%__COMMON
$(call mkproc)
%__NCPA__proc:%__NCPA
$(call mkproc)
%__COMMON__board:%__COMMON
$(call mkboard)
%__NCPA__board:%__NCPA
$(call mkboard)
83xx__tuliplib:$(lcard_bsp_83xx)
$(call mklib)
armam335x__tuliplib:$(lcard_bsp_arm)
$(call mklib)
$(prj_cpu):%:prj__%
prj__%:%__tuliplib
$(call mkprj)
$(lcard_app_p2020):p2020__dbscore
$(call mkapp)
$(lcard_app_armadaxp):armadaxp__dbscore
$(call mkapp)
$(lcard_app_saber):saber__dbscore
$(call mkapp)
$(lcard_app_armam335x):armam335x__adm
$(call mkallproc)
armam335x__adm:prj__armam335x
$(call mklcardadm)
$(lcard_app_83xx):83xx__adm
$(call mkallproc)
83xx__adm:prj__83xx
$(call mklcardadm)
lcard_app_p2020:$(lcard_app_p2020)
lcard_app_armadaxp:$(lcard_app_armadaxp)
lcard_app_saber:$(lcard_app_saber)
lcard_app_83xx:$(lcard_app_83xx)
lcard_app_armam335x:$(lcard_app_armam335x)
$(board_cpu):%: %__COMMON__board %__NCPA__board lcard_app_%
sme: p2020
smk: armadaxp
smha: saber
阅读(928) | 评论(0) | 转发(0) |