forked from WHC/Hermit
Fix -j race on libsashidown.a; cst-agent-update keeps the install prefix
This commit is contained in:
@@ -103,7 +103,7 @@ TESTS = \
|
|||||||
|
|
||||||
TEST_LIBS = -lm $(CURL_LIBS) $(PTHREAD_LIBS)
|
TEST_LIBS = -lm $(CURL_LIBS) $(PTHREAD_LIBS)
|
||||||
|
|
||||||
.PHONY: all clean check demo sashidown-lib cmake-gcc cmake-clang asan install uninstall
|
.PHONY: all clean check demo sashidown-lib FORCE cmake-gcc cmake-clang asan install uninstall
|
||||||
|
|
||||||
all: sashidown-lib cst-agent
|
all: sashidown-lib cst-agent
|
||||||
|
|
||||||
@@ -116,9 +116,15 @@ cmake-clang:
|
|||||||
cmake -B build-clang -DCMAKE_C_COMPILER=clang -DCST_BUILD_TUI=ON
|
cmake -B build-clang -DCMAKE_C_COMPILER=clang -DCST_BUILD_TUI=ON
|
||||||
cmake --build build-clang
|
cmake --build build-clang
|
||||||
|
|
||||||
sashidown-lib:
|
sashidown-lib: $(SD_DIR)/libsashidown.a
|
||||||
|
|
||||||
|
# The sub-make decides whether the archive is stale; FORCE only makes sure it
|
||||||
|
# is asked, and -j builds wait for it before linking.
|
||||||
|
$(SD_DIR)/libsashidown.a: FORCE
|
||||||
$(MAKE) -C $(SD_DIR) libsashidown.a
|
$(MAKE) -C $(SD_DIR) libsashidown.a
|
||||||
|
|
||||||
|
FORCE:
|
||||||
|
|
||||||
cst-agent: $(OBJ) $(SD_DIR)/libsashidown.a
|
cst-agent: $(OBJ) $(SD_DIR)/libsashidown.a
|
||||||
$(CC) $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(LDLIBS)
|
$(CC) $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(LDLIBS)
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ main() {
|
|||||||
run_make install PREFIX="$prefix" >/dev/null
|
run_make install PREFIX="$prefix" >/dev/null
|
||||||
cat >"$prefix/bin/cst-agent-update" <<EOF
|
cat >"$prefix/bin/cst-agent-update" <<EOF
|
||||||
#!$(command -v bash)
|
#!$(command -v bash)
|
||||||
|
export CST_AGENT_PREFIX="\${CST_AGENT_PREFIX:-$prefix}"
|
||||||
exec bash "$dir/scripts/bootstrap_linux.sh" "$dir" "\$@"
|
exec bash "$dir/scripts/bootstrap_linux.sh" "$dir" "\$@"
|
||||||
EOF
|
EOF
|
||||||
chmod 0755 "$prefix/bin/cst-agent-update"
|
chmod 0755 "$prefix/bin/cst-agent-update"
|
||||||
|
|||||||
Reference in New Issue
Block a user