From a295fd46ebe73c0893fbd5dbe55685503b83c846 Mon Sep 17 00:00:00 2001 From: Xiangfu Date: Tue, 23 Oct 2012 23:07:56 +0800 Subject: [PATCH] fpgatools: rename mini-jtag to fpgatools, include fp2bit/bit2fp --- fpgatools/Makefile | 60 +++++++++++++++++++++ fpgatools/patches/exclude-static-libs.patch | 42 +++++++++++++++ mini-jtag/Makefile | 45 ---------------- 3 files changed, 102 insertions(+), 45 deletions(-) create mode 100644 fpgatools/Makefile create mode 100644 fpgatools/patches/exclude-static-libs.patch delete mode 100644 mini-jtag/Makefile diff --git a/fpgatools/Makefile b/fpgatools/Makefile new file mode 100644 index 0000000..7ba0fd1 --- /dev/null +++ b/fpgatools/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2012 Xiangfu Liu +# bitcoin: 12h6gdGnThW385JaX1LRMA8cXKmbYRTP8Q +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=fpgatools +PKG_VERSION:=$(shell date +%Y%m%d) +PKG_REV:=HEAD +PKG_RELEASE:=1 +PKG_INSTALL:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz +PKG_SOURCE_URL:=git://github.com/Wolfgang-Spraul/fpgatools.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) + +include $(INCLUDE_DIR)/package.mk + +define Package/fpgatools + MAINTAINER:="Xiangfu Liu" + SECTION:=utils + CATEGORY:=Utilities + TITLE:=fpgatools + URL:=https://github.com/ckolivas/fpgatools + DEPENDS:=+libusb +libftdi +endef + +define Package/fpgatools/description +fpgatools is a toolchain to program field-programmable gate arrays (FPGAs) +endef + +TARGET_LDFLAGS += -lusb -lftdi + +define Build/Compile + $(call Build/Compile/Default, fp2bit, bit2fp) + $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/mini-jtag \ + $(MAKE_FLAGS) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/fpgatools/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/lib + + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/mini-jtag $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/fp2bit $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/bit2fp $(1)/usr/bin + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/local/lib/libfpga-* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,fpgatools)) diff --git a/fpgatools/patches/exclude-static-libs.patch b/fpgatools/patches/exclude-static-libs.patch new file mode 100644 index 0000000..6671bd0 --- /dev/null +++ b/fpgatools/patches/exclude-static-libs.patch @@ -0,0 +1,42 @@ +diff --git a/Makefile b/Makefile +index 1aed6d1..a44dbe0 100644 +--- a/Makefile ++++ b/Makefile +@@ -245,8 +245,6 @@ install: fp2bit bit2fp + mkdir -p $(DESTDIR)/$(PREFIX)/bin/ + install -m 755 fp2bit $(DESTDIR)/$(PREFIX)/bin/ + install -m 755 bit2fp $(DESTDIR)/$(PREFIX)/bin/ +- chrpath -d $(DESTDIR)/$(PREFIX)/bin/fp2bit +- chrpath -d $(DESTDIR)/$(PREFIX)/bin/bit2fp + + uninstall: + @make -C libs uninstall +diff --git a/libs/Makefile b/libs/Makefile +index 159125a..1628cae 100644 +--- a/libs/Makefile ++++ b/libs/Makefile +@@ -27,7 +27,7 @@ DYNAMIC_HEADS = bit.h control.h floorplan.h helper.h model.h parts.h + SHARED_FLAGS = -shared -Wl,-soname,$@.$(LIBS_VERSION_MAJOR) + .PHONY: all clean install uninstall FAKE + +-all: $(DYNAMIC_LIBS) $(DYNAMIC_LIBS:.so=.a) ++all: $(DYNAMIC_LIBS) + + include ../Makefile.common + +@@ -75,15 +75,11 @@ install: all + mkdir -p $(DESTDIR)/$(PREFIX)/lib/ + install -m 644 $(DYNAMIC_HEADS) $(DESTDIR)/$(PREFIX)/include/ + for f in $(DYNAMIC_LIBS); do \ +- chrpath -d $$f.$(LIBS_VERSION_MAJOR) && \ + install -m 644 $$f.$(LIBS_VERSION) $(DESTDIR)/$(PREFIX)/lib/$$f.$(LIBS_VERSION) && \ + (cd $(DESTDIR)/$(PREFIX)/lib/ && \ + ln -sf $$f.$(LIBS_VERSION) $$f.$(LIBS_VERSION_MAJOR) && \ + ln -sf $$f.$(LIBS_VERSION_MAJOR) $$f) \ + || exit 1; done +- for f in $(DYNAMIC_LIBS:.so=.a); do \ +- install -m 644 $$f $(DESTDIR)/$(PREFIX)/lib/$$f \ +- || exit 1; done + + uninstall: + for f in $(DYNAMIC_HEADS); do rm -f $(DESTDIR)/$(PREFIX)/include/$$f || exit 1; done diff --git a/mini-jtag/Makefile b/mini-jtag/Makefile deleted file mode 100644 index 5a47825..0000000 --- a/mini-jtag/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# -# Copyright (C) 2012 Xiangfu Liu -# bitcoin: 12h6gdGnThW385JaX1LRMA8cXKmbYRTP8Q -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=mini-jtag -PKG_VERSION:=$(shell date +%Y%m%d) -PKG_REV:=HEAD -PKG_RELEASE:=1 -PKG_INSTALL:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz -PKG_SOURCE_URL:=git://github.com/xiangfu/mini-jtag.git -PKG_SOURCE_PROTO:=git -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=$(PKG_REV) - -include $(INCLUDE_DIR)/package.mk - -define Package/mini-jtag - MAINTAINER:="Xiangfu Liu" - SECTION:=utils - CATEGORY:=Utilities - TITLE:=mini-jtag - URL:=https://github.com/ckolivas/mini-jtag - DEPENDS:=+libusb +libftdi -endef - -define Package/mini-jtag/description -Mini-jtag is a minimal jtag for communicate with fpga chip -endef - -TARGET_LDFLAGS += -lusb -lftdi - -define Package/mini-jtag/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/mini-jtag $(1)/usr/bin -endef - -$(eval $(call BuildPackage,mini-jtag))