-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (23 loc) · 775 Bytes
/
Makefile
File metadata and controls
29 lines (23 loc) · 775 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
PRIV_DIR = $(MIX_APP_PATH)/priv
STB_IMAGE_NIF_SO = $(PRIV_DIR)/stb_image_nif.so
C_SRC = $(shell pwd)/c_src
LIB_SRC = $(shell pwd)/lib
THIRD_PARTY = $(shell pwd)/3rd_party
STB_INCLUDE_DIR = $(THIRD_PARTY)/stb
CPPFLAGS += -shared -std=c11 -O3 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fPIC
CPPFLAGS += -I$(ERTS_INCLUDE_DIR) -I$(STB_INCLUDE_DIR)
UNAME_S := $(shell uname -s)
ifndef TARGET_ABI
ifeq ($(UNAME_S),Darwin)
TARGET_ABI = darwin
endif
endif
ifeq ($(TARGET_ABI),darwin)
CPPFLAGS += -undefined dynamic_lookup -flat_namespace -Wno-unused-function
endif
.DEFAULT_GLOBAL := build
build: $(STB_IMAGE_NIF_SO)
@ echo > /dev/null
$(STB_IMAGE_NIF_SO):
@ mkdir -p $(PRIV_DIR)
$(CC) $(CPPFLAGS) $(C_SRC)/stb_image_nif.c -o $(STB_IMAGE_NIF_SO)