forked from nxp-mcuxpresso/nxp-vee-mcxn947-frdm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.inc
151 lines (129 loc) · 5.43 KB
/
Makefile.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#
# Copyright 2023 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
ifeq ($(OS),Windows_NT)
S2SEXE=$(BSP_DIR)/projects/common/scripts/s2s.bat
LINK=&&
TOUCH=cmd /c type nul >
EXPORT=cmd /c SET
UNZIP=tar -xf
FIND_JAVA_FILES_IN_APP_DIR=$(shell cmd /c dir /s /b "$(subst /,\,$(APP_DIR))\*.java")
else
S2SEXE=$(BSP_DIR)/projects/common/scripts/s2s.sh
LINK=;
TOUCH=touch
EXPORT=export
UNZIP=unzip
FIND_JAVA_FILES_IN_APP_DIR=$(shell find $(APP_DIR) -name "*.java")
endif
.PRECIOUS: .java.fp .java.mock .java.configuration .%.java.app
.java.fp: $(FP_DIR)/module.ivy
cd $(FP_DIR) $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish \
-Declipse.home="$(ECLIPSE_HOME)" \
-Dcom.microej.platformbuilder.architecture.usage=$(USAGE) \
$(MODULE_REPOSITORY_SETTINGS) \
$(JAVA_VERBOSE)
$(TOUCH) $@
.java.mock:
cd $(MOCK_DIR) $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish \
-Declipse.home="$(ECLIPSE_HOME)" \
-Dcom.microej.platformbuilder.architecture.usage=$(USAGE) \
$(MODULE_REPOSITORY_SETTINGS) \
$(JAVA_VERBOSE)
$(TOUCH) $@
.java.configuration: $(CONF_DIR)/module.ivy
cd $(CONF_DIR) $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish $(PUBLISH_MODE) \
$(PUBLISH_ARTIFACTS) \
-Declipse.home="$(ECLIPSE_HOME)" \
-Dcom.microej.platformbuilder.architecture.usage=$(USAGE) \
$(MODULE_REPOSITORY_SETTINGS) \
$(JAVA_VERBOSE)
$(TOUCH) $@
.java.test.s2s:
$(S2SEXE) $(S2S_TTY) $(S2S_PORT) &
javasec.prop :
$(MICROEJ_SEC)
$(addprefix .java.test.,$(VALIDATIONS)): javasec.prop
cd $(TEST_DIR$@) $(LINK) $(EXPORT) TEST_TYPE="ARMGCC" $(EXPORT) CMAKE_OPTS=$(OPT) $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish \
-Declipse.home="$(ECLIPSE_HOME)" \
$(MODULE_REPOSITORY_SETTINGS) \
-Dcom.microej.platformbuilder.architecture.usage=$(USAGE) \
-Dplatform-loader.target.platform.dir=$(PLAT_DIR)/source \
-Ddeploy.bsp.root.dir=$(BSP_DIR) \
-Dlaunch.properties.jvm="-Djava.security.properties=$(BASE_DIR)/javasec.prop" \
-D"local.repo.url=$(BASE_DIR)/test_results/" \
-Dplatform-launcher.platform.dir=$(PLAT_DIR)/source $(JAVA_VERBOSE)
.%.java.app: javasec.prop $(APP_DIR)/module.ivy $(FIND_JAVA_FILES_IN_APP_DIR)
cd $(APP_DIR) $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm publish \
-Declipse.home="$(ECLIPSE_HOME)" \
$(MODULE_REPOSITORY_SETTINGS) \
-Dcom.microej.platformbuilder.architecture.usage=$(USAGE) \
-Dplatform-loader.target.platform.dir=$(PLAT_DIR)/source \
-Dplatform-launcher.platform.dir=$(PLAT_DIR)/source \
-Dapplication.main.class=$(if $(MAIN),$(MAIN),$(MAIN$@)) \
-Dlaunch.properties.jvm="-Djava.security.properties=$(BASE_DIR)/javasec.prop" \
-Ddeploy.bsp.root.dir=$(BSP_DIR) $(JAVA_VERBOSE)
$(call del_file,.*.java.app)
$(TOUCH) $@
nxpvee-validation.prj: clean .java.fp .java.mock .java.configuration .java.test.s2s $(addprefix .java.test.,$(VALIDATIONS))
echo "done"
%.prj: .java.fp .java.mock .java.configuration .%.java.app
make -C $(BSP_DIR)/projects/$(basename $@)/sdk_makefile $(OPT)
$(addsuffix -javazip,$(PROJS)):
make clean
cd $(BSP_DIR)/projects/microej; $(UNZIP) $(JAVAZIP)
make -C $(BSP_DIR)/projects/$(@:%-javazip=%)/sdk_makefile
$(addsuffix -flash,$(PROJS)):
make $(@:%-flash=%).prj
make -C $(BSP_DIR)/projects/$(@:%-flash=%)/sdk_makefile flash
$(addsuffix -flash_cmsisdap,$(PROJS)):
make $(@:%-flash_cmsisdap=%).prj
make -C $(BSP_DIR)/projects/$(@:%-flash_cmsisdap=%)/sdk_makefile flash_cmsisdap
$(addsuffix -gdb,$(PROJS)):
make $(@:%-gdb=%).prj
make -C $(BSP_DIR)/projects/$(@:%-gdb=%)/sdk_makefile gdb
$(addsuffix -gdb_cmsisdap,$(PROJS)):
make $(@:%-gdb_cmsisdap=%).prj
make -C $(BSP_DIR)/projects/$(@:%-gdb_cmsisdap=%)/sdk_makefile gdb_cmsisdap
$(addsuffix -java_run,$(PROJS)): .java.fp .java.mock .java.configuration
cd $(APP_DIR) $(LINK) $(MICROEJ_BUILDKIT_PATH_VAR)/bin/mmm run \
-Declipse.home="$(ECLIPSE_HOME)" \
$(MODULE_REPOSITORY_SETTINGS) \
-Dcom.microej.platformbuilder.architecture.usage=$(USAGE) \
-Dplatform-loader.target.platform.dir=$(PLAT_DIR)/ \
-Dapplication.main.class=$(if $(MAIN),$(MAIN),$(MAIN.$(@:%-java_run=%).java.app)) \
-Dplatform-launcher.platform.dir=$(PLAT_DIR)/source $(JAVA_VERBOSE)
$(addsuffix -java_rebuild,$(PROJS)): .java.fp .java.mock .java.configuration
$(call del_file,.*.java.app)
make .$(@:%-java_rebuild=%).java.app
$(addsuffix -clean,$(PROJS)):
make -C $(BSP_DIR)/projects/$(@:%-clean=%)/sdk_makefile clean
make -C $(BSP_DIR)/projects/$(@:%-clean=%)/sdk_makefile distclean
$(call del_file,.*.java.app)
$(call del_file,.java.*)
$(call del_file,javasec.prop*)
$(call del_dir,$(PLAT_DIR)/build/)
$(call del_dir,$(PLAT_DIR)/source/)
$(call del_dir,$(CONF_DIR)/dropins/include)
$(call del_dir,$(CONF_DIR)/dropins/javaLibs)
$(call del_dir,$(CONF_DIR)/dropins/mocks)
$(call del_file,$(CONF_DIR)/dropins/workbenchExtension_launchScriptFramework.jar)
$(call del_file,$(CONF_DIR)/dropins/imagegenerator-vectorimage.jar)
$(call del_file,$(CONF_DIR)/dropins/license-checker.jar)
$(call del_dir,$(CONF_DIR)/target~/)
$(call del_dir,$(FP_DIR)/bin/)
$(call del_dir,$(FP_DIR)/lib/)
$(call del_dir,$(FP_DIR)/target~/)
$(call del_dir,$(APP_DIR)/bin/)
$(call del_dir,$(APP_DIR)/filesystem/)
$(call del_dir,$(APP_DIR)/src-adpgenerated/)
$(call del_dir,$(APP_DIR)/target~/)
$(call del_dir,$(BSP_DIR)/projects/microej/platform/)
$(call del_dir,$(MOCK_DIR)/bin/)
$(call del_dir,$(MOCK_DIR)/target~/)
$(call del_dir,$(VAL_DIR)/core/java-testsuite-runner-core/target~/)
$(call del_dir,$(BSP_DIR)/projects/nxpvee-ui/mcuide/Release/)
clean: $(addsuffix -clean,$(PROJS))
echo "clean"