diff --git a/Makefile b/Makefile index 20d98ca..d738d07 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ MIX = mix -CFLAGS += -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter +CFLAGS += -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Wl,--no-as-needed ERLANG_PATH = $(shell erl -eval 'io:format("~s", [lists:concat([code:root_dir(), "/erts-", erlang:system_info(version), "/include"])])' -s init stop -noshell) CFLAGS += -I$(ERLANG_PATH) -CFLAGS += -I/usr/local/include -I/usr/include -L/usr/local/lib -L/usr/lib -CFLAGS += -lpostal +CFLAGS += $(shell pkg-config --cflags libpostal) CFLAGS += -std=gnu99 -Wno-unused-function +LDFLAGS=$(shell pkg-config --libs libpostal) + ifeq ($(wildcard deps/libpostal),) LIBPOSTAL_PATH = ../libpostal else