diff options
Diffstat (limited to 'auto/make')
-rw-r--r-- | auto/make | 54 |
1 files changed, 43 insertions, 11 deletions
@@ -7,7 +7,6 @@ $echo "creating $NXT_MAKEFILE" - cat << END > $NXT_MAKEFILE # Pretty print compiler etc actions... @@ -22,6 +21,8 @@ AR = $AR EXTRA_CFLAGS = CFLAGS = $NXT_CFLAGS $NXT_CC_OPT $CFLAGS \$(EXTRA_CFLAGS) +RUST_FLAGS = +NXT_OTEL_LIB_LOC = NXT_EXEC_LINK = $NXT_EXEC_LINK $NXT_LD_OPT NXT_SHARED_LOCAL_LINK = $NXT_SHARED_LOCAL_LINK $NXT_LD_OPT @@ -62,6 +63,9 @@ D := 0 ifeq (\$D,1) CFLAGS += -O0 + RUST_FLAGS += --debug +else + RUST_FLAGS += --release endif # Optionally disable -Werror with @@ -76,6 +80,18 @@ END fi +# potentially set otel lib location +if [ $NXT_OTEL = YES ]; then +cat << END >> $NXT_MAKEFILE + +ifeq (\$D,1) + NXT_OTEL_LIB_LOC = $NXT_OTEL_LIB_DIR/target/debug/libotel.a +else + NXT_OTEL_LIB_LOC = $NXT_OTEL_LIB_DIR/target/release/libotel.a +endif + +END +fi # The include paths list. @@ -138,14 +154,14 @@ cat << END >> $NXT_MAKEFILE libnxt: $NXT_BUILD_DIR/lib/$NXT_LIB_SHARED $NXT_BUILD_DIR/lib/$NXT_LIB_STATIC -$NXT_BUILD_DIR/lib/$NXT_LIB_SHARED: \$(NXT_LIB_OBJS) +$NXT_BUILD_DIR/lib/$NXT_LIB_SHARED: \$(NXT_LIB_OBJS) \$(NXT_OTEL_LIB_LOC) \$(PP_LD) \$@ \$(v)\$(NXT_SHARED_LOCAL_LINK) -o \$@ \$(NXT_LIB_OBJS) \\ - $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS + $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS \$(NXT_OTEL_LIB_LOC) -$NXT_BUILD_DIR/lib/$NXT_LIB_STATIC: \$(NXT_LIB_OBJS) +$NXT_BUILD_DIR/lib/$NXT_LIB_STATIC: \$(NXT_LIB_OBJS) \$(NXT_OTEL_LIB_LOC) \$(PP_AR) \$@ - \$(v)$NXT_STATIC_LINK \$@ \$(NXT_LIB_OBJS) + \$(v)$NXT_STATIC_LINK \$@ \$(NXT_LIB_OBJS) \$(NXT_OTEL_LIB_LOC) $NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC: \$(NXT_LIB_UNIT_OBJS) \\ $NXT_BUILD_DIR/share/pkgconfig/unit.pc \\ @@ -359,11 +375,11 @@ $echo >> $NXT_MAKEFILE cat << END >> $NXT_MAKEFILE $NXT_BUILD_DIR/sbin/$NXT_DAEMON: $NXT_BUILD_DIR/lib/$NXT_LIB_STATIC \\ - \$(NXT_OBJS) + \$(NXT_OBJS) \$(NXT_OTEL_LIB_LOC) \$(PP_LD) \$@ \$(v)\$(NXT_EXEC_LINK) -o \$@ \$(CFLAGS) \\ \$(NXT_OBJS) $NXT_BUILD_DIR/lib/$NXT_LIB_STATIC \\ - $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS + $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS \$(NXT_OTEL_LIB_LOC) END @@ -535,10 +551,6 @@ cat << END > Makefile include $NXT_MAKEFILE -.PHONY: clean -clean: - rm -rf $NXT_BUILD_DIR *.dSYM Makefile - .PHONY: help help: @echo "Variables to control make/build behaviour:" @@ -551,4 +563,24 @@ help: @echo @echo " Variables can be combined." +.PHONY: clean +clean: + rm -rf $NXT_BUILD_DIR *.dSYM Makefile +END + +if [ $NXT_OTEL = YES ]; then + cat << END >> Makefile + cd "$NXT_OTEL_LIB_DIR" && cargo clean END + +NXT_OTEL_DEPS=" \ + build/src/nxt_otel.o \ + src/otel/src/lib.rs \ +" + + cat << END >> $NXT_MAKEFILE + +\$(NXT_OTEL_LIB_LOC): $NXT_OTEL_DEPS + cargo build \$(RUST_FLAGS) --manifest-path $NXT_OTEL_LIB_DIR/Cargo.toml +END +fi |