1CFLAGS = -g -O3 -Wall 2 3ERLANG_PATH!= erl -eval 'io:format("~s", [lists:concat([code:root_dir(), "/erts-", erlang:system_info(version), "/include"])])' -s init stop -noshell 4CFLAGS += -I$(ERLANG_PATH) 5CFLAGS += -Ic_src 6 7LIB_NAME = priv/bcrypt_nif.so 8CFLAGS += -fPIC 9 10NIF_SRC=\ 11 c_src/bcrypt_nif.c\ 12 c_src/blowfish.c 13 14all: $(LIB_NAME) 15 16$(LIB_NAME): $(NIF_SRC) 17 mkdir -p priv 18 $(CC) $(CFLAGS) -shared $(LDFLAGS) $(NIF_SRC) -o $@ 19 20clean: 21 rm -f $(LIB_NAME) 22 23.PHONY: all clean 24