-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (31 loc) · 747 Bytes
/
Makefile
File metadata and controls
41 lines (31 loc) · 747 Bytes
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
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
all: _priv_dir _lib_name
_lib_name: $(NIF_SRC)
$(CC) $(CFLAGS) -shared $(LDFLAGS) $^ -o "$(LIB_NAME)"
_priv_dir:
mkdir -p "$(PRIV_DIR)"
clean:
rm -f $(LIB_NAME)
.PHONY: all clean _priv_dir _lib_name