summaryrefslogtreecommitdiff
path: root/Makefile
blob: 401808acdd065e9f82a3f8d027d1b758d712fd19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
LIBCRYPT_C := lib/crypto/crypto_aesctr.c \
			   lib/crypto/crypto_scrypt-nosse.c \
			   lib/crypto/crypto_scrypt-ref.c \
			   lib/crypto/sha256.c

INSTALL := /usr/bin/install
SCRYPT_LIBS := -lscrypt

override CFLAGS := $(CFLAGS) -O2 -Wall -fPIC

all: lua-5.1-try lua-5.2-try

include findlua.mk

clean:
	$(RM) scrypt-5.1.so scrypt-5.2.so scrypt.so
	$(RM) luascrypt.o
	$(RM) -r html

%.o: %.c
	 $(CC) $(CFLAGS) -fPIC $(LUA51_INC) -c $< -o $@

lua-5.1: scrypt-5.1.so
	 ln -s -f scrypt-5.1.so scrypt.so

lua-5.1-install: lua-5.1
	 $(INSTALL) -d $(DESTDIR)$(LUA51_CMOD_INST)
	 $(INSTALL) -m 755 scrypt-5.1.so $(DESTDIR)$(LUA51_CMOD_INST)/scrypt.so

scrypt-5.1.so: luascrypt.c base64.c
	 $(CC) $(CFLAGS) $(LUA51_INC) -shared -o $@ $^ $(LUA51_LIB) $(SCRYPT_LIBS)

lua-5.2: scrypt-5.2.so
	 ln -s -f scrypt-5.2.so scrypt.so

lua-5.2-install: lua-5.2
	 $(INSTALL) -d $(DESTDIR)$(LUA52_CMOD_INST)
	 $(INSTALL) -m 755 scrypt-5.2.so $(DESTDIR)$(LUA52_CMOD_INST)/scrypt.so

scrypt-5.2.so: luascrypt.c base64.c
	 $(CC) $(CFLAGS) $(LUA52_INC) -shared -o $@ $^ $(LUA52_LIB) $(SCRYPT_LIBS)


doc:
	@ldoc .