2020-05-13 16:35:22 +00:00
|
|
|
ERL_EI_INCLUDE:=$(shell erl -eval 'io:format("~s", [code:lib_dir(erl_interface, include)])' -s init stop -noshell | head -1)
|
|
|
|
ERL_EI_LIB:=$(shell erl -eval 'io:format("~s", [code:lib_dir(erl_interface, lib)])' -s init stop -noshell | head -1)
|
2020-05-13 22:40:39 +00:00
|
|
|
CFLAGS = -std=c99 -g -Wall -Werror
|
|
|
|
CPPFLAGS = -I$(ERL_EI_INCLUDE)
|
|
|
|
LDFLAGS = -L$(ERL_EI_LIB)
|
|
|
|
LDLIBS = -lpthread -lei -lm -lmagic
|
|
|
|
PRIV = priv/
|
|
|
|
RM = rm -Rf
|
2020-05-03 21:58:04 +00:00
|
|
|
|
2020-06-15 20:23:14 +00:00
|
|
|
all: priv/libmagic_port
|
2020-05-03 21:58:04 +00:00
|
|
|
|
2020-06-15 20:23:14 +00:00
|
|
|
priv/libmagic_port: src/libmagic_port.c
|
2020-05-13 22:40:39 +00:00
|
|
|
mkdir -p priv
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
|
2020-05-03 21:58:04 +00:00
|
|
|
|
|
|
|
clean:
|
2020-06-14 16:39:46 +00:00
|
|
|
$(RM) $(PRIV)
|
2020-05-13 22:40:39 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|