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