-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
154 lines (141 loc) · 4.48 KB
/
Makefile
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
152
153
154
# This Makefile written by EXL 17-SEP-2016
#
# App can compile for platform:
# PLATFORM=EZX-Z6
# PLATFORM=EZX-Z6W
# PLATFORM=EZX-U9
# PLATFORM=EZX-ZN5 (default)
# PLATFORM=EZX-V8
# PLATFORM=EZX-E8
# PLATFORM=EZX-VE66
# PLATFORM=EZX-EM35
#
# For example - compile this source for Motorla ZN5:
#
# cd /PROJECT_FOLDER/
# make clean
# make PLATFORM=EZX-ZN5
#
####### Config
APPNAME := keyd
UPLOAD_PATH := /mmc/mmca1/
#APP_DEFINES := -DDEBUG_LOG -DCONFIG_APPWRITE
####### SDK and Toolchains
TOOLPREFIX := /arm-eabi
ARMLIB := $(TOOLPREFIX)/arm-linux-gnueabi/lib
####### Default Platform
ifeq ($(PLATFORM),)
PLATFORM = EZX-ZN5
endif
####### Platforms
ifeq ($(PLATFORM),EZX-Z6)
QTDIR := $(TOOLPREFIX)/lib/qt-2.3.8
EZXDIR := $(TOOLPREFIX)/lib/ezx-z6
LINKLIB := -lm -lqte-mt -lezxpm -ljpeg -lezxappbase -lezxtapi-xscale-r -llog_util -llighting
DIRECTIV := -DEZX_Z6 $(APP_DEFINES)
TARGET = $(APPNAME)_Z6
endif
ifeq ($(PLATFORM),EZX-V8)
QTDIR := $(TOOLPREFIX)/lib/qt-v8
EZXDIR := $(TOOLPREFIX)/lib/ezx-v8
LINKLIB := -lm -lqte-mt -lezxpm -lezxappbase
DIRECTIV := -DEZX_V8 $(APP_DEFINES)
TARGET = $(APPNAME)_V8
ZNEWCHECKBOX = 1
endif
ifeq ($(PLATFORM),EZX-E8)
ARMLIB := $(TOOLPREFIX)/arm-linux-gnueabi/lib_E8
QTDIR := $(TOOLPREFIX)/lib/qt-e8
EZXDIR := $(TOOLPREFIX)/lib/ezx-e8
LINKLIB := -lm -lqte-mt -lezxappbase
DIRECTIV := -DEZX_E8 $(APP_DEFINES)
TARGET = $(APPNAME)_E8
endif
ifeq ($(PLATFORM),EZX-EM30)
ARMLIB := $(TOOLPREFIX)/arm-linux-gnueabi/lib_E8
QTDIR := $(TOOLPREFIX)/lib/qt-em30
EZXDIR := $(TOOLPREFIX)/lib/ezx-em30
EZXDIR2 := $(TOOLPREFIX)/lib/ezx-e8
LINKLIB := -lm -lqte-mt -lezxappbase
DIRECTIV := -DEZX_EM30 $(APP_DEFINES)
TARGET = $(APPNAME)_EM30
endif
ifeq ($(PLATFORM),EZX-U9)
QTDIR := $(TOOLPREFIX)/lib/qt-zn5
EZXDIR := $(TOOLPREFIX)/lib/ezx-u9
EZXDIR2 := $(TOOLPREFIX)/lib/ezx-zn5
LINKLIB := -lm -lqte-mt -lezxappbase -llighting
DIRECTIV := -DEZX_U9 $(APP_DEFINES)
TARGET = $(APPNAME)_U9
endif
ifeq ($(PLATFORM),EZX-Z6W)
QTDIR := $(TOOLPREFIX)/lib/qt-z6w
EZXDIR := $(TOOLPREFIX)/lib/ezx-z6w
LINKLIB := -lm -lqte-mt -lezxappbase
DIRECTIV := -DEZX_Z6W $(APP_DEFINES)
TARGET = $(APPNAME)_Z6W
endif
ifeq ($(PLATFORM),EZX-ZN5)
QTDIR := $(TOOLPREFIX)/lib/qt-zn5
EZXDIR := $(TOOLPREFIX)/lib/ezx-zn5
LINKLIB := -lm -lqte-mt -lezxappbase
DIRECTIV := -DEZX_ZN5 $(APP_DEFINES)
TARGET = $(APPNAME)_ZN5
endif
ifeq ($(PLATFORM),EZX-EM35)
ARMLIB := $(TOOLPREFIX)/arm-linux-gnueabi/lib_E8
QTDIR := $(TOOLPREFIX)/lib/qt-em35
EZXDIR := $(TOOLPREFIX)/lib/ezx-em35
LINKLIB := -lm -lqte-mt -lezxappbase
DIRECTIV := -DEZX_EM35 $(APP_DEFINES)
TARGET = $(APPNAME)_EM35
endif
ifeq ($(PLATFORM),EZX-VE66)
ARMLIB := $(TOOLPREFIX)/arm-linux-gnueabi/lib_E8
QTDIR := $(TOOLPREFIX)/lib/qt-em35
EZXDIR := $(TOOLPREFIX)/lib/ezx-ve66
LINKLIB := -lm -lqte-mt -lezxappbase
DIRECTIV := -DEZX_VE66 $(APP_DEFINES)
TARGET = $(APPNAME)_VE66
endif
####### Build Tools and Options
CC = $(TOOLPREFIX)/bin/arm-linux-gnueabi-gcc
CXX = $(TOOLPREFIX)/bin/arm-linux-gnueabi-g++
LD = $(TOOLPREFIX)/bin/arm-linux-gnueabi-g++
STRIP = $(TOOLPREFIX)/bin/arm-linux-gnueabi-strip
CFLAGS = -pipe -Wall -W -O2 -DNO_DEBUG $(INCPATH)
CXXFLAGS = -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG $(DIRECTIV) $(INCPATH)
INCPATH = -I$(QTDIR)/include -I$(EZXDIR)/include -I$(TOOLPREFIX)/arm-linux-gnueabi/include
LDFLAGS = -s
LINK = $(TOOLPREFIX)/bin/arm-linux-gnueabi-gcc
LFLAGS = -Wl,-rpath-link,$(EZXDIR)/lib
LIBS = $(SUBLIBS) -L$(EZXDIR)/lib -L$(ARMLIB) -L$(QTDIR)/lib $(LINKLIB)
MOC = $(QTDIR)/bin/moc
UIC = $(QTDIR)/bin/uic
####### Files
HEADERS = keyd.cpp
SOURCES = keyd.cpp
OBJECTS = keyd.o
SRCMOC = moc_keyd.cpp
####### Targets
TARGETS = $(TARGET)
INTERFACE_DECL_PATH = .
all: $(SRCMOC) $(TARGET)
$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)
$(STRIP) -s $(MAKETO) $(TARGET)
moc: $(SRCMOC)
rmobj:
-rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS)
-rm -f *~ core
$(RM) *.o
$(RM) moc_*.cpp
clean:
-rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS)
-rm -f *~ core
$(RM) *.o
$(RM) moc_*.cpp
$(RM) $(TARGET) $(APPNAME)_*
#--------- moc's -----------------------------
moc_keyd.cpp: keyd.cpp
$(MOC) keyd.cpp -o moc_keyd.cpp