You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 1.0 kB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # -*- coding: utf-8 -*-
  2. # MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
  3. #
  4. # Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
  5. #
  6. # Unless required by applicable law or agreed to in writing,
  7. # software distributed under the License is distributed on an
  8. # "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. ifeq ($(SDKPATH),)
  10. CURDIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
  11. SDKPATH = $(CURDIR)/arm64-v8a
  12. endif
  13. TARGET := libmace_loader.so
  14. all: $(TARGET)
  15. # can be find at NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/
  16. CXX = aarch64-linux-android21-clang++
  17. CXXFLAGS = -std=c++14 -I$(SDKPATH)/include \
  18. -Dmgb_mace_loader_init=mgb_c_opr_init
  19. DEBUG ?= 0
  20. ifeq ($(DEBUG), 1)
  21. CXXFLAGS += -O0 -g
  22. else
  23. CXXFLAGS += -O2
  24. endif
  25. LDFLAGS = -L$(SDKPATH)/lib -lmace -llog
  26. LDLIBS = -shared -fPIC
  27. $(TARGET): mace_loader.cpp extern_c_opr.h
  28. $(CXX) $(CXXFLAGS) $(LDLIBS) -o $@ $< $(LDFLAGS)
  29. clean:
  30. @rm -f $(TARGET)