-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcomponent.mk
112 lines (84 loc) · 2.51 KB
/
component.mk
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
COMPONENT_DEPENDS := \
HardwareSPI
COMPONENT_SRCDIRS := \
src \
src/Drawing \
src/Display \
src/Touch \
src/Control \
src/Arch/$(SMING_ARCH)
COMPONENT_INCDIRS := \
src/include \
src/include/Arch/$(SMING_ARCH) \
resource
COMPONENT_DOXYGEN_INPUT := src/include
COMPONENT_DOCFILES := \
Tools/ged/README.rst \
Tools/ged/graphic-editor.png
export GRAPHICS_LIB_ROOT := $(COMPONENT_PATH)
#
COMPONENT_RELINK_VARS += ENABLE_GRAPHICS_DEBUG
ENABLE_GRAPHICS_DEBUG ?= 0
ifeq ($(ENABLE_GRAPHICS_DEBUG),1)
COMPONENT_CXXFLAGS += -DENABLE_GRAPHICS_DEBUG=1
endif
#
COMPONENT_VARS += ENABLE_GRAPHICS_RAM_TRACKING
ENABLE_GRAPHICS_RAM_TRACKING ?= 0
ifeq ($(ENABLE_GRAPHICS_RAM_TRACKING),1)
COMPONENT_CXXFLAGS += -DENABLE_GRAPHICS_RAM_TRACKING=1
endif
# Resource compiler
RC_TOOL_CMDLINE := $(PYTHON) -X utf8 $(GRAPHICS_LIB_ROOT)/Tools/rc/rc.py
##@Building
DEBUG_VARS += RESOURCE_SCRIPT RESOURCE_OUTPUT
ifdef RESOURCE_SCRIPT
RESOURCE_OUTPUT ?= $(PROJECT_DIR)/$(BUILD_BASE)
RESOURCE_FILES := $(RESOURCE_OUTPUT)/resource.h $(RESOURCE_OUTPUT)/resource.bin
COMPONENT_PREREQUISITES := $(RESOURCE_FILES)
COMPONENT_INCDIRS += $(RESOURCE_OUTPUT)
$(RESOURCE_FILES): $(RESOURCE_SCRIPT)
@echo RC $< $(RESOURCE_OUTPUT)
$(Q) $(RC_TOOL_CMDLINE) $(if $(Q),--quiet) $< $(RESOURCE_OUTPUT)
.PHONY: resource
resource: ##Rebuild resource files
$(Q) rm -f $(RESOURCE_FILES); $(MAKE) $(RESOURCE_FILES)
clean: graphics-clean
graphics-clean:
$(Q) rm -f $(RESOURCE_FILES)
endif
##@Tools
ifeq ($(SMING_ARCH),Host)
# For application use
CONFIG_VARS += ENABLE_VIRTUAL_SCREEN
CACHE_VARS += VSADDR VSPORT
ENABLE_VIRTUAL_SCREEN ?= 1
VSADDR ?= 192.168.1.105
VSPORT ?= 7780
ifeq ($(ENABLE_VIRTUAL_SCREEN),1)
APP_CFLAGS += -DENABLE_VIRTUAL_SCREEN=1
HOST_PARAMETERS ?= vsaddr=$(VSADDR) vsport=$(VSPORT)
endif
VIRTUAL_SCREEN_PY := $(GRAPHICS_LIB_ROOT)/Tools/vs/screen.py
VIRTUAL_SCREEN_CMDLINE := $(PYTHON) $(VIRTUAL_SCREEN_PY) --localport $(VSPORT)
# When using WSL without an X server available, use native Windows python
ifdef WSL_ROOT
ifndef DISPLAY
VIRTUAL_SCREEN_CMDLINE := powershell.exe -Command "$(VIRTUAL_SCREEN_CMDLINE)"
endif
endif
#
.PHONY: virtual-screen
virtual-screen: ##Start virtual screen server
$(info Starting virtual screen server)
$(Q) $(VIRTUAL_SCREEN_CMDLINE) &
endif
GEDIT_PY := $(GRAPHICS_LIB_ROOT)/Tools/ged/ged.py
GEDIT_CMDLINE := $(PYTHON) $(GEDIT_PY)
ifdef WSL_ROOT
GEDIT_CMDLINE := powershell.exe -Command "$(GEDIT_CMDLINE)"
endif
.PHONY: graphic-editor
graphic-editor: ##Run graphical editor
$(info Starting graphical editor)
$(Q) $(GEDIT_CMDLINE) &