summaryrefslogtreecommitdiff
path: root/nfc
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-06-27 13:43:12 -0300
committerWerner Almesberger <werner@almesberger.net>2016-06-27 13:44:25 -0300
commit8b1419105ebb29e28f5e2a45d5ebb816f28ed3ef (patch)
treeb962c98419a69c23b4ef0bbb7c0679f2af0e966b /nfc
parentc9c3d3ddd0f7d42741eb3b24ca7ead31fe5d6126 (diff)
downloadmisc-8b1419105ebb29e28f5e2a45d5ebb816f28ed3ef.tar.gz
misc-8b1419105ebb29e28f5e2a45d5ebb816f28ed3ef.tar.bz2
misc-8b1419105ebb29e28f5e2a45d5ebb816f28ed3ef.zip
bib/: unify bibliography data and generation
Diffstat (limited to 'nfc')
-rw-r--r--nfc/Makefile6
-rwxr-xr-xnfc/sortbib.pl48
2 files changed, 3 insertions, 51 deletions
diff --git a/nfc/Makefile b/nfc/Makefile
index 5016df5..5501140 100644
--- a/nfc/Makefile
+++ b/nfc/Makefile
@@ -1,3 +1,5 @@
+BIBDIR = ../bib
+
FIGS = card stack sys prefix swp swp-t swp-cmp simseq \
pn-shared pn-local \
trf-stack trf-std trf-sdm trf-dm-sysclk trf-dm1-rx trf-comb trf-kl26 \
@@ -21,9 +23,7 @@ all: $(NAME).tex $(FIGS:%=%.pdf) $(FIGS_GEN:%=%.pdf) $(NAME).bbl
makeglossaries $(NAME)
pdflatex $(NAME)
-$(NAME).bbl: $(NAME).tex $(NAME).bib sortbib.pl
- ./sortbib.pl $(NAME).tex $(NAME).bib >$@ || \
- { rm -f "$@"; exit 1; }
+include $(BIBDIR)/Makefile.bib
spell: _tmp.spell
sed -e 's/\\url{[^}]*}//g' -e '/%.*/d' $(NAME).tex | \
diff --git a/nfc/sortbib.pl b/nfc/sortbib.pl
deleted file mode 100755
index 5e6e6be..0000000
--- a/nfc/sortbib.pl
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/perl
-
-sub usage
-{
- print STDERR "usage: $0 file.tex file.bib\n";
- exit(1);
-}
-
-
-&usage unless $#ARGV == 1;
-
-($tex, $bib) = @ARGV;
-
-open(TEX, $tex) || die "$tex: $!";
-$t = join("", <TEX>);
-close TEX;
-
-open(BIB, $bib) || die "$bib: $!";
-$b = join("", <BIB>);
-close BIB;
-
-while ($t =~ /\\cite{([^}]+)}/s) {
- for (split(/,/, $1)) {
- next if defined $seen{$_};
- $seen{$_} = 1;
- push(@c, $_);
- }
- $t = $';
-}
-
-while ($b =~ /\\bibitem{([^}]+)}/s) {
- $bib{$last} .= $` if defined $last;
- $last = $1;
- $bib{$1} = $&;
- $b = $';
-}
-$bib{$last} .= $b if defined $last;
-
-for (@c) {
- die "undefined citation \"$_\"" unless defined $bib{$_};
- print $bib{$_};
- $used{$_} = 1;
-}
-
-for (sort keys %bib) {
- print STDERR "warning: reference \"$_\" was not used\n"
- unless $used{$_};
-}