Add gitlab issue/merge request templates
[staging/basesystem.git] / hal / input_hal / 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=/usr/include/basesystem
28 CXXFLAGS += -I=/usr/include/libdrm
29 CXXFLAGS += -include agl_types_deprecated.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
40 ######### linked library ########################
41 LIBS := -Wl,-Bdynamic -lstdc++
42 LIBS += -Wl,-Bdynamic -lNS_FrameworkUnified
43 LIBS += -Wl,-Bdynamic -ludev
44 LIBS += -Wl,-Bdynamic -lpthread
45 LIBS += -Wl,-Bdynamic -ldrm
46
47 ######### source files ##########################
48 VPATH := src
49 OBJS := input_hal.o
50 OBJS += input_touch_ilitek.o
51 OBJS += input_util.o
52 OBJS += input_udev_monitor.o
53 OBJS += input_drm.o
54
55 ######### make targets ##########################
56 all: $(TARGET)
57         @echo $@ done.
58
59 $(TARGET): $(OBJS)
60         $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
61         @echo $@ done.
62
63 ######### make cleans ###########################
64 GCNO_FILES := $(filter %.gcno,$(OBJS:%.o=%.gcno))
65
66 clean:
67         rm -f $(OBJS) $(TARGET) $(GCNO_FILES)
68         @echo $@ done.
69
70 ######### make installs #########################
71 install: install-input
72 install:
73         install -d -m 0755 $(DESTDIR)/usr/lib
74         install -m 0755 $(TARGET) $(DESTDIR)/usr/lib
75         @echo $@ done.
76
77 install-input:
78         install -m 0755 -d $(DESTDIR)/usr/include/basesystem/$(COMPONENT_NAME)/
79         install -m 0644 ./hal_api/$(COMPONENT_NAME)/aglinput.h $(DESTDIR)/usr/include/basesystem/$(COMPONENT_NAME)/
80         install -m 0644 ./hal_api/$(COMPONENT_NAME)/extinput.h $(DESTDIR)/usr/include/basesystem/$(COMPONENT_NAME)/