Fix the path to the directory of the include files
[staging/basesystem.git] / hal / clock_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 ######### installed program/file ################
18 TARGET := libclock_hal.so
19
20 HEADER := hal_api/clock_hal.h
21
22 ######### include paths/files ###################
23 CXXFLAGS := -I./inc/
24 CXXFLAGS += -I./hal_api/
25 CXXFLAGS += -I$(SDKTARGETSYSROOT)/usr/include/basesystem
26 CXXFLAGS += -include $(SDKTARGETSYSROOT)/usr/include/basesystem/agl_types_obsoluted.h
27
28 ######### compile options #######################
29 CXXFLAGS += -Wall -fPIC
30 CXXFLAGS += -DAGL_REFHW
31
32 ######### link options ##########################
33 LDFLAGS += -shared
34 LDFLAGS += -Wl,--no-as-needed
35 LDFLAGS += -Wl,--no-undefined
36 LDFLAGS += -L$(SDKTARGETSYSROOT)/usr/agl/lib
37
38 RPATH :=
39
40 ######### linked library ########################
41 LIBS += -Wl,-Bdynamic -lstdc++
42 LIBS += -Wl,-Bdynamic -lNS_FrameworkUnified
43
44 ######### source files ##########################
45 VPATH := src
46 OBJS := clock_hal.o
47
48 ######### make targets ##########################
49 all: $(TARGET)
50         @echo $@ done.
51
52 $(TARGET): $(OBJS)
53         $(CC) $(LDFLAGS) -Wl,-rpath=$(RPATH) $(OBJS) $(LIBS) -o $(TARGET)
54         @echo $@ done.
55
56 ######### make cleans ###########################
57 GCNO_FILES := $(filter %.gcno,$(OBJS:%.o=%.gcno))
58
59 clean:
60         rm -f $(OBJS) $(TARGET) $(GCNO_FILES)
61         @echo $@ done.
62
63 ######### make installs #########################
64 install:
65         install -d -m 0755 $(DESTDIR)/usr/lib
66         install -m 0755 $(TARGET) $(DESTDIR)/usr/lib
67         @echo $@ done.