Merge branch 'master' of github.com:Wolfgang-Spraul/fpgatools

This commit is contained in:
Wolfgang Spraul 2012-10-03 04:16:10 +02:00
commit d96fb235ee
19 changed files with 10 additions and 396 deletions

3
.gitignore vendored
View File

@ -2,10 +2,11 @@
# common ignore files
#
.*
*.d
*.o
*.o.*
*.so
*.d
*.so.*
/tags
/TAGS

View File

@ -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/

6
debian/README vendored
View File

@ -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

6
debian/changelog vendored
View File

@ -1,6 +0,0 @@
fpgatools (0.0+201209-1) unstable; urgency=low
* New snapshot, taken from commit 3c94fff
* Initial release. (Closes: #686949)
-- Xiangfu Liu <xiangfu@openmobilefree.net> Tue, 14 Aug 2012 10:03:41 +0800

View File

@ -1,113 +0,0 @@
#!/bin/awk -f
# Generate debian/changelog.upstream from debian/changelog and
# the git revision log. Inspired by Gerrit Papes
# 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 <blah>.”
# Result is <blah>.
# 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");
}

108
debian/clean.sh vendored
View File

@ -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

1
debian/compat vendored
View File

@ -1 +0,0 @@
7

29
debian/control vendored
View File

@ -1,29 +0,0 @@
Source: fpgatools
Section: electronics
Priority: extra
Maintainer: Xiangfu Liu <xiangfu@openmobilefree.net>
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

33
debian/copyright vendored
View File

@ -1,33 +0,0 @@
This work was packaged for Debian by:
Xiangfu Liu <xiangfu@openmobilefree.net> 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 <http://unlicense.org/>
The Debian packaging is:
Copyright (C) 2012 Xiangfu Liu <xiangfu@openmobilefree.net> and is released
into the public domain.

1
debian/dirs vendored
View File

@ -1 +0,0 @@
usr/bin

View File

@ -1,2 +0,0 @@
usr/bin/bit2fp
usr/bin/fp2bit

View File

@ -1,2 +0,0 @@
doc/bit2fp.1
doc/fp2bit.1

View File

@ -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"

1
debian/libfpga.dirs vendored
View File

@ -1 +0,0 @@
usr/lib usr/include

View File

@ -1,2 +0,0 @@
usr/lib/libfpga-*.so
usr/include/*.h

51
debian/rules vendored
View File

@ -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 $@

View File

@ -1 +0,0 @@
3.0 (quilt)

1
debian/watch vendored
View File

@ -1 +0,0 @@
# We track fpgatools git revisions, thus no need for a watch file.

View File

@ -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