forked from openwebos/luna-sysservice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.inc
79 lines (60 loc) · 1.79 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
MACHINE ?= "x86"
OBJDIR := $(BUILD_TYPE)-$(MACHINE)
# ------------------------------------------------------------------
SOURCES := \
Logging.cpp \
LocalePrefsHandler.cpp \
Main.cpp \
PrefsDb.cpp \
PrefsFactory.cpp \
TimePrefsHandler.cpp \
UrlRep.cpp \
WallpaperPrefsHandler.cpp \
BuildInfoHandler.cpp \
Utils.cpp \
SystemRestore.cpp \
RingtonePrefsHandler.cpp \
ImageServices.cpp \
Mainloop.cpp \
TimeZoneService.cpp \
TzParser.cpp \
BackupManager.cpp \
Settings.cpp \
NetworkConnectionListener.cpp \
JSONUtils.cpp \
ImageHelpers.cpp
TARGET_OBJS := $(SOURCES:%.cpp=$(OBJDIR)/%.o)
TARGET_OBJS += $(C_SOURCES:%.c=$(OBJDIR)/%.o)
TARGET := $(OBJDIR)/LunaSysService
# ------------------------------------------------------------------
ifeq ("$(BUILD_TYPE)", "debug")
FLAGS_OPT := -O0 -g -fno-exceptions -fno-inline
else
FLAGS_OPT := -O2 -g -fno-exceptions -Wno-error
endif
FLAGS_OPT += -DMACHINE_$(MACHINE)=1 -DQT_PLUGIN
INCLUDES := $(INCLUDES) \
-I./Src \
-isystem $(INCLUDE_DIR) \
-isystem $(INCLUDE_DIR)/QtCore \
-isystem $(INCLUDE_DIR)/QtGui \
`pkg-config --cflags glib-2.0 freetype2`
LIBS := $(LIBS) \
-lglib-2.0 -llunaservice -lcjson -lsqlite3 -luriparser -lluna-prefs -lpbnjson_cpp -lQtCore -lQtGui
LOCAL_CFLAGS := $(CFLAGS) -Wall -Werror $(FLAGS_OPT) $(ARCH_CFLAGS)
LOCAL_LFLAGS := $(LDFLAGS) $(FLAGS_OPT) $(LIBS)
# ------------------------------------------------------------------
all: setup $(TARGET_OBJS) $(TARGET)
setup:
@mkdir -p $(OBJDIR)
vpath %.cpp Src
vpath %.c Src
$(TARGET): $(TARGET_OBJS)
$(CXX) -o $(TARGET) $(TARGET_OBJS) $(LOCAL_LFLAGS)
$(OBJDIR)/%.o: %.cpp
$(CXX) -MMD $(INCLUDES) $(LOCAL_CFLAGS) -fno-rtti -c $< -o $@
$(OBJDIR)/%.o: %.c
$(CC) -MMD $(INCLUDES) $(LOCAL_CFLAGS) -c $< -o $@
-include $(SOURCES:%.cpp=$(OBJDIR)/%.d)
clean:
rm -rf $(OBJDIR)