Add bhaible's missing Makefile
authorAnthony Green <green@moxielogic.com>
Tue, 13 Mar 2018 12:37:21 +0000 (08:37 -0400)
committerAnthony Green <green@moxielogic.com>
Tue, 13 Mar 2018 12:37:21 +0000 (08:37 -0400)
.gitignore
testsuite/libffi.bhaible/Makefile [new file with mode: 0644]

index 1deba89..9c6f28f 100644 (file)
@@ -5,6 +5,7 @@
 .dirstamp
 *.la
 Makefile
+!testsuite/libffi.bhaible/Makefile
 Makefile.in
 aclocal.m4
 compile
diff --git a/testsuite/libffi.bhaible/Makefile b/testsuite/libffi.bhaible/Makefile
new file mode 100644 (file)
index 0000000..3322de9
--- /dev/null
@@ -0,0 +1,28 @@
+CC = gcc
+CFLAGS = -O2 -Wall
+prefix =
+includedir = $(prefix)/include
+libdir = $(prefix)/lib
+CPPFLAGS = -I$(includedir)
+LDFLAGS = -L$(libdir) -Wl,-rpath,$(libdir)
+
+all: check-call check-callback
+
+test-call: test-call.c testcases.c
+       $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test-call test-call.c -lffi
+
+test-callback: test-callback.c testcases.c
+       $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test-callback test-callback.c -lffi
+
+check-call: test-call
+       ./test-call > test-call.out
+       LC_ALL=C uniq -u < test-call.out > failed-call
+       test '!' -s failed-call
+
+check-callback: test-callback
+       ./test-callback > test-callback.out
+       LC_ALL=C uniq -u < test-callback.out > failed-callback
+       test '!' -s failed-callback
+
+clean:
+       rm -f test-call test-callback test-call.out test-callback.out failed-call failed-callback