diff --git a/.gitignore b/.gitignore index 7819d83..42bf14f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,11 @@ # common ignore files # .* +*.d *.o *.o.* *.so -*.d +*.so.* /tags /TAGS diff --git a/Makefile b/Makefile index 01372c0..c320a02 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,8 @@ # -CFLAGS += `pkg-config libxml-2.0 --cflags` CFLAGS += -I$(CURDIR)/libs -LDLIBS += `pkg-config libxml-2.0 --libs` - LDFLAGS += -Wl,-rpath,$(CURDIR)/libs OBJS = autotest.o bit2fp.o draw_svg_tiles.o fp2bit.o hstrrep.o \ @@ -203,6 +200,8 @@ bit2fp: bit2fp.o $(DYNAMIC_LIBS) new_fp: new_fp.o $(DYNAMIC_LIBS) +draw_svg_tiles: CFLAGS += `pkg-config libxml-2.0 --cflags` +draw_svg_tiles: LDLIBS += `pkg-config libxml-2.0 --libs` draw_svg_tiles: draw_svg_tiles.o $(DYNAMIC_LIBS) pair2net: pair2net.o $(DYNAMIC_LIBS) @@ -241,7 +240,7 @@ clean: rm -f test.out/compare_xc6slx9.fp rmdir --ignore-fail-on-non-empty test.out test.gold -install: all +install: fp2bit bit2fp @make -C libs install mkdir -p $(DESTDIR)/$(PREFIX)/bin/ install -m 755 fp2bit $(DESTDIR)/$(PREFIX)/bin/ diff --git a/debian/README b/debian/README deleted file mode 100644 index 9355342..0000000 --- a/debian/README +++ /dev/null @@ -1,6 +0,0 @@ -This Debian package is developed in a Git repository. to build from -a git checkout: - - debian/rules get-orig-source # take commit from debian/changelog - mv fpgatools_0.0+*.orig.tar.gz .. - debuild diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 9304de4..0000000 --- a/debian/changelog +++ /dev/null @@ -1,6 +0,0 @@ -fpgatools (0.0+201209-1) unstable; urgency=low - - * New snapshot, taken from commit 3c94fff - * Initial release. (Closes: #686949) - - -- Xiangfu Liu Tue, 14 Aug 2012 10:03:41 +0800 diff --git a/debian/changelog.upstream.awk b/debian/changelog.upstream.awk deleted file mode 100644 index 6755ede..0000000 --- a/debian/changelog.upstream.awk +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/awk -f -# Generate debian/changelog.upstream from debian/changelog and -# the git revision log. Inspired by Gerrit Pape’s -# debian/changelog.upstream.sh, from the git-core Debian package. -# -# Requires a working /dev/stderr. -# -# Usage: -# dpkg-parsechangelog --format rfc822 --all | -# awk -f debian/changelog.upstream.awk - -# If argument matches /^Version: /, return remaining text. -# Result is nonempty if and only if argument matches. -function version_line(line) { - if (line ~ /^Version: /) { - sub(/^Version: /, "", line); - return line; - } - return ""; -} - -# If argument matches /^\*.* from commit /, return remaining text. -# Result is nonempty if and only if argument matches. -function commit_id_line(line) { - if (line ~ / from commit /) { - sub(/^.* from commit /, "", line); - sub(/[(][Cc]loses.*/, "", line); - sub(/[^0-9a-f]*$/, "", line); - return line; - } - return ""; -} - -# Read standard input, scanning for a changelog entry of the -# form “* New snapshot, taken from commit .” -# Result is . -# Result is empty and writes a message to standard error if no such entry is -# found before the next Version: line with a different upstream -# version (or EOF). -# Argument is the upstream version sought. -function read_commit_id(upstream, line,version,corresponding_upstream,commit) { - while (getline line) { - version = version_line(line); - corresponding_upstream = version; - sub(/-[^-]*$/, "", corresponding_upstream); - if (version != "" && corresponding_upstream != upstream) - break; - - commit = commit_id_line(line); - if (commit != "") - return commit; - } - - print "No commit id for " upstream >> "/dev/stderr"; - return ""; -} - -BEGIN { - last = "none"; - last_cid = "none"; - cl = "debian/changelog.upstream"; -} - -# Add a list of all revisions up to last to debian/changelog.upstream -# and set last = new_cid. -# new is a user-readable name for the commit new_cide. -function add_version(new,new_cid, limiter,versionline,command,line) { - if (last == "none") { - printf "" > cl; - last = new; - last_cid = new_cid; - return 0; - } - - if (new == "none") { - versionline = "Version " last; - limiter = ""; - } else { - versionline = "Version " last "; changes since " new ":"; - limiter = new_cid ".."; - } - print versionline >> cl; - gsub(/./, "-", versionline); - print versionline >> cl; - - print "" >> cl; - command = "git shortlog \"" limiter last_cid "\""; - while(command | getline line) - print line >> cl; - - if (new != "none") - print "" >> cl; - last = new; - last_cid = new_cid; -} - -{ - version = version_line($0); - if (version != "") { - # strip Debian revision - upstream_version = version; - sub(/-[^-]*$/, "", upstream_version); - - commit = read_commit_id(upstream_version); - if (commit == "") - exit 1; - add_version(upstream_version, commit); - } -} - -END { - add_version("none", "none"); -} diff --git a/debian/clean.sh b/debian/clean.sh deleted file mode 100644 index 1b17a8b..0000000 --- a/debian/clean.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh -# Clean up after a failed build. -# -# Requires access to .gitignore files excluding _all_ modified files. -# -# Requires a working /dev/fd (with more than just /dev/fd/0 and 1) -# or gawk. - -set -e - -splitgitignore='#!/usr/bin/awk -!/^#/ && !/^$/ { - glob = /[[*?]/; - directory = /\/$/; - sub(/\/$/, ""); - anchored = /\//; - sub(/^\//, ""); - - output = "nonexistent/nonsense"; - if (anchored) { - if (!directory && !glob) - output = "/dev/fd/1"; - else if (directory && !glob) - output = "/dev/fd/3"; - else if (!directory && glob) - output = "/dev/fd/4"; - else if (directory && glob) - output = "/dev/fd/5"; - } else { - if (!directory) - output = "/dev/fd/6"; - else - output = "/dev/fd/7"; - } - print >> output; -} -' - -offlimits="-type d -name '.*' -prune -o -type d -name debian -prune" - -remove_file_globs() { - while read glob - do - eval "rm -f $glob" - done -} - -remove_directory_globs() { - while read glob - do - eval "rm -fr $glob" - done -} - -remove_file_findpatterns() { - while read pat - do - find . $offlimits -o \ - '(' -name "$pat" -execdir rm -f '{}' + ')' - done -} - -remove_directory_findpatterns() { - while read pat - do - find . $offlimits -o \ - '(' -type d -name "$pat" -execdir rm -fr '{}' + ')' - done -} - -find . $offlimits -o '(' -name .gitignore -print ')' | -while read file -do - ( - cd "$(dirname "$file")" - # Dispatch using pipes. Yuck. - { { { { { - awk "$splitgitignore" | - { - # anchored files (globless) - xargs -d '\n' rm -f - } - } 3>&1 >&2 | - { - # anchored directories (globless) - xargs -d '\n' rm -fr - } - } 4>&1 >&2 | - { - # anchored files - remove_file_globs - } - } 5>&1 >&2 | - { - # anchored directories - remove_directory_globs - } - } 6>&1 >&2 | - { - # unanchored files - remove_file_findpatterns - } - } 7>&1 >&2 | - { - remove_directory_findpatterns - } >&2 - ) < "$file" -done diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 7f8f011..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -7 diff --git a/debian/control b/debian/control deleted file mode 100644 index c07bfc5..0000000 --- a/debian/control +++ /dev/null @@ -1,29 +0,0 @@ -Source: fpgatools -Section: electronics -Priority: extra -Maintainer: Xiangfu Liu -Build-Depends: debhelper (>= 7.4.10), pkg-config, - libxml2-dev -Standards-Version: 3.9.3 -Homepage: https://github.com/Wolfgang-Spraul/fpgatools - -Package: fpgatools -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: tool to program flexible programmable gate arrays - fpgatools is a toolchain to program flexible programmable - gate arrays (FPGAs). The only supported chip at this time is - the xc6slx9, a cheap (ca. 10 USD) but powerful 45nm-generation - chip with about 2400 LUTs, block ram and multiply-accumulate devices - -Package: libfpga -Architecture: any -Section: libs -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: libs of fpgatools - small independent command line utilities, no GUI - plain C, no C++ - simple Makefiles - text-based file formats - no documentation - read the sources - automatic test suite diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 96a1f37..0000000 --- a/debian/copyright +++ /dev/null @@ -1,33 +0,0 @@ -This work was packaged for Debian by: - - Xiangfu Liu on Tue, 14 Aug 2012 10:57:14 +0800 - -It was downloaded from: - - https://github.com/Wolfgang-Spraul/fpgatools - -Upstream Author: - - Wolfgang Spraul - -Copyright: - - Copyright 2012 by Wolfgang Spraul - -License: - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR - OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - For more information, please refer to - -The Debian packaging is: - - Copyright (C) 2012 Xiangfu Liu and is released - into the public domain. - diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index e772481..0000000 --- a/debian/dirs +++ /dev/null @@ -1 +0,0 @@ -usr/bin diff --git a/debian/fpgatools.install b/debian/fpgatools.install deleted file mode 100644 index fbbb29f..0000000 --- a/debian/fpgatools.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/bin/bit2fp -usr/bin/fp2bit diff --git a/debian/fpgatools.manpages b/debian/fpgatools.manpages deleted file mode 100644 index 925104c..0000000 --- a/debian/fpgatools.manpages +++ /dev/null @@ -1,2 +0,0 @@ -doc/bit2fp.1 -doc/fp2bit.1 diff --git a/debian/get-orig-source.sh b/debian/get-orig-source.sh deleted file mode 100644 index 5f26767..0000000 --- a/debian/get-orig-source.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# Build a tarball from the latest upstream version, with a nice -# version number. -# -# Requires git 1.6.6 or later, GNU date, and gzip. - -set -e - -: ${REPO=$(git rev-parse --git-dir)} -: ${BRANCH=remotes/origin/master} - -mkdir debian-orig-source -trap 'rm -fr debian-orig-source || exit 1' EXIT - -git init -q debian-orig-source -GIT_DIR=$(pwd)/debian-orig-source/.git -export GIT_DIR - -# Fetch latest upstream version. -git fetch -q "$REPO" "$BRANCH" - -# Determine version number. -release=0.0 -date=$(date --utc --date="$(git log -1 --pretty=format:%cD FETCH_HEAD)" "+%Y%m") -upstream_version="${release}+${date}" - -# Generate tarball. -echo "packaging $(git rev-parse --short FETCH_HEAD)" -git archive FETCH_HEAD | - gzip -n -9 >"fpgatools_$upstream_version.orig.tar.gz" diff --git a/debian/libfpga.dirs b/debian/libfpga.dirs deleted file mode 100644 index 505b6cc..0000000 --- a/debian/libfpga.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/lib usr/include diff --git a/debian/libfpga.install b/debian/libfpga.install deleted file mode 100644 index 0348aa0..0000000 --- a/debian/libfpga.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/libfpga-*.so -usr/include/*.h diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 2c8a06b..0000000 --- a/debian/rules +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/make -f -# This file is in the public domain. -# You may freely use, modify, distribute, and relicense it. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -export PREFIX=/usr - -build clean install binary-arch binary-indep binary: - +dh --parallel $(opt_no_act) $@ - -override_dh_auto_clean: - $(MAKE) clean - sh debian/clean.sh - -override_dh_installchangelogs: - dpkg-parsechangelog --format rfc822 --all | \ - awk -f debian/changelog.upstream.awk - dh_installchangelogs debian/changelog.upstream - -# Remove auto test for fast develop -# will include auto_test in the end -override_dh_auto_test: - -opt_optimize = CFLAGS="-g -O2" -opt_no_act = -opt_quiet = - -ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) - opt_optimize = CFLAGS="-g -O0" -endif - -ifneq (,$(findstring n,$(MAKEFLAGS))) - opt_no_act = --no-act -endif - -ifneq (,$(filter quiet,$(DEB_BUILD_OPTIONS))) - opt_quiet = --quiet - MAKEFLAGS += --quiet -endif - -REPO = git://github.com/Wolfgang-Spraul/fpgatools.git -BRANCH = master -debiandir_SQ = $(subst ','\'',$(dir $(lastword $(MAKEFILE_LIST)))) -get-orig-source: - REPO='$(REPO)' BRANCH='$(BRANCH)' \ - sh '$(debiandir_SQ)'get-orig-source.sh - -%: - dh $@ diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/debian/watch b/debian/watch deleted file mode 100644 index 6544de6..0000000 --- a/debian/watch +++ /dev/null @@ -1 +0,0 @@ -# We track fpgatools git revisions, thus no need for a watch file. diff --git a/libs/Makefile b/libs/Makefile index b0dc933..83ac9cd 100644 --- a/libs/Makefile +++ b/libs/Makefile @@ -6,7 +6,7 @@ # For details see the UNLICENSE file at the root of the source tree. # -LIBS_VERSION = 0.0.0 +LIBS_VERSION = 0 LIBFPGA_BIT_OBJS = bit_frames.o bit_regs.o LIBFPGA_MODEL_OBJS = model_main.o model_tiles.o model_devices.o \ @@ -41,21 +41,22 @@ libfpga-floorplan.so: $(LIBFPGA_FLOORPLAN_OBJS) libfpga-control.so: $(LIBFPGA_CONTROL_OBJS) %.so: - $(CC) -shared -Wl,-soname,$@ -o $@ $^ + $(CC) -shared -Wl,-soname,$@.$(LIBS_VERSION) -o $@.$(LIBS_VERSION) $^ + @rm -f $@ && ln -s $@.$(LIBS_VERSION) $@ %.o: %.c $(CC) $(CFLAGS) -fPIC -o $@ -c $< $(MKDEP) clean: - rm -f *.o *.d *.so + rm -f $(OBJS) $(OBJS:.o=.d) $(DYNAMIC_LIBS) $(DYNAMIC_LIBS:.so=.so.$(LIBS_VERSION)) install: all mkdir -p $(DESTDIR)/$(PREFIX)/lib/ mkdir -p $(DESTDIR)/$(PREFIX)/include/ install -m 644 $(DYNAMIC_HEADS) $(DESTDIR)/$(PREFIX)/include/ for f in $(DYNAMIC_LIBS); do \ - install -m 644 $$f $(DESTDIR)/$(PREFIX)/lib/$$f.$(LIBS_VERSION) && \ + install -m 644 $$f.$(LIBS_VERSION) $(DESTDIR)/$(PREFIX)/lib/$$f.$(LIBS_VERSION) && \ (cd $(DESTDIR)/$(PREFIX)/lib/ && ln -s $$f.$(LIBS_VERSION) $$f) \ || exit 1; done