Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F114846
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/Makefile b/Makefile
index 93747bc..e066c95 100644
--- a/Makefile
+++ b/Makefile
@@ -1,60 +1,48 @@
# SPDX-FileCopyrightText: 2017-2019 myhtmlex authors <https://github.com/Overbryd/myhtmlex>
# SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
# SPDX-License-Identifier: LGPL-2.1-only
MIX = mix
CMAKE = cmake
-CNODE_CFLAGS = -g -O2 -std=c99 -pedantic -Wcomment -Wextra -Wno-old-style-declaration -Wall
-
-# ignore unused parameter warnings
-CNODE_CFLAGS += -Wno-unused-parameter
+CFLAGS ?= -g -O2 -pedantic -Wcomment -Wextra -Wno-old-style-declaration -Wall
# set erlang include path
ERLANG_PATH = $(shell erl -eval 'io:format("~s", [lists:concat([code:root_dir(), "/erts-", erlang:system_info(version)])])' -s init stop -noshell)
CNODE_CFLAGS += -I$(ERLANG_PATH)/include
# expecting myhtml as a submodule in c_src/
# that way we can pin a version and package the whole thing in hex
# hex does not allow for non-app related dependencies.
LXB_PATH = c_src/lexbor
-LXB_STATIC = $(LXB_PATH)/liblexbor_static.a
-CNODE_CFLAGS += -I$(LXB_PATH)/source
-# avoid undefined reference errors to phtread_mutex_trylock
-CNODE_CFLAGS += -lpthread
+LXB_AR = $(LXB_PATH)/liblexbor_static.a
+LXB_CFLAGS = -I$(LXB_PATH)/source
+LXB_LDFLAGS = $(LXB_AR)
# C-Node
ERL_INTERFACE = $(wildcard $(ERLANG_PATH)/../lib/erl_interface-*)
-CNODE_CFLAGS += -L$(ERL_INTERFACE)/lib
CNODE_CFLAGS += -I$(ERL_INTERFACE)/include
-
-CNODE_LDFLAGS =
-
-
-CNODE_LDFLAGS += -lei -pthread
-
-CNODE_CFLAGS += $(CPPFLAGS) $(CFLAGS)
-CNODE_LDFLAGS += $(LDFLAGS)
+CNODE_LDFLAGS += -L$(ERL_INTERFACE)/lib -lei -lpthread
.PHONY: all
all: priv/fasthtml_worker
-$(LXB_STATIC): $(LXB_PATH)
+$(LXB_AR): $(LXB_PATH)
# Sadly, build components separately seems to sporadically fail
cd $(LXB_PATH); \
- CFLAGS='$(CPPFLAGS) $(CFLAGS)' \
+ CFLAGS='$(CFLAGS)' \
cmake -DLEXBOR_BUILD_SEPARATELY=OFF -DLEXBOR_BUILD_SHARED=OFF
$(MAKE) -C $(LXB_PATH)
-priv/fasthtml_worker: c_src/fasthtml_worker.c $(LXB_STATIC)
+priv/fasthtml_worker: c_src/fasthtml_worker.c $(LXB_AR)
mkdir -p priv
- $(CC) -o $@ $< $(LXB_STATIC) $(CNODE_CFLAGS) $(CNODE_LDFLAGS)
+ $(CC) -std=c99 $(CFLAGS) $(CNODE_CFLAGS) $(LXB_CFLAGS) -o $@ $< $(LDFLAGS) $(CNODE_LDFLAGS) $(LXB_LDFLAGS)
clean: clean-myhtml
$(RM) -r priv/myhtmlex*
$(RM) priv/fasthtml_worker
$(RM) myhtmlex-*.tar
$(RM) -r package-test
clean-myhtml:
$(MAKE) -C $(MYHTML_PATH) clean
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Nov 26, 5:07 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40439
Default Alt Text
(2 KB)
Attached To
Mode
R16 fast_html
Attached
Detach File
Event Timeline
Log In to Comment