131 lines
2.9 KiB
Makefile
Executable File
131 lines
2.9 KiB
Makefile
Executable File
include $(TOPDIR)/rules.mk
|
|
include $(BUILD_DIR)/kernel.mk
|
|
|
|
PKG_NAME:=libuapi
|
|
PKG_VERSION:=1
|
|
PKG_RELEASE:=1
|
|
|
|
PKG_BUILD_DIR := $(COMPILE_DIR)/$(PKG_NAME)
|
|
|
|
include $(BUILD_DIR)/package.mk
|
|
|
|
KERNEL_VERSION = CONF_KERNEL_VERSION_3_10
|
|
|
|
ifeq ($(TARGET_BOARD_PLATFORM),astar)
|
|
KERNEL_VERSION = CONF_KERNEL_VERSION_3_4
|
|
endif
|
|
ifeq ($(TARGET_BOARD_PLATFORM),octopus)
|
|
KERNEL_VERSION = CONF_KERNEL_VERSION_3_4
|
|
endif
|
|
ifeq ($(TARGET_BOARD_PLATFORM),astar)
|
|
KERNEL_VERSION = CONF_KERNEL_VERSION_3_4
|
|
endif
|
|
ifeq ($(TARGET_BOARD_PLATFORM),azalea)
|
|
KERNEL_VERSION = CONF_KERNEL_VERSION_3_10
|
|
endif
|
|
ifeq ($(TARGET_BOARD_PLATFORM),tulip)
|
|
KERNEL_VERSION = CONF_KERNEL_VERSION_4_4
|
|
endif
|
|
ifeq ($(TARGET_BOARD_PLATFORM),koto)
|
|
KERNEL_VERSION = CONF_KERNEL_VERSION_4_4
|
|
endif
|
|
ifeq ($(TARGET_BOARD_PLATFORM),sitar)
|
|
KERNEL_VERSION = CONF_KERNEL_VERSION_3_10
|
|
endif
|
|
ifeq ($(TARGET_BOARD_PLATFORM),cello)
|
|
KERNEL_VERSION = CONF_KERNEL_VERSION_3_10
|
|
endif
|
|
ifeq ($(TARGET_BOARD_PLATFORM),banjo)
|
|
KERNEL_VERSION = CONF_KERNEL_VERSION_3_4
|
|
endif
|
|
ifeq ($(TARGET_BOARD_PLATFORM),mandolin)
|
|
KERNEL_VERSION = CONF_KERNEL_VERSION_4_9
|
|
endif
|
|
|
|
define Package/$(PKG_NAME)
|
|
SECTION:=utils
|
|
CATEGORY:=Allwinner
|
|
TITLE:=unit api for Allwinner
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/Default
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/description
|
|
unit api for allwinner
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/config
|
|
choice
|
|
prompt "Choose display framework"
|
|
default SUNXI_DISPLAY_TWO
|
|
help
|
|
Select the preferred minigui running mode.
|
|
config SUNXI_DISPLAY_ONE
|
|
bool "sunxi_display1"
|
|
config SUNXI_DISPLAY_TWO
|
|
bool "sunxi_display2"
|
|
endchoice
|
|
choice
|
|
prompt "Choose alloc method."
|
|
default SUNXI_ALLOC_CMA
|
|
help
|
|
Select how to apply for memory.
|
|
config SUNXI_ALLOC_CMA
|
|
bool "sunxi_alloc_cma"
|
|
config SUNXI_ALLOC_IOMMU
|
|
bool "sunxi_alloc_iommu"
|
|
endchoice
|
|
endef
|
|
|
|
define Build/Prepare
|
|
$(INSTALL_DIR) $(PKG_BUILD_DIR)/
|
|
$(CP) ./src $(PKG_BUILD_DIR)/
|
|
endef
|
|
|
|
define Build/Configure
|
|
endef
|
|
|
|
ifeq ($(CONFIG_SUNXI_DISPLAY_TWO),y)
|
|
TARGET_CFLAGS+=-D__SUNXI_DISPLAY2__
|
|
TARGET_CFLAGS+=-D$(KERNEL_VERSION)
|
|
endif
|
|
ifeq ($(CONFIG_SUNXI_DISPLAY_ONE),y)
|
|
TARGET_CFLAGS+=-D__SUNXI_DISPLAY__
|
|
TARGET_CFLAGS+=-D$(KERNEL_VERSION)
|
|
endif
|
|
|
|
ifeq ($(CONFIG_SUNXI_ALLOC_CMA),y)
|
|
TARGET_CFLAGS+=-DCONF_KERNEL_CMA
|
|
endif
|
|
ifeq ($(CONFIG_SUNXI_ALLOC_IOMMU),y)
|
|
TARGET_CFLAGS+=-DCONF_KERNEL_IOMMU
|
|
endif
|
|
|
|
define Build/Compile
|
|
$(MAKE) -C $(PKG_BUILD_DIR)/src\
|
|
ARCH="$(TARGET_ARCH)" \
|
|
AR="$(TARGET_AR)" \
|
|
CC="$(TARGET_CC)" \
|
|
CXX="$(TARGET_CXX)" \
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
|
INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
|
|
all
|
|
endef
|
|
|
|
define Build/InstallDev
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
|
$(INSTALL_DIR) $(1)/usr/include
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/install
|
|
$(INSTALL_DIR) $(1)/usr/lib/
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
|
|
endef
|
|
|
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|