From f7cc0e2d096dec2b818fe9a5e111c956fcd68053 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 12 Nov 2014 16:36:39 -0600 Subject: [PATCH] Various build system issues * Removed broken Windows source browser rules and 'browse' targets * Fixed parallel build issue for Make > 3.81 * Other tidying-up in RULES_ARCHS * Fix the RTEMS override of the ECHO variable --- configure/CONFIG_COMMON | 7 +--- configure/RULES.Db | 1 - configure/RULES_ARCHS | 53 ++++++++++--------------- configure/RULES_BUILD | 29 +------------- configure/os/CONFIG.Common.RTEMS | 2 + configure/os/CONFIG.win32-x86.win32-x86 | 4 -- src/ioc/db/Makefile | 2 +- 7 files changed, 27 insertions(+), 71 deletions(-) diff --git a/configure/CONFIG_COMMON b/configure/CONFIG_COMMON index 584175784..3d4df3bd2 100644 --- a/configure/CONFIG_COMMON +++ b/configure/CONFIG_COMMON @@ -177,7 +177,7 @@ LIBRARY_OBJS = $(addsuffix $(OBJ),$(basename $(SRCS) $(USR_SRCS) $(LIB_SRCS) $(L LIBRARY_LD_OBJS = $(USR_OBJLIBS) $(LIB_OBJLIBS) $(TARGET_OBJS) $(LIBRARY_OBJS) #-------------------------------------------------- -# WIN95/NT resource files +# Windows resource files TARGET_RESS = $(if $(RES),$(addsuffix $(RES),$(basename $($*_RCS))),) @@ -187,11 +187,6 @@ PROD_LD_RESS = $(TARGET_RESS) $(PROD_RESS) LIBRARY_RESS = $(if $(RES),$(addsuffix $(RES),$(basename $(RCS) $(LIB_RCS) $(LIBRARY_RCS))),) LIBRARY_LD_RESS = $(TARGET_RESS) $(LIBRARY_RESS) -#-------------------------------------------------- -# WIN95/NT source browser -PROD_BAF = $(addsuffix $(BAF), $(basename $(PROD))) -LIB_BAF=$(addsuffix $(BAF),$(basename $(LIBRARY))) - #-------------------------------------------------- # C preprocessor, compiler, and linker flag defaults diff --git a/configure/RULES.Db b/configure/RULES.Db index 2496dbdd3..ecb3e7181 100644 --- a/configure/RULES.Db +++ b/configure/RULES.Db @@ -151,7 +151,6 @@ ACTIONS = inc ACTIONS += build ACTIONS += install ACTIONS += buildInstall -ACTIONS += browse ACTIONS += runtests tapfiles actionArchTargets = $(foreach x, $(ACTIONS),\ $(foreach arch,$(BUILD_ARCHS), $(x)$(DIVIDER)$(arch))) diff --git a/configure/RULES_ARCHS b/configure/RULES_ARCHS index fda381262..eb5b3b593 100644 --- a/configure/RULES_ARCHS +++ b/configure/RULES_ARCHS @@ -17,48 +17,39 @@ ACTIONS = inc ACTIONS += build ACTIONS += install ACTIONS += buildInstall -ACTIONS += browse ACTIONS += runtests tapfiles -#ACTIONS += rebuild actionPart = $(word 1, $(subst $(DIVIDER), ,$@)) archPart = $(word 2, $(subst $(DIVIDER), ,$@)) -actionArchTargets = $(foreach x, $(ACTIONS),\ - $(foreach arch,$(BUILD_ARCHS), $(x)$(DIVIDER)$(arch))) +actionArchTargets = $(foreach action, $(ACTIONS), \ + $(addprefix $(action)$(DIVIDER), $(BUILD_ARCHS))) -cleanArchTargets = $(foreach arch,$(BUILD_ARCHS), clean$(DIVIDER)$(arch)) +cleanArchTargets = $(addprefix clean$(DIVIDER), $(BUILD_ARCHS)) -buildDirs = $(addprefix O.,$(BUILD_ARCHS)) +buildDirs = $(addprefix O., $(BUILD_ARCHS)) #************************************************************************* -# Create epics_host_arch dependancies for GNU make -j option -# Only works with GNU make 3.81 or later (uses eval function) -# Needed in dirs where EPICS_HOST_ARCH build creates a tool used in +# Create EPICS_HOST_ARCH dependancies for GNU make -j option +# Needed in dirs where EPICS_HOST_ARCH builds a tool used by # cross arch builds CROSS_ARCHS += $(CROSS1) $(CROSS2) define DEP_template -$(2): $$(EPICS_HOST_ARCH) -$(1)$$(DIVIDER)$(2): $(1)$$(DIVIDER)$$(EPICS_HOST_ARCH) O.$(2) + $(2) : $(EPICS_HOST_ARCH) + $(1)$(DIVIDER)$(2) : $(1)$(DIVIDER)$(EPICS_HOST_ARCH) O.$(2) endef -ifeq ($(MAKE_VERSION),3.81) - $(foreach action, $(ACTIONS), $(foreach arch,\ - $(CROSS_ARCHS),$(eval $(call DEP_template,$(action),$(arch))))) -else -ifeq ($(findstring j,$(MAKEFLAGS)),j) - $(foreach action, $(ACTIONS), $(foreach arch,\ - $(CROSS_ARCHS),$(eval $(call DEP_template,$(action),$(arch))))) -endif -endif +$(foreach action, $(ACTIONS), $(foreach arch, $(CROSS_ARCHS), \ + $(eval $(call DEP_template,$(action),$(arch))))) + #************************************************************************* # Allows rebuild to work with parallel builds option, -j. ifeq (rebuild,$(filter rebuild,$(MAKECMDGOALS))) -$(buildDirs) O.Common : clean -rebuild: install + $(buildDirs) O.Common : clean + rebuild : install endif $(actionArchTargets) : $(buildDirs) O.Common @@ -67,7 +58,7 @@ $(actionArchTargets) : $(buildDirs) O.Common $(BUILD_ARCHS) : % : O.% O.Common $(MAKE) -C O.$@ -f ../Makefile TOP=$(TOP)/.. T_A=$@ -$(ACTIONS):%: $(foreach arch, $(BUILD_ARCHS), %$(DIVIDER)$(arch)) +$(ACTIONS) : % : $(foreach arch, $(BUILD_ARCHS), %$(DIVIDER)$(arch)) $(buildDirs): $(PERL) $(TOOLS)/makeMakefile.pl $@ $(TOP)/.. @@ -78,21 +69,21 @@ O.Common: # # special clean rule # -clean : archs_common_clean +clean: archsCommonClean -archs_common_clean : - $(RMDIR) $(addprefix O.,$(BUILD_ARCHS)) O.Common +archsCommonClean: + $(RMDIR) $(buildDirs) O.Common -archclean : - $(RMDIR) $(addprefix O.,$(BUILD_ARCHS)) +archclean: + $(RMDIR) $(buildDirs) -$(cleanArchTargets) : +$(cleanArchTargets): $(RMDIR) O.$(archPart) -realclean : +realclean: $(RMDIR) O.* .PHONY : $(actionArchTargets) .PHONY : $(cleanArchTargets) -.PHONY : $(BUILD_ARCHS) rebuild arch_common_clean +.PHONY : $(BUILD_ARCHS) rebuild archsCommonClean .PHONY : $(ACTIONS) clean realclean archclean host all diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 41e4fa06d..dae2439ad 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -166,17 +166,6 @@ build_clean: ifdef RES @$(RM) *$(RES) endif -ifdef BAF - @$(RM) $(PROD_BAF) $(LIB_BAF) -endif -ifdef BOF - @$(RM) *$(BOF) -endif - -# WIN95/NT source browser -#ifdef BAF -browse: $(LIB_BAF) $(PROD_BAF) -#endif $(DIRECTORY_TARGETS) : $(MKDIR) -p $@ @@ -238,17 +227,11 @@ $(TESTPRODNAME) $(PRODNAME): %$(EXE): @$(RM) $@ $(COMPILE.cpp) -c $< -# WIN95/NT resource compiler +# Windows resource compiler %$(RES): %.rc @$(RM) $@ $(RCCMD) -# WIN95/NT source browser -%.bsc: %.sbr - $(ECHO) "building source browser archive $@" - @$(RM) $@ - $(BAFCMD) $< - YACCOPT ?= $($*_YACCOPT) # # rename the y.tab.h file only if we @@ -271,16 +254,6 @@ YACCOPT ?= $($*_YACCOPT) @$(RM) $@ $(MV) $*.yy.c $@ -# WIN95/NT source browser -ifdef BAF - -$(LIB_BAF): $(addsuffix $(BOF),$(basename $(LIBRARY_LD_OBJS))) - $(ECHO) "Building source browser archive $@" - @$(RM) $@ - $(BAFCMD) $^ - -endif - #--------------------------------------------------------------- # Libraries, shared/DLL and stubs diff --git a/configure/os/CONFIG.Common.RTEMS b/configure/os/CONFIG.Common.RTEMS index 10aaba80a..7c6661985 100644 --- a/configure/os/CONFIG.Common.RTEMS +++ b/configure/os/CONFIG.Common.RTEMS @@ -71,6 +71,8 @@ CPPFLAGS += $(CROSS_CPPFLAGS) $(POSIX_CPPFLAGS)\ $(BASE_CPPFLAGS) $(TARGET_CPPFLAGS) $(USR_CPPFLAGS) $(ARCH_DEP_CPPFLAGS)\ $(OP_SYS_CPPFLAGS) $(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS) +ECHO = @$(if $(findstring s,$(patsubst T_A=%,,$(MAKEFLAGS))),$(NOP),echo) + #-------------------------------------------------- # Although RTEMS uses gcc, it wants to use gcc its own way CROSS_CPPFLAGS = diff --git a/configure/os/CONFIG.win32-x86.win32-x86 b/configure/os/CONFIG.win32-x86.win32-x86 index 0ac715d6f..d77f70dd3 100644 --- a/configure/os/CONFIG.win32-x86.win32-x86 +++ b/configure/os/CONFIG.win32-x86.win32-x86 @@ -21,8 +21,6 @@ RCCMD = rc -l 0x409 $(INCLUDES) -fo $@ $< ARCMD = lib -nologo -verbose -out:$@ $(LIB_OPT_LDFLAGS) $(LIBRARY_LD_OBJS) -BAFCMD = bscmake -nologo -o $@ - # # Configure OS vendor C compiler CC = cl @@ -151,8 +149,6 @@ WIN32=1 EXE=.exe OBJ=.obj RES=.res -BAF=.bsc -BOF=.sbr # Problem: MS Visual C++ does not recognize *.cc as C++ source, # so we do C++ compiles using the global flag -TP diff --git a/src/ioc/db/Makefile b/src/ioc/db/Makefile index 1f918484b..2045bfbbe 100644 --- a/src/ioc/db/Makefile +++ b/src/ioc/db/Makefile @@ -54,7 +54,7 @@ menuGlobal_DBD += menuYesNo.dbd menuGlobal_DBD += menuSimm.dbd DBDINC += $(basename $(menuGlobal_DBD)) -DBDINC += menuScan.dbd +DBDINC += menuScan DBDINC += dbCommon dbMenusPod = $(notdir $(wildcard ../db/menu*.dbd.pod))