Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a2dc8e3

Browse files
committedMar 7, 2025·
Reorganize C++ files
1 parent ece1b80 commit a2dc8e3

File tree

6 files changed

+8
-11
lines changed

6 files changed

+8
-11
lines changed
 

‎Makefile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
PRIV_DIR = $(MIX_APP_PATH)/priv
2-
NIF_PATH = $(PRIV_DIR)/libpythonx.so
1+
PRIV_DIR := $(MIX_APP_PATH)/priv
2+
NIF_PATH := $(PRIV_DIR)/libpythonx.so
3+
C_SRC = $(shell pwd)/c_src
34

4-
C_SRC = $(shell pwd)/c_src/pythonx
5-
CPPFLAGS = -shared -fPIC -fvisibility=hidden -std=c++17 -Wall -Wextra -Wno-unused-parameter -Wno-comment
5+
CPPFLAGS := -shared -fPIC -fvisibility=hidden -std=c++17 -Wall -Wextra -Wno-unused-parameter -Wno-comment
66
CPPFLAGS += -I$(ERTS_INCLUDE_DIR) -I$(FINE_INCLUDE_DIR)
77

88
ifdef DEBUG
@@ -11,11 +11,8 @@ else
1111
CPPFLAGS += -O3
1212
endif
1313

14-
UNAME_S := $(shell uname -s)
1514
ifndef TARGET_ABI
16-
ifeq ($(UNAME_S),Darwin)
17-
TARGET_ABI = darwin
18-
endif
15+
TARGET_ABI := $(shell uname -s | tr '[:upper:]' '[:lower:]')
1916
endif
2017

2118
ifeq ($(TARGET_ABI),darwin)
@@ -25,7 +22,7 @@ endif
2522
SOURCES = $(wildcard $(C_SRC)/*.cpp)
2623
HEADERS = $(wildcard $(C_SRC)/*.hpp)
2724

28-
build: $(NIF_PATH)
25+
all: $(NIF_PATH)
2926
@ echo > /dev/null # Dummy command to avoid the default output "Nothing to be done"
3027

3128
$(NIF_PATH): $(SOURCES) $(HEADERS)

‎Makefile.win

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
PRIV_DIR=$(MIX_APP_PATH)\priv
22
NIF_PATH=$(PRIV_DIR)\libpythonx.dll
3+
C_SRC=$(MAKEDIR)\c_src
34

4-
C_SRC=$(MAKEDIR)\c_src\pythonx
55
CPPFLAGS=/LD /std:c++17 /W4 /wd4100 /wd4458 /O2 /EHsc
66
CPPFLAGS=$(CPPFLAGS) /I"$(ERTS_INCLUDE_DIR)" /I"$(FINE_INCLUDE_DIR)"
77

88
SOURCES=$(C_SRC)\*.cpp
99
HEADERS=$(C_SRC)\*.hpp
1010

11-
build: $(NIF_PATH)
11+
all: $(NIF_PATH)
1212

1313
$(NIF_PATH): $(SOURCES) $(HEADERS)
1414
@ if not exist "$(PRIV_DIR)" mkdir "$(PRIV_DIR)"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)
Please sign in to comment.