| xj | b04a402 | 2021-11-25 15:01:52 +0800 | [diff] [blame] | 1 | include $(TOPDIR)/rules.mk
|
| 2 |
|
| 3 | # Name, version and release number
|
| 4 | # The name and version of your package are used to define the variable to point to the build directory of your package: $(PKG_BUILD_DIR)
|
| 5 | PKG_NAME:=libtrm
|
| 6 | PKG_VERSION:=1.0
|
| 7 | #PKG_RELEASE:=1
|
| 8 |
|
| 9 | include $(INCLUDE_DIR)/package.mk
|
| 10 |
|
| 11 | # Package definition; instructs on how and where our package will appear in the overall configuration menu ('make menuconfig')
|
| 12 | define Package/libtrm
|
| 13 | SECTION:=MTK Properties
|
| 14 | CATEGORY:=MTK Properties
|
| 15 | SUBMENU:=Libraries
|
| 16 | TITLE:=TRM library
|
| 17 | DEPENDS:=$(CXX_DEPENDS) +libpthread +libc
|
| 18 | endef
|
| 19 |
|
| 20 | # Package description; a more verbose description on what our package does
|
| 21 | define Package/libtrm/description
|
| 22 | Telephony Recovery Mechanism (TRM) library
|
| 23 | endef
|
| 24 |
|
| 25 | # Package preparation instructions; create the build directory and copy the source code.
|
| 26 | # The last command is necessary to ensure our preparation instructions remain compatible with the patching system.
|
| 27 | define Build/Prepare
|
| 28 | mkdir -p $(PKG_BUILD_DIR)
|
| 29 | cp -af lib/* $(PKG_BUILD_DIR)
|
| 30 | $(Build/Patch)
|
| 31 | endef
|
| 32 |
|
| 33 | # Package build instructions; invoke the target-specific compiler to first compile the source file, and then to link the file into the final executable
|
| 34 | define Build/Compile
|
| 35 | $(MAKE) -C$(PKG_BUILD_DIR) OPENWRT=1 CFLAGS="$(TARGET_CFLAGS)" CC=$(TARGET_CC) CXX=$(TARGET_CXX) LD=$(TARGET_LD) AR=$(TARGET_AR) STRIP=$(STRIP) all
|
| 36 | endef
|
| 37 |
|
| 38 | # Package install instructions; create a directory inside the package to hold our executable, and then copy the executable we built previously into the folder
|
| 39 | define Package/libtrm/install
|
| 40 | $(INSTALL_DIR) $(1)/usr/lib
|
| 41 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/libtrm.so $(1)/usr/lib
|
| 42 | endef
|
| 43 |
|
| 44 | # This command is always the last, it uses the definitions and variables we give above in order to get the job done
|
| 45 | $(eval $(call BuildPackage,libtrm))
|
| 46 |
|