Modifed makefiles to create single .o bcrypt file

This commit is contained in:
R. Eric Wheeler 2016-03-11 11:01:58 -08:00
parent b21c770c1f
commit f8a30757b0
4 changed files with 18 additions and 6 deletions

View File

@ -10,10 +10,10 @@ test: bcrypt.c crypt_blowfish
bcrypt.a: bcrypt.o crypt_blowfish
ar r bcrypt.a bcrypt.o crypt_blowfish/*.o
ln -s bcrypt.o libbcrypt.so
ld -r bcrypt.o crypt_blowfish/*.o -o libbcrypt.o
bcrypt.o: bcrypt.c
$(CC) $(CFLAGS) -c bcrypt.c
$(CC) $(CFLAGS) -c -fPIC bcrypt.c
crypt_blowfish:
$(MAKE) -C crypt_blowfish

View File

@ -0,0 +1,12 @@
#include <stdio.h>
#include "bcrypt.h"
int main() {
char salt[22];
char hash[64];
bcrypt_gensalt(64, salt);
bcrypt_hashpw("Hashed", salt, hash);
printf("%s", hash);
}

View File

@ -18,7 +18,7 @@ CC = gcc
AS = $(CC)
LD = $(CC)
RM = rm -f
CFLAGS = -W -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wundef -Wpointer-arith -O2 -fomit-frame-pointer -funroll-loops
CFLAGS = -fPIC -W -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wundef -Wpointer-arith -O2 -fomit-frame-pointer -funroll-loops
ASFLAGS = -c
LDFLAGS = -s
@ -68,7 +68,7 @@ crypt_gensalt.o: crypt_gensalt.h
wrapper.o: crypt.h ow-crypt.h crypt_blowfish.h crypt_gensalt.h
.c.o:
$(CC) -c $(CFLAGS) $*.c
$(CC) -shared -c $(CFLAGS) $*.c
.S.o:
$(AS) $(ASFLAGS) $*.S