xj | b04a402 | 2021-11-25 15:01:52 +0800 | [diff] [blame] | 1 | package_arch = $(subst -,_,${PACKAGE_ARCH}) |
rjw | 03fe4c0 | 2022-02-16 10:40:11 +0800 | [diff] [blame] | 2 | rpm_bin=${bindir}/rpm2cpio |
| 3 | |
| 4 | ifeq ("$(wildcard $(rpm_bin))","") |
| 5 | rpm_bin=rpm2cpio |
| 6 | endif |
xj | b04a402 | 2021-11-25 15:01:52 +0800 | [diff] [blame] | 7 | |
| 8 | #default toolchain is gcc |
| 9 | toolchain = gcc |
| 10 | #default use prop |
| 11 | property = prop |
| 12 | ifneq ($(findstring clang, ${CC}),) |
| 13 | # clang |
| 14 | toolchain = clang |
| 15 | endif |
| 16 | |
| 17 | ifneq ($(findstring mt2731, ${TARGET_PLATFORM}),) |
| 18 | # only 2731 use libsncfg |
| 19 | property = sncfg |
| 20 | endif |
| 21 | |
rjw | 03fe4c0 | 2022-02-16 10:40:11 +0800 | [diff] [blame] | 22 | ifneq ($(findstring mt2735, ${TARGET_PLATFORM}),) |
| 23 | # only 2735 use glibc 2.28 |
| 24 | toolchain = gcc_glibc_2.28 |
| 25 | endif |
| 26 | |
xj | b04a402 | 2021-11-25 15:01:52 +0800 | [diff] [blame] | 27 | lib_path = usr/lib |
| 28 | |
| 29 | ifneq ($(findstring aarch64, ${package_arch}),) |
| 30 | # aarch64 |
| 31 | lib_path = usr/lib64 |
| 32 | endif |
| 33 | |
| 34 | |
| 35 | all: |
| 36 | |
| 37 | install: |
rjw | 03fe4c0 | 2022-02-16 10:40:11 +0800 | [diff] [blame] | 38 | find -name "*.$(package_arch)_$(property)_$(toolchain).rpm" | while read i; do echo $${i}; ${rpm_bin} $${i} | cpio -idmv ; done |
xj | b04a402 | 2021-11-25 15:01:52 +0800 | [diff] [blame] | 39 | |
| 40 | install -d $(DESTDIR)/usr/bin/ |
| 41 | install -m 0755 usr/bin/aee_aed $(DESTDIR)/usr/bin |
| 42 | install -m 0755 usr/bin/aee_core_forwarder $(DESTDIR)/usr/bin |
| 43 | install -d $(DESTDIR)/$(lib_path)/ |
| 44 | install -m 0755 $(lib_path)/libaed.so $(DESTDIR)/$(lib_path) |
| 45 | |
| 46 | |
| 47 | uninstall: |
| 48 | rm -f $(DESTDIR)/usr/bin/aee_aed |
| 49 | rm -f $(DESTDIR)/usr/bin/aee_core_forwarder |
| 50 | rm -f $(DESTDIR)/$(lib_path)/libaed.so |
| 51 | |
| 52 | clean: |
| 53 | $(warning "aee make clean") |