input_hal branch
[staging/toyota.git] / Makefile
1 #
2 # @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 COMPONENT_NAME := peripheral_service
18
19 ######### installed program/file ################
20 TARGET := libinput_hal.so
21
22 HEADER := ./hal_api/input_hal.h
23
24 ######### include paths/files ###################
25 CXXFLAGS := -I./inc/
26 CXXFLAGS += -I./hal_api/
27 CXXFLAGS += -I$(SDKTARGETSYSROOT)/usr/agl/include
28 CXXFLAGS += -I$(SDKTARGETSYSROOT)/usr/include/libdrm
29 CXXFLAGS += -include $(SDKTARGETSYSROOT)/usr/agl/include/agl_types_obsoluted.h
30
31 ######### compile options #######################
32 CXXFLAGS += -Wall -fPIC
33 CXXFLAGS += -D_USE_DRM
34
35 ######### link options ##########################
36 LDFLAGS := -shared
37 LDFLAGS += -Wl,--no-as-needed
38 LDFLAGS += -Wl,--no-undefined
39 LDFLAGS += -L$(SDKTARGETSYSROOT)/usr/agl/lib
40
41 ######### linked library ########################
42 LIBS := -Wl,-Bdynamic -lstdc++
43 LIBS += -Wl,-Bdynamic -lNS_FrameworkUnified
44 LIBS += -Wl,-Bdynamic -ludev
45 LIBS += -Wl,-Bdynamic -lpthread
46 LIBS += -Wl,-Bdynamic -ldrm
47
48 ######### source files ##########################
49 VPATH := src
50 OBJS := input_hal.o
51 OBJS += input_touch_ilitek.o
52 OBJS += input_util.o
53 OBJS += input_udev_monitor.o
54 OBJS += input_drm.o
55
56 ######### make targets ##########################
57 all: $(TARGET)
58         @echo $@ done.
59
60 $(TARGET): $(OBJS)
61         $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
62         @echo $@ done.
63
64 ######### make cleans ###########################
65 GCNO_FILES := $(filter %.gcno,$(OBJS:%.o=%.gcno))
66
67 clean:
68         rm -f $(OBJS) $(TARGET) $(GCNO_FILES)
69         @echo $@ done.
70
71 ######### make installs #########################
72 install: install-input
73 install:
74         install -d -m 0755 $(DESTDIR)/usr/lib
75         install -m 0755 $(TARGET) $(DESTDIR)/usr/lib
76         @echo $@ done.
77
78 install-input:
79         install -m 0755 -d $(DESTDIR)/usr/agl/include/$(COMPONENT_NAME)/
80         install -m 0644 ./hal_api/$(COMPONENT_NAME)/aglinput.h $(DESTDIR)/usr/agl/include/$(COMPONENT_NAME)/
81         install -m 0644 ./hal_api/$(COMPONENT_NAME)/extinput.h $(DESTDIR)/usr/agl/include/$(COMPONENT_NAME)/