summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Makefile2
-rw-r--r--preload/Makefile31
-rwxr-xr-xpreload/gen-interface.pl2
-rw-r--r--preload/libsb2.c2
5 files changed, 20 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore
index bfe1a6b..a16c7e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,4 +17,6 @@ autom4te.cache
aclocal.*
*.a
config.mak
-
+preload/exported.h
+preload/ldexportlist
+preload/wrappers.c
diff --git a/Makefile b/Makefile
index 9c2193f..1168242 100644
--- a/Makefile
+++ b/Makefile
@@ -130,7 +130,7 @@ install-multilib: install-noarch
/sbin/ldconfig -n $(prefix)/lib32/libsb2 $(prefix)/lib64/libsb2
-CLEAN_FILES = $(targets) config.status config.log
+CLEAN_FILES += $(targets) config.status config.log
# make all object files depend on include/config.h
diff --git a/preload/Makefile b/preload/Makefile
index 8043021..409aedd 100644
--- a/preload/Makefile
+++ b/preload/Makefile
@@ -3,27 +3,24 @@ objs := wrappers.o libsb2.o sb_exec.o
PROTOTYPEWARNINGS=-Wmissing-prototypes -Wstrict-prototypes
$(D)/libsb2.so: $(call O,$(objs))
-
$(D)/libsb2.so: mapping/libmapping.a mapping/liblua.a
-
-$(D)/libsb2.so: CFLAGS := $(CFLAGS) -fPIC -Wall -W $(PROTOTYPEWARNINGS)
-$(D)/libsb2.so: LDFLAGS := $(LDFLAGS) -Wl,-soname=$(LIBSB2_SONAME) -Wl,--retain-symbols-file=preload/generated/ldexportlist
+$(D)/libsb2.so: CFLAGS := $(CFLAGS) -fPIC -Wall -W \
+ $(PROTOTYPEWARNINGS)
+$(D)/libsb2.so: LDFLAGS := $(LDFLAGS) -Wl,-soname=$(LIBSB2_SONAME) \
+ -Wl,--retain-symbols-file=$(D)/ldexportlist
$(D)/libsb2.so: LIBS := -ldl -lm -lpthread -lrt
targets := $(targets) $(D)/libsb2.so
+preload/wrappers.c: preload/interface.master preload/gen-interface.pl
+ $(P)PERL
+ $(Q)preload/gen-interface.pl \
+ -W preload/wrappers.c \
+ -E preload/exported.h \
+ -L preload/ldexportlist \
+ <preload/interface.master
-# "exported.h" will be created by the interface generator, too.
-preload/generated/exported.h: preload/wrappers.o
+generated = preload/wrappers.c preload/exported.h preload/ldexportlist
+.PRECIOUS: $(generated)
-preload/wrappers.o: preload/interface.master preload/gen-interface.pl
- if [ ! -d preload/generated ]; then mkdir preload/generated; fi
- echo "Expect to see one warning (about SCANDIR_TYPE_ARG3)"
- preload/gen-interface.pl \
- -W preload/generated/wrappers.c \
- -E preload/generated/exported.h \
- -L preload/generated/ldexportlist \
- <preload/interface.master
- $(CC) -I. -Ipreload -Iinclude -o preload/wrappers.o -c \
- $(PROTOTYPEWARNINGS) \
- preload/generated/wrappers.c
+CLEAN_FILES += $(generated)
diff --git a/preload/gen-interface.pl b/preload/gen-interface.pl
index c7b4ce7..4691932 100755
--- a/preload/gen-interface.pl
+++ b/preload/gen-interface.pl
@@ -783,7 +783,7 @@ if(defined $wrappers_c_output_file) {
write_output_file($wrappers_c_output_file,
$file_header_comment.
'#include "libsb2.h"'."\n".
- '#include "'.$export_h_output_file.'"'."\n".
+ '#include "exported.h"'."\n".
$wrappers_c_buffer);
}
if(defined $export_h_output_file) {
diff --git a/preload/libsb2.c b/preload/libsb2.c
index d082142..ef515e0 100644
--- a/preload/libsb2.c
+++ b/preload/libsb2.c
@@ -28,7 +28,7 @@
*/
#include "libsb2.h"
-#include "generated/exported.h"
+#include "exported.h"
/* strchrnul(): Find the first occurrence of C in S or the final NUL byte.