aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-10-21 23:01:36 +0200
committerMattias Andrée <maandree@kth.se>2017-10-21 23:01:36 +0200
commit593f2554287b979dd7fd3640eaad273bee08688d (patch)
treec4a3e85cf8a53591866e2c5c808ec7ad8c1597a0 /Makefile
parentFix whitespace (diff)
downloadsbus-593f2554287b979dd7fd3640eaad273bee08688d.tar.gz
sbus-593f2554287b979dd7fd3640eaad273bee08688d.tar.bz2
sbus-593f2554287b979dd7fd3640eaad273bee08688d.tar.xz
Add test and fix bugs
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 65566cb..5c112a2 100644
--- a/Makefile
+++ b/Makefile
@@ -6,10 +6,12 @@ LIB_MINOR = 0
CONFIGFILE = config.mk
include $(CONFIGFILE)
-all: sbusd libsbus.so libsbus.a
+all: sbusd libsbus.so libsbus.a test
sbusd.o: arg.h
libsbus.o: libsbus.h
+test.o: libsbus.h
+test: test.o libsbus.a
libsbus.so: libsbus.o
$(CC) -shared -Wl,-soname,libsbus.so.$(LIB_MAJOR) -o $@ $^ $(LDFLAGS)
@@ -18,6 +20,9 @@ libsbus.a: libsbus.o
$(AR) rc $@ $?
$(AR) -s $@
+check: test sbusd
+ ./test
+
install: sbusd libsbus.a libsbus.so
mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
mkdir -p -- "$(DESTDIR)$(PREFIX)/lib"
@@ -38,6 +43,6 @@ uninstall:
-rm -rf -- "$(DESTDIR)$(PREFIX)/share/licenses/sbus"
clean:
- -rm -f -- sbusd *.o *.so *.a
+ -rm -f -- sbusd test *.o *.so *.a .test.sock .test.pid
-.PHONY: all install uninstall clean
+.PHONY: all check install uninstall clean