aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-05 20:03:46 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-05 20:03:46 (GMT)
commit631afd993fa60f5d19a8c50360203d1a3dc8e9af (patch)
treeb0dcf03081c907de6fb3b0d6bbd4a28fb2886949
parent841b52b403d404625542ef460c4c5078e7ee3046 (diff)
downloadhostap-631afd993fa60f5d19a8c50360203d1a3dc8e9af.zip
hostap-631afd993fa60f5d19a8c50360203d1a3dc8e9af.tar.gz
hostap-631afd993fa60f5d19a8c50360203d1a3dc8e9af.tar.bz2
Add rules for building src/crypto as a library
For now, this is hardcoded to support only the internal crypto implementation.
-rw-r--r--src/crypto/.gitignore1
-rw-r--r--src/crypto/Makefile49
-rw-r--r--src/lib.rules21
-rw-r--r--src/utils/Makefile9
-rw-r--r--tests/Makefile10
5 files changed, 74 insertions, 16 deletions
diff --git a/src/crypto/.gitignore b/src/crypto/.gitignore
new file mode 100644
index 0000000..ee60604
--- /dev/null
+++ b/src/crypto/.gitignore
@@ -0,0 +1 @@
+libcrypto.a
diff --git a/src/crypto/Makefile b/src/crypto/Makefile
index cffba62..d5c7761 100644
--- a/src/crypto/Makefile
+++ b/src/crypto/Makefile
@@ -1,9 +1,52 @@
-all:
- @echo Nothing to be made.
+all: libcrypto.a
clean:
for d in $(SUBDIRS); do make -C $$d clean; done
- rm -f *~ *.o *.d
+ rm -f *~ *.o *.d libcrypto.a
install:
@echo Nothing to be made.
+
+
+include ../lib.rules
+
+CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
+CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
+#CFLAGS += -DALL_DH_GROUPS
+
+LIB_OBJS= \
+ aes-cbc.o \
+ aes-ctr.o \
+ aes-eax.o \
+ aes-encblock.o \
+ aes-internal.o \
+ aes-internal-dec.o \
+ aes-internal-enc.o \
+ aes-omac1.o \
+ aes-wrap.o \
+ des-internal.o \
+ dh_group5.o \
+ dh_groups.o \
+ md4-internal.o \
+ md5.o \
+ md5-internal.o \
+ md5-non-fips.o \
+ milenage.o \
+ ms_funcs.o \
+ rc4.o \
+ sha1.o \
+ sha1-internal.o \
+ sha1-pbkdf2.o \
+ sha1-tprf.o \
+ sha256.o \
+ sha256-internal.o
+
+LIB_OBJS += crypto_internal.o
+LIB_OBJS += tls_internal.o
+LIB_OBJS += fips_prf_internal.o
+
+
+libcrypto.a: $(LIB_OBJS)
+ $(AR) cr $@ $(LIB_OBJS)
+
+-include $(OBJS:%.o=%.d)
diff --git a/src/lib.rules b/src/lib.rules
new file mode 100644
index 0000000..b260d25
--- /dev/null
+++ b/src/lib.rules
@@ -0,0 +1,21 @@
+ifndef CC
+CC=gcc
+endif
+
+ifndef CFLAGS
+CFLAGS = -MMD -O2 -Wall -g
+endif
+
+CFLAGS += -I.. -I../utils
+
+
+Q=@
+E=echo
+ifeq ($(V), 1)
+Q=
+E=true
+endif
+
+%.o: %.c
+ $(Q)$(CC) -c -o $@ $(CFLAGS) $<
+ @$(E) " CC " $<
diff --git a/src/utils/Makefile b/src/utils/Makefile
index 8953467..b4a8973 100644
--- a/src/utils/Makefile
+++ b/src/utils/Makefile
@@ -8,14 +8,7 @@ install:
@echo Nothing to be made.
-ifndef CC
-CC=gcc
-endif
-
-ifndef CFLAGS
-CFLAGS = -MMD -O2 -Wall -g
-endif
-
+include ../lib.rules
LIB_OBJS= \
base64.o \
diff --git a/tests/Makefile b/tests/Makefile
index bd5fbaa..eb5b0ee 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -17,11 +17,15 @@ endif
CFLAGS += -I../src
CFLAGS += -I../src/utils
-LIBS = ../src/utils/libutils.a
+LIBS = ../src/utils/libutils.a \
+ ../src/crypto/libcrypto.a
../src/utils/libutils.a:
$(MAKE) -C ../src/utils
+../src/crypto/libcrypto.a:
+ $(MAKE) -C ../src/crypto
+
BASE64_OBJS=test-base64.o \
$(LIBS)
@@ -30,10 +34,6 @@ test-base64: $(BASE64_OBJS)
MILENAGE_OBJS=test-milenage.o \
- ../src/crypto/aes-internal.o \
- ../src/crypto/aes-internal-enc.o \
- ../src/crypto/aes-encblock.o \
- ../src/crypto/milenage.o \
$(LIBS)
test-milenage: $(MILENAGE_OBJS)