introduce replxx submodule system
This commit is contained in:
parent
5239265a61
commit
ddcd081674
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,6 +9,7 @@ perf.*
|
|||||||
/src/singeli/gen
|
/src/singeli/gen
|
||||||
/Singeli
|
/Singeli
|
||||||
build/singeliLocal
|
build/singeliLocal
|
||||||
|
build/replxxLocal
|
||||||
/local/
|
/local/
|
||||||
CBQNHeapDump
|
CBQNHeapDump
|
||||||
/test/ffi/ffiTest.o
|
/test/ffi/ffiTest.o
|
||||||
|
|||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +1,6 @@
|
|||||||
[submodule "build/singeliSubmodule"]
|
[submodule "build/singeliSubmodule"]
|
||||||
path = build/singeliSubmodule
|
path = build/singeliSubmodule
|
||||||
url = https://github.com/mlochbaum/Singeli
|
url = https://github.com/mlochbaum/Singeli
|
||||||
|
[submodule "build/replxxSubmodule"]
|
||||||
|
path = build/replxxSubmodule
|
||||||
|
url = https://github.com/dzaima/replxx
|
||||||
|
|||||||
1
build/replxxSubmodule
Submodule
1
build/replxxSubmodule
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit d254e695e4a751fefa09eef52b1452b1835d0598
|
||||||
20
makefile
20
makefile
@ -115,6 +115,7 @@ ifeq ($(origin LDFLAGS),command line)
|
|||||||
endif
|
endif
|
||||||
ifeq ($(REPLXX),1)
|
ifeq ($(REPLXX),1)
|
||||||
custom = 1
|
custom = 1
|
||||||
|
REPLXX_DIR = $(shell if [ -d build/replxxLocal ]; then echo build/replxxLocal; else echo build/replxxSubmodule; fi)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
i_LD = $(i_CC)
|
i_LD = $(i_CC)
|
||||||
@ -146,7 +147,7 @@ ifeq ($(custom),)
|
|||||||
else
|
else
|
||||||
@[ -x "$$(command -v sha256sum)" ] && hashInput="sha256sum"; \
|
@[ -x "$$(command -v sha256sum)" ] && hashInput="sha256sum"; \
|
||||||
[ -x "$$(command -v shasum)" ] && hashInput="shasum -a 256"; \
|
[ -x "$$(command -v shasum)" ] && hashInput="shasum -a 256"; \
|
||||||
printf "%s\0%s\0%s\0%s\0%s\0%s" "${i_CC}" "${ALL_CC_FLAGS}" "${ALL_LD_FLAGS}" "${REPLXX}" "${REPLXX_FLAGS}" "${i_CXX}" | $$hashInput | grep -oE '[0-9a-z]{64}' | head -c32
|
printf "%s\0%s\0%s\0%s\0%s\0%s\0%s" "${i_CC}" "${ALL_CC_FLAGS}" "${ALL_LD_FLAGS}" "${REPLXX}" "${REPLXX_FLAGS}" "${i_CXX}" "${REPLXX_DIR}" | $$hashInput | grep -oE '[0-9a-z]{64}' | head -c32
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
@printf "%s" "$(force_build_dir)"
|
@printf "%s" "$(force_build_dir)"
|
||||||
@ -172,12 +173,17 @@ else ifeq ($(origin builddir),command line)
|
|||||||
@export bd=$$(${MAKE} builddir); \
|
@export bd=$$(${MAKE} builddir); \
|
||||||
echo "$$bd"
|
echo "$$bd"
|
||||||
else
|
else
|
||||||
|
|
||||||
ifeq ($(i_singeli), 1)
|
ifeq ($(i_singeli), 1)
|
||||||
@mkdir -p src/singeli/gen
|
@mkdir -p src/singeli/gen
|
||||||
@mkdir -p obj/singeli
|
@mkdir -p obj/singeli
|
||||||
@${MAKE} postmsg="post-singeli build:" build_singeli
|
@${MAKE} postmsg="post-singeli build:" build_singeli
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(REPLXX_DIR),build/replxxSubmodule)
|
||||||
|
@git submodule update --init build/replxxSubmodule
|
||||||
|
endif
|
||||||
|
|
||||||
@export bd=$$(${MAKE} builddir); \
|
@export bd=$$(${MAKE} builddir); \
|
||||||
mkdir -p "$$bd"; \
|
mkdir -p "$$bd"; \
|
||||||
${MAKE} run_incremental_1 bd="$$bd"
|
${MAKE} run_incremental_1 bd="$$bd"
|
||||||
@ -236,7 +242,6 @@ ${bd}/load.o: src/gen/customRuntime
|
|||||||
.INTERMEDIATE: preSingeliBin
|
.INTERMEDIATE: preSingeliBin
|
||||||
preSingeliBin:
|
preSingeliBin:
|
||||||
@if [ ! -d build/singeliLocal ]; then \
|
@if [ ! -d build/singeliLocal ]; then \
|
||||||
echo "Using Singeli submodule; alternatively, link local version to build/singeliLocal"; \
|
|
||||||
git submodule update --init build/singeliSubmodule; \
|
git submodule update --init build/singeliSubmodule; \
|
||||||
fi
|
fi
|
||||||
@echo "pre-singeli build:"
|
@echo "pre-singeli build:"
|
||||||
@ -275,16 +280,15 @@ endif
|
|||||||
i_LD = $(i_CXX)
|
i_LD = $(i_CXX)
|
||||||
REPLXX_FLAGS = -Os
|
REPLXX_FLAGS = -Os
|
||||||
|
|
||||||
ALL_CC_FLAGS += -DUSE_REPLXX -Ireplxx/include
|
ALL_CC_FLAGS += -DUSE_REPLXX -I$(REPLXX_DIR)/include
|
||||||
|
|
||||||
CXX_INC = $(i_CXX) $(CCFLAGS) $(REPLXX_FLAGS) -DREPLXX_STATIC=1 -Ireplxx/include -MMD -MP -MF
|
CXX_INC = $(i_CXX) $(CCFLAGS) $(REPLXX_FLAGS) -DREPLXX_STATIC=1 -I$(REPLXX_DIR)/include -MMD -MP -MF
|
||||||
replxx_obj: ${addprefix ${bd}/, ConvertUTF.cpp.o wcwidth.cpp.o conversion.cxx.o escape.cxx.o history.cxx.o prompt.cxx.o replxx.cxx.o replxx_impl.cxx.o terminal.cxx.o util.cxx.o windows.cxx.o}
|
replxx_obj: ${addprefix ${bd}/, ConvertUTF.cpp.o wcwidth.cpp.o conversion.cxx.o escape.cxx.o history.cxx.o prompt.cxx.o replxx.cxx.o replxx_impl.cxx.o terminal.cxx.o util.cxx.o windows.cxx.o}
|
||||||
${bd}/%.o: replxx/src/%
|
${bd}/%.o: $(REPLXX_DIR)/src/%
|
||||||
@echo $<
|
@echo $<
|
||||||
@$(CXX_INC) $@.d -o $@ -c $<
|
@$(CXX_INC) $@.d -o $@ -c $<
|
||||||
|
|
||||||
${bd}/BQN: replxx_obj
|
${bd}/BQN: replxx_obj
|
||||||
endif
|
endif # replxx
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -316,6 +320,8 @@ clean-specific:
|
|||||||
rm -f $(bd)/*.d
|
rm -f $(bd)/*.d
|
||||||
rm -f $(bd)/BQN
|
rm -f $(bd)/BQN
|
||||||
rmdir $(bd); true
|
rmdir $(bd); true
|
||||||
|
clean-submodules:
|
||||||
|
git submodule deinit build/singeliSubmodule/ build/replxxSubmodule/
|
||||||
|
|
||||||
|
|
||||||
clean: clean-build clean-runtime clean-singeli
|
clean: clean-build clean-runtime clean-singeli
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user