include $(TOPDIR)/rules.mk

PKG_NAME:=ogs-memory
PKG_VERSION:=1.0
PKG_RELEASE:=1
SOURCE_DIR:=/home/vboxuser/research-portable-memory/language-C++

include $(INCLUDE_DIR)/package.mk

define Package/ogs-memory
	SECTION:=games
	CATEGORY:=Games
	TITLE:=Memory
	DEPENDS:=+libstdcpp
endef

define Package/ogs-memory/description
	A simple "Memory" game in C++
endef

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	cp -r $(SOURCE_DIR)/* $(PKG_BUILD_DIR)
	$(Build/Patch)
endef

define Build/Compile
	$(TARGET_CXX) $(TARGET_CXXFLAGS) -o $(PKG_BUILD_DIR)/test.o -c $(PKG_BUILD_DIR)/src/test.cpp
	$(TARGET_CXX) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/$1 $(PKG_BUILD_DIR)/test.o
endef

define Package/ogs-memory/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/ogs-memory $(1)/usr/bin
endef

$(eval $(call BuildPackage,ogs-memory))
