forked from riverrun/bcrypt_elixir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (33 loc) · 737 Bytes
/
Makefile
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
CFLAGS ?= -g -O3
CFLAGS += -Wall -Wno-format-truncation
CFLAGS += -I"$(ERTS_INCLUDE_DIR)"
CFLAGS += -Ic_src
PRIV_DIR = $(MIX_APP_PATH)/priv
LIB_NAME = $(PRIV_DIR)/bcrypt_nif.so
ifneq ($(CROSSCOMPILE),)
# crosscompiling
CFLAGS += -fPIC
else
# not crosscompiling
ifneq ($(OS),Windows_NT)
CFLAGS += -fPIC
ifeq ($(shell uname),Darwin)
LDFLAGS += -dynamiclib -undefined dynamic_lookup
endif
endif
endif
NIF_SRC=\
c_src/bcrypt_nif.c\
c_src/blowfish.c
calling_from_make:
mix compile
check:
-whoami
all: check $(PRIV_DIR) $(LIB_NAME)
$(LIB_NAME): $(NIF_SRC)
$(CC) $(CFLAGS) -shared $(LDFLAGS) $^ -o $@
$(PRIV_DIR):
mkdir -p $@
clean:
rm -f $(LIB_NAME)
.PHONY: all clean