Skip to content
Snippets Groups Projects
Commit c9bcf8b4 authored by Simon Rose's avatar Simon Rose
Browse files

Draft .db file expander

parent b530967c
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ help:
## Install current module to $(EPICS_BASE)/require/$(E3_REQUIRE_VERSION)/siteMods
install: install_module install_links
install_module: build db
install_module: build db_internal
$(QUIET) $(E3_MODULE_MAKE_CMDS) install
## Uninstall the current module
......@@ -50,6 +50,9 @@ prebuild: conf
debug: conf
$(QUIET) $(E3_MODULE_MAKE_CMDS) debug
db_internal: conf
$(QUIET) $(E3_MODULE_MAKE_CMDS) db_internal
## Clean, build, and install the current module
rebuild: clean build install
......
db: $(SUBS)
$(SUBS):
@printf "Inflating database ... %44s >>> %40s \n" "$@" "$(basename $(@)).db"
@rm -f $(basename $(@)).db.d $(basename $(@)).db
@$(MSI) -D $(USR_DBFLAGS) -o $(basename $(@)).db -S $@ > $(basename $(@)).db.d
@$(MSI) $(USR_DBFLAGS) -o $(basename $(@)).db -S $@
.PHONY: db $(SUBS)
......@@ -196,6 +196,10 @@ export ${PRJ}_E3_GIT_DESC
${PRJ}_E3_GIT_STATUS := $(${PROJECT}_E3_GIT_STATUS)
export ${PRJ}_E3_GIT_STATUS
export SUBS
export TMPS
export USR_DBFLAGS
# Some shell commands:
RMDIR = rm -rf
LN = ln -s
......@@ -261,7 +265,7 @@ debug::
# Loop over all EPICS versions for second run.
MAKEVERSION = ${MAKE} -f ${USERMAKEFILE} LIBVERSION=${LIBVERSION}
build install debug:: ${IGNOREFILES}
build install debug db_internal:: ${IGNOREFILES}
@+for VERSION in ${BUILD_EPICS_VERSIONS}; do ${MAKEVERSION} EPICSVERSION=$$VERSION $@; done
#build: ${IGNOREFILES}
......@@ -360,6 +364,9 @@ CXXCMPLR=ANSI
G++_ANSI = $(G++) -ansi
OBJ=.o
O.%:
+$(MKDIR) $@
ifndef T_A
## RUN 2
# Target achitecture not yet defined
......@@ -448,13 +455,29 @@ debug::
@echo "LIBVERSION = ${LIBVERSION}"
# Loop over all architectures.
install build debug::
install build debug:: $(COMMON_DIR)
@+failed_builds=0; \
for ARCH in ${CROSS_COMPILER_TARGET_ARCHS}; do \
umask 002; echo MAKING ARCH $$ARCH; ${MAKE} -f ${USERMAKEFILE} T_A=$$ARCH $@ || ((failed_builds++)); \
done; \
((failed_builds == 0))
db_internal: $(COMMON_DIR)
define SUBS_EXPAND
vpath $(notdir $1) $(dir $1)
$(COMMON_DIR)/$(notdir $(basename $1).db): $(notdir $1)
@printf "Inflating database ... %44s >>> %40s \n" "$$^" "$$@"
$(MSI) -D $(USR_DBFLAGS) -o $(COMMON_DIR)/$$(notdir $$(basename $1).db) $2 $$^ > $(COMMON_DIR)/$$(notdir $$(basename $1).db).d
$(MSI) $(USR_DBFLAGS) -o $(COMMON_DIR)/$$(notdir $$(basename $1).db) $2 $$^
db_internal: $(COMMON_DIR)/$(notdir $(basename $1).db)
endef
$(foreach file,$(SUBS),$(eval $(call SUBS_EXPAND,$(file),-S)))
$(foreach file,$(TMPS),$(eval $(call SUBS_EXPAND,$(file),)))
else # T_A
ifeq ($(filter O.%,$(notdir ${CURDIR})),)
......@@ -480,9 +503,6 @@ install build:
else
O.%:
+$(MKDIR) $@
ifeq ($(shell echo "${LIBVERSION}" | grep -v -E "^$(VERSIONREGEX)\$$"),)
install:: build
@test ! -d ${MODULE_LOCATION}/lib/${T_A} || \
......@@ -494,7 +514,7 @@ install:: build
$(RMDIR) ${MODULE_LOCATION}/lib/${T_A})
endif
install build debug:: O.${EPICSVERSION}_Common O.${EPICSVERSION}_${T_A}
install build debug:: O.${EPICSVERSION}_${T_A}
@${MAKE} -C O.${EPICSVERSION}_${T_A} -f ../${USERMAKEFILE} $@
endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment