dev-util/bam: initial import of version 0.4.0

Change-Id: I47700ffab5ccbf16948ddf9a96092b95755325d5
Reviewed-on: https://galileo.mailstation.de/gerrit/6100
Reviewed-by: Jenkins <wk@mailstation.de>
Reviewed-by: Julian Ospald <hasufell@posteo.de>
This commit is contained in:
2016-05-19 20:07:37 +02:00
parent 85ed03323a
commit e8ff20f208
3 changed files with 161 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
From c74e0bde7033139427bc2812c6ee0f68d6e15962 Mon Sep 17 00:00:00 2001
From: Julian Ospald <hasufell@posteo.de>
Date: Thu, 19 May 2016 17:32:16 +0200
Subject: [PATCH] Add Makefile
Upstram: pending, https://github.com/matricks/bam/pull/92
This is needed to package bam correctly in linux distributions.
The current shell script is insufficient and doesn't give enough control.
---
Makefile | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 Makefile
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4eace57
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,49 @@
+# install directories
+INSTALL_PREFIX = /usr
+INSTALL_BINDIR = $(INSTALL_PREFIX)/bin
+
+
+# toolchain
+PKG_CONFIG ?= pkg-config
+PYTHON ?= python
+
+
+# flags
+LUA_LIBS := $(shell $(PKG_CONFIG) --libs lua 2>/dev/null || echo "-llua")
+LIBS += -lm -lpthread $(LUA_LIBS) -ldl
+LUA_CFLAGS := $(shell $(PKG_CONFIG) --cflags lua 2>/dev/null || echo "-I/usr/include/lua")
+CFLAGS += $(LUA_CFLAGS)
+
+
+# objects
+TARGETS = txt2c internal_base bam
+BAM_OBJ = $(patsubst %.c,%.o,$(wildcard src/*.c))
+TXT2C_LUA = $(wildcard src/*.lua)
+
+
+# make rules
+all: $(TARGETS)
+
+txt2c: src/tools/txt2c
+
+internal_base: src/internal_base.h
+
+src/internal_base.h:
+ src/tools/txt2c $(TXT2C_LUA) > src/internal_base.h
+
+bam: txt2c internal_base $(BAM_OBJ)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(BAM_OBJ) $(LIBS)
+
+test: $(TARGETS)
+ $(PYTHON) scripts/test.py
+
+install: bam
+ install -d "$(DESTDIR)$(INSTALL_BINDIR)"
+ install -m755 bam "$(DESTDIR)$(INSTALL_BINDIR)"/bam
+
+clean:
+ rm -f $(BAM_OBJ) $(TARGETS) src/internal_base.h src/tools/txt2c
+
+
+.PHONY: all test install clean
+
--
2.8.1

View File

@@ -0,0 +1,23 @@
From 4b186524ba0b9956147e040a006c9805aec20678 Mon Sep 17 00:00:00 2001
From: Magnus Auvinen <magnus.auvinen@gmail.com>
Date: Mon, 2 May 2011 19:18:53 +0200
Subject: [PATCH] fixed so that test.py exits with errors codes (thanks to
debfx)
---
scripts/test.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/test.py b/scripts/test.py
index 078e633..90b9b26 100755
--- a/scripts/test.py
+++ b/scripts/test.py
@@ -246,6 +246,8 @@ def __init__(self):
print "FAILED TESTS:"
for t in failed_tests:
print "\t"+t
+ sys.exit(1)
else:
print "ALL TESTS PASSED!"
+ sys.exit(0)