Add RULES_COMMON

This adds new make targets 'PRINT.<var-name>' and 'show-makefiles'
which are useful for debugging build problems.
This commit is contained in:
Andrew Johnson
2018-10-19 14:23:18 -05:00
parent 531ab6fc36
commit 11ba48232c
6 changed files with 53 additions and 11 deletions

View File

@ -90,6 +90,4 @@ realclean:
.PHONY : $(BUILD_ARCHS) rebuild archsCommonClean
.PHONY : $(ACTIONS) clean realclean archclean host all
# User specific rules
#
-include $(HOME)/configure/RULES_USER
include $(CONFIG)/RULES_COMMON

View File

@ -530,5 +530,7 @@ $(INSTALL_TEMPLATES_SUBDIR)/%: %
.PHONY: runtests tapfiles clean-tests test-results junitfiles
.PHONY: checkRelease warnRelease noCheckRelease FORCE
include $(CONFIG)/RULES_COMMON
endif # BASE_RULES_BUILD
# EOF RULES_BUILD

33
configure/RULES_COMMON Normal file
View File

@ -0,0 +1,33 @@
#*************************************************************************
# Copyright (c) 2018 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in the file LICENSE that is included with this distribution.
#*************************************************************************
# These rules show the set of Makefiles, config files and
# rules files loaded by GNUmake.
SHOW_MAKEFILES = $(MAKEFILE_LIST:%=show-makefile.%)
show-makefiles: $(SHOW_MAKEFILES)
# The sort prevents warnings about duplicate targets:
$(sort $(SHOW_MAKEFILES)): show-makefile.%:
@echo " $(@:show-makefile.%=%)"
.PHONY: show-makefiles show-makefile.%
# These rules support printing a Makefile variable values.
# Many variables are only set inside an O.<arch> build directory.
# make PRINT.T_A
PRINT_Var = $(@:PRINT.%=%)
PRINT.%:
@echo "$(PRINT_Var) = '$($(PRINT_Var))'"
.PHONY: PRINT PRINT.%
# User specific rules
#
-include $(HOME)/configure/RULES_USER

View File

@ -92,7 +92,4 @@ $(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \
.PHONY : $(dirActionArchTargets)
.PHONY : $(actionArchTargets)
# User specific rules
#
-include $(HOME)/configure/RULES_USER
include $(CONFIG)/RULES_COMMON

View File

@ -67,7 +67,3 @@ file_type_clean:
@$(RM) $(foreach type, $(FILE_TYPE), $($(type)))
.PHONY : file_type_clean
# User specific rules
#
-include $(HOME)/configure/RULES_USER

View File

@ -19,6 +19,22 @@
-->
<h3>GNUmake targets for debugging</h3>
<p>Some additional build rules have been added to help debug configuration
problems with the build system. Run <tt>make show-makefiles</tt> to get a sorted
list of all the files that the build system includes when building in the
current directory.</p>
<p>A new pattern rule for <tt>PRINT.%</tt> can be used to show the value of any
GNUmake variable for the current build directory (make sure you are in the right
directory though, many variables are only set when inside the
<tt>O.<i>arch</i></tt> build directory). For example <tt>make PRINT.T_A</tt>
will display the build target architecture name from inside a
<tt>O.<i>arch</i></tt> directory but the variable will be empty from an
application top or src directory. <tt>make PRINT.EPICS_BASE</tt> will show the
path to Base from any EPICS application directory though.</p>
<h3>Propagate PUTF across Asynchronous record processing</h3>
<p>The IOC contains a mechanism involving the PUTF and RPRO fields of each