From 11ba48232cd8ca8dd6d42d2e35a4a5a3b535e659 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 19 Oct 2018 14:23:18 -0500 Subject: [PATCH] Add RULES_COMMON This adds new make targets 'PRINT.' and 'show-makefiles' which are useful for debugging build problems. --- configure/RULES_ARCHS | 4 +--- configure/RULES_BUILD | 2 ++ configure/RULES_COMMON | 33 ++++++++++++++++++++++++++++++++ configure/RULES_DIRS | 5 +---- configure/RULES_FILE_TYPE | 4 ---- documentation/RELEASE_NOTES.html | 16 ++++++++++++++++ 6 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 configure/RULES_COMMON diff --git a/configure/RULES_ARCHS b/configure/RULES_ARCHS index dc3fa04fe..4aaa75870 100644 --- a/configure/RULES_ARCHS +++ b/configure/RULES_ARCHS @@ -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 diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 4ba5c9c36..ec2eb8d8f 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -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 diff --git a/configure/RULES_COMMON b/configure/RULES_COMMON new file mode 100644 index 000000000..af706c22a --- /dev/null +++ b/configure/RULES_COMMON @@ -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. 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 diff --git a/configure/RULES_DIRS b/configure/RULES_DIRS index 37cea5e9a..ec156745d 100644 --- a/configure/RULES_DIRS +++ b/configure/RULES_DIRS @@ -92,7 +92,4 @@ $(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \ .PHONY : $(dirActionArchTargets) .PHONY : $(actionArchTargets) - -# User specific rules -# --include $(HOME)/configure/RULES_USER +include $(CONFIG)/RULES_COMMON diff --git a/configure/RULES_FILE_TYPE b/configure/RULES_FILE_TYPE index 28cc74bd4..2bdfb235a 100644 --- a/configure/RULES_FILE_TYPE +++ b/configure/RULES_FILE_TYPE @@ -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 diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 6ec32b43c..9d028f209 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -19,6 +19,22 @@ --> +

GNUmake targets for debugging

+ +

Some additional build rules have been added to help debug configuration +problems with the build system. Run make show-makefiles to get a sorted +list of all the files that the build system includes when building in the +current directory.

+ +

A new pattern rule for PRINT.% 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 +O.arch build directory). For example make PRINT.T_A +will display the build target architecture name from inside a +O.arch directory but the variable will be empty from an +application top or src directory. make PRINT.EPICS_BASE will show the +path to Base from any EPICS application directory though.

+

Propagate PUTF across Asynchronous record processing

The IOC contains a mechanism involving the PUTF and RPRO fields of each