upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/Makefile b/src/Makefile
index c0b6e1d..9846d8e 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -71,5 +71,35 @@ bitflash: $(IMGUI_OBJS) $(NODE_OBJS) $(GUI_OBJS)
71 $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS) 71 $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
72 @echo "Built: bitflash" 72 @echo "Built: bitflash"
73 73
74# ---- headless node ---------------------------------------------------------
75#
76# Same node, built without ImGui, GLFW or OpenGL. Linking the GUI made the
77# binary require libGL at load time even when started with -nogui, because the
78# dynamic loader resolves everything before main() runs -- so on a clean server,
79# which is where a node most naturally lives, it failed to start with an error
80# about shared libraries and no hint that it would otherwise work.
81#
82# Objects go to obj-node/ because main_gui.cpp is compiled twice, with and
83# without -DBITFLASH_NO_GUI, and the two must not overwrite each other.
84
85NODE_LIBS = -L$(SECP_LIB) -lsecp256k1 \
86 -L$(RANDOMX_DIR)/build -lrandomx \
87 -lsodium -lssl -lcrypto -ldb_cxx -lpthread
88
89NODE_ONLY_OBJS = $(patsubst obj/%,obj-node/%,$(NODE_OBJS)) \
90 obj-node/main_gui.o obj-node/headless.o
91
92obj-node/%.o: %.cpp $(HEADERS)
93 @mkdir -p obj-node
94 $(CXX) -c $(CXXFLAGS) -DBITFLASH_NO_GUI -o $@ $<
95
96obj-node/sha.o: sha.cpp sha.h
97 @mkdir -p obj-node
98 $(CXX) -c $(CXXFLAGS) -DBITFLASH_NO_GUI -O3 -o $@ $<
99
100bitflash-node: $(NODE_ONLY_OBJS)
101 $(CXX) $(CXXFLAGS) -o $@ $^ $(NODE_LIBS)
102 @echo "Built: bitflash-node (headless, no libGL needed)"
103
74clean: 104clean:
75 rm -rf obj bitflash 105 rm -rf obj obj-node bitflash bitflash-node