aboutsummaryrefslogtreecommitdiff
path: root/libs/libowfat/Makefile
blob: 94f1777117c096cbfba9f1117564c8994e9b2f5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=libowfat
PKG_VERSION:=0.33
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.fefe.de/libowfat
PKG_HASH:=311ec8b3f4b72bb442e323fb013a98f956fa745547f2bc9456287b20d027cd7d
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING

PKG_BUILD_DEPENDS += libowfat/host

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk

# set to 1 to enable debugging
DEBUG=

define Package/libowfat
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=reimplemented libdjb under GPL
  URL:=https://www.fefe.de/libowfat/
  BUILDONLY:=1
endef

define Build/Configure
endef

TARGET_CFLAGS += $(FPIC)
LOWFAT_MAKEOPTS = $(TARGET_CONFIGURE_OPTS) \
	AR="ar" \
	CFLAGS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include" \
	CCC="$(TARGET_CC)" \
	CROSS="$(TARGET_CROSS)" \
	DEBUG="$(DEBUG)" \
	VERSION="$(PKG_VERSION)" \
	OS="Linux"

LOWFAT_HOST_MAKEOPTS = $(HOST_CONFIGURE_OPTS) \
	CFLAGS="$(HOST_CFLAGS) -I$(HOST_BUILD_DIR) -I$(STAGING_DIR_HOSTPKG)/include" \
	DEBUG="$(DEBUG)" \
	VERSION="$(PKG_VERSION)" \
	OS="Linux"

define Build/Compile
	$(MAKE) -C $(PKG_BUILD_DIR) $(LOWFAT_MAKEOPTS)
endef

define Host/Compile
	$(LN) . $(HOST_BUILD_DIR)/libowfat
	$(MAKE) -C $(HOST_BUILD_DIR) $(LOWFAT_HOST_MAKEOPTS) ent
endef

define Host/Install
	$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
	$(CP) $(HOST_BUILD_DIR)/ent $(STAGING_DIR_HOSTPKG)/bin/libowfat-ent
endef

define Build/InstallDev
	mkdir -p $(1)/usr/include/libowfat
	$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libowfat
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_BUILD_DIR)/*.a $(1)/usr/lib
endef

$(eval $(call HostBuild))
$(eval $(call BuildPackage,libowfat))