• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14ifeq ($(PARAM_FILE), )
15    PARAM_FILE:= ../../../drv/mpp/Makefile.param
16    include $(PARAM_FILE)
17endif
18
19SYSROOT_PATH := $(OHOS_ROOT_PATH)/out/ohos-arm-release/obj/third_party/musl
20LLVM_SYSROOT_CFLAGS := --sysroot=$(SYSROOT_PATH)
21LLVM_TARGET_CFLAGS := -target arm-linux-ohos
22LIBS_CFLAGS += $(LLVM_SYSROOT_CFLAGS) -fuse-ld=lld $(LLVM_TARGET_CFLAGS)
23LIBS_LD_CFLAGS +=$(LLVM_SYSROOT_CFLAGS) -fuse-ld=lld $(LLVM_TARGET_CFLAGS)
24LIBS_LD_CFLAGS += -L$(SYSROOT_PATH)/usr/lib/arm-linux-ohos
25
26csrcs = $(wildcard *.c)
27OBJS = $(patsubst %.c,%.o,$(csrcs))
28
29LIBS = libsns_imx307.so
30
31CFLAGS += -I$(PWD)
32CFLAGS += -I$(PWD)/../include
33CFLAGS += -I$(PWD)/../../../drv/mpp/cbb/include
34CFLAGS += -I$(PWD)/../../../drv/mpp/cbb/based/arch/hi3516cv500/include/hi3516cv500
35CFLAGS += $(MPP_CFLAGS)
36CFLAGS += $(LIBS_CFLAGS)
37
38all: $(OBJS) $(LIBS)
39
40$(OBJS): %.o : %.c
41	@$(CC) $(CFLAGS) -c $< -o $@
42
43$(LIBS): $(OBJS)
44	@$(CC) $(LIBS_LD_CFLAGS) -shared -o $(LIBS) $(OBJS)
45	@$(RM) $(OBJS)
46
47clean:
48	@$(RM) $(OBJS) $(LIBS)
49