From 60e1158295f152cbe0d7d983dfd98d94b73314c1 Mon Sep 17 00:00:00 2001 From: Jan Chadima Date: Mon, 2 Aug 2010 10:56:34 +0200 Subject: Initial userspace library version --- userspace/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'userspace/Makefile') diff --git a/userspace/Makefile b/userspace/Makefile index fddefb3..7db92d5 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -1,12 +1,19 @@ CC = gcc -CFLAGS = -Wall -g -O2 +CFLAGS = -Wall -g -O2 -fPIC progs := ncr-setkey -all: $(progs) +libobj = ncrypto_fd.o ncrypto_generate_params.o ncrypto_key.o ncrypto_masterkey.o ncrypto_params.o ncrypto_session.o + +all: $(progs) libcryptodev.so ncr-setkey: setkey.c $(CC) $(CFLAGS) $< -o $@ +libcryptodev.so: ${libobj} + gcc -shared -o libcryptodev.so.0.0 -Wl,-soname,libcryptodev.so.0 ${libobj} + ln -sf libcryptodev.so.0.0 libcryptodev.so.0 + ln -sf libcryptodev.so.0.0 libcryptodev.so + clean: rm -f *.o *~ ncr-setkey -- cgit From 04fd86aa0fd905aa25025f9d4785a0fd49cd2633 Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Thu, 5 Aug 2010 16:38:25 +0200 Subject: Delete libcryptodev.so* on (make clean) --- userspace/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'userspace/Makefile') diff --git a/userspace/Makefile b/userspace/Makefile index 7db92d5..b87bf0c 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -16,4 +16,4 @@ libcryptodev.so: ${libobj} ln -sf libcryptodev.so.0.0 libcryptodev.so clean: - rm -f *.o *~ ncr-setkey + rm -f *.o *~ libcryptodev.so* ncr-setkey -- cgit From 6e6fafa6663724240e202ee95908b476e7443075 Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Sat, 7 Aug 2010 07:14:40 +0200 Subject: Abstract from users Let users #include this header file alone, without caring about . To do so, set up a temporary copy of ncr.h so that the #include works at build time as well. --- userspace/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'userspace/Makefile') diff --git a/userspace/Makefile b/userspace/Makefile index b87bf0c..9156205 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -1,5 +1,5 @@ CC = gcc -CFLAGS = -Wall -g -O2 -fPIC +CFLAGS = -I. -Wall -g -O2 -fPIC progs := ncr-setkey @@ -15,5 +15,11 @@ libcryptodev.so: ${libobj} ln -sf libcryptodev.so.0.0 libcryptodev.so.0 ln -sf libcryptodev.so.0.0 libcryptodev.so +$(libobj): linux/ncr.h + +linux/ncr.h: ../ncr.h + mkdir -p linux + cp $< linux/ncr.h + clean: - rm -f *.o *~ libcryptodev.so* ncr-setkey + rm -rf *.o *~ libcryptodev.so* ncr-setkey linux -- cgit From e3bd8be964e355f83c1e6871f4c2b033103c3d0e Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Sat, 7 Aug 2010 08:22:16 +0200 Subject: Allow overriding CFLAGS --- userspace/Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'userspace/Makefile') diff --git a/userspace/Makefile b/userspace/Makefile index 9156205..9431327 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -1,5 +1,6 @@ CC = gcc -CFLAGS = -I. -Wall -g -O2 -fPIC +AM_CFLAGS = -I. -fPIC +CFLAGS = -Wall -g -O2 progs := ncr-setkey @@ -8,10 +9,11 @@ libobj = ncrypto_fd.o ncrypto_generate_params.o ncrypto_key.o ncrypto_masterkey. all: $(progs) libcryptodev.so ncr-setkey: setkey.c - $(CC) $(CFLAGS) $< -o $@ + $(CC) $(AM_CFLAGS) $(CFLAGS) $< -o $@ libcryptodev.so: ${libobj} - gcc -shared -o libcryptodev.so.0.0 -Wl,-soname,libcryptodev.so.0 ${libobj} + $(CC) $(AM_CFLAGS) $(CFLAGS) -shared -o libcryptodev.so.0.0 \ + -Wl,-soname,libcryptodev.so.0 ${libobj} ln -sf libcryptodev.so.0.0 libcryptodev.so.0 ln -sf libcryptodev.so.0.0 libcryptodev.so @@ -23,3 +25,6 @@ linux/ncr.h: ../ncr.h clean: rm -rf *.o *~ libcryptodev.so* ncr-setkey linux + +.c.o: + $(CC) $(AM_CFLAGS) $(CFLAGS) -c -o $@ $< \ No newline at end of file -- cgit From 7687d57b337a16e82d0e70725a83c0e612d16f93 Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Mon, 9 Aug 2010 20:05:22 +0200 Subject: Avoid unnecessary internal relocations Use __attribute__((visibility("hidden"))) for __ncr_file_descriptor to take advantage of PIC addressing instead of going through the dynamic linker. Add an internal alias for ncr_global_init() for the same reason. Add an internal header file to consolidate the "extern" references in the process. --- userspace/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'userspace/Makefile') diff --git a/userspace/Makefile b/userspace/Makefile index 9431327..a2757a4 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -17,7 +17,7 @@ libcryptodev.so: ${libobj} ln -sf libcryptodev.so.0.0 libcryptodev.so.0 ln -sf libcryptodev.so.0.0 libcryptodev.so -$(libobj): linux/ncr.h +$(libobj): linux/ncr.h ncrypto_internal.h linux/ncr.h: ../ncr.h mkdir -p linux -- cgit