diff --git a/configure/CONFIG b/configure/CONFIG index 9d80689c6..64594c272 100644 --- a/configure/CONFIG +++ b/configure/CONFIG @@ -9,17 +9,20 @@ # #################################################### +ifndef CONFIG CONFIG = $(TOP)/configure -INSTALL_LOCATION=$(TOP) -include $(CONFIG)/CONFIG_EPICS_BASE -include $(CONFIG)/CONFIG_BASE_VERSION -#################################################### --include $(TOP)/config/RELEASE --include $(TOP)/config/RELEASE.$(HOST_ARCH) +endif +-include $(CONFIG)/RELEASE +-include $(CONFIG)/RELEASE.$(HOST_ARCH) #################################################### include $(CONFIG)/CONFIG_COMMON +# EPICS-specific build options +# +include $(CONFIG)/CONFIG_BASE +include $(CONFIG)/CONFIG_BASE_VERSION + # Site-specific build options # include $(CONFIG)/CONFIG_SITE diff --git a/configure/CONFIG_BASE b/configure/CONFIG_BASE new file mode 100644 index 000000000..be700e1c4 --- /dev/null +++ b/configure/CONFIG_BASE @@ -0,0 +1,60 @@ +ifndef EPICS_BASE +EPICS_BASE = $(INSTALL_LOCATION) +endif + +EPICS_BASE_HOST_BIN = $(EPICS_BASE)/bin/$(HOST_ARCH) + +# private versions of lex/yacc from EPICS +EYACC = $(EPICS_BASE_HOST_BIN)/antelope$(EXE) +ELEX = $(EPICS_BASE_HOST_BIN)/e_flex$(EXE) -S$(EPICS_BASE_INCLUDE)/flex.skel.static +YACC = $(EYACC) +LEX = $(ELEX) + +# state notation language compiler (installed from base/src/sequencer) +SNC = $(EPICS_BASE_HOST_BIN)/snc$(EXE) + +EPICS_BASE_INCLUDE = $(EPICS_BASE)/include + +EPICS_BASE_INCLUDES += -I$(EPICS_BASE_INCLUDE)/os/$(OS_CLASS) -I$(EPICS_BASE_INCLUDE) + +ifneq ($(EPICS_BASE),$(TOP)) +ifneq ($(EPICS_BASE),$(INSTALL_LOCATION)) +INSTALL_INCLUDES += $(EPICS_BASE_INCLUDES) +endif +endif + +#--------------------------------------------------------------- +# Version number for base shared libraries (and win32 products) +ifeq ($(EPICS_BASE),$(TOP)) +SHRLIB_VERSION = $(EPICS_VERSION).$(EPICS_REVISION) +PROD_VERSION = $(EPICS_VERSION).$(EPICS_REVISION) +endif # EPICS_BASE + + +ifdef T_A +EPICS_BASE_LIB = $(EPICS_BASE)/lib/$(T_A) +EPICS_BASE_BIN = $(EPICS_BASE)/bin/$(T_A) +endif + +Db_DIR = $(EPICS_BASE_LIB) +Com_DIR = $(EPICS_BASE_LIB) +Osi_DIR = $(EPICS_BASE_LIB) + +# adl2dl +ADL2DL = $(EPICS_EXTENSIONS)/bin/$(HOST_ARCH)/adl2dl + +# sch2edif compiler and flags +SCH2EDIF = sch2edif +SCH2EDIF_PATH = +SCH2EDIF_SYSFLAGS = -n -ap -p.+..+$(SCH2EDIF_PATH)+$(EPICS_EXTENSIONS)/templates/capfast/sym+ +SCH2EDIF_FLAGS = + +# e2db and flags +# - again there is an assumption where edb.def is installed. +E2DB = $(EPICS_EXTENSIONS)/bin/$(HOST_ARCH)/e2db +E2DB_SYSFLAGS = -ate -d $(EPICS_EXTENSIONS)/templates/capfast/edb.def +E2DB_FLAGS = + +#dbst +DBST = $(EPICS_EXTENSIONS)/bin/$(HOST_ARCH)/dbst + diff --git a/configure/CONFIG_COMMON b/configure/CONFIG_COMMON index a9c47f65f..be3888c88 100644 --- a/configure/CONFIG_COMMON +++ b/configure/CONFIG_COMMON @@ -22,6 +22,8 @@ BUILD_ARCHS = $(HOST_ARCH) $(CROSS1) $(CROSS2) #################################################################### #################################################################### + +INSTALL_LOCATION = $(TOP) INSTALL_LOCATION_LIB = $(INSTALL_LOCATION)/lib INSTALL_LOCATION_BIN = $(INSTALL_LOCATION)/bin @@ -32,6 +34,7 @@ INSTALL_HTML = $(INSTALL_LOCATION)/html INSTALL_MAN = $(INSTALL_LOCATION)/man INSTALL_TEMPLATES = $(INSTALL_LOCATION)/templates INSTALL_DBD = $(INSTALL_LOCATION)/dbd +INSTALL_CONFIG = $(INSTALL_LOCATION)/configure INSTALL_JAVA = $(INSTALL_LOCATION)/javalib DIVIDER = . diff --git a/configure/CONFIG_SITE b/configure/CONFIG_SITE index 43e851df1..189349a46 100644 --- a/configure/CONFIG_SITE +++ b/configure/CONFIG_SITE @@ -52,30 +52,6 @@ CROSS_COMPILER_TARGET_ARCHS= mv167 #CROSS_COMPILER_HOST_ARCHS=sun4 #CROSS_COMPILER_HOST_ARCHS=solaris -# Vx release Tornado? -# must be either YES or NO -TORNADO=YES -#TORNADO=NO - -# VxWorks directory for TORNADO=YES -#VX_DIR_YES=c:\\Tornado -VX_DIR_YES = /usr/local/vw/tornado101 - -# VxWorks directory for TORNADO=NO -#VX_DIR_NO=$(VW) -#VX_DIR_NO=/usr/local/vw/vxV51.mm -#VX_DIR_NO=/usr/local/vw/vxV52/vw -#VX_DIR_NO=c:/Tornado/target -VX_DIR_NO=/usr/local/vw/vxV52p1/vw - -# Directory for TORNADO=NO gnu gcc crosscompiler -VX_GNU_NO = $(VX_DIR_NO)/../vxgccV2.2.3.1 - -# Directory for TORNADO=NO gnu g++ crosscompiler -# used by applications for hideos builds only -#TORNADO_GNU_DIR = $(LOCAL_GNU) -TORNADO_GNU_DIR = /usr/local/hideos/gnu_install-2.7.2 - # Client ANSI C Compiler (for Host builds) # GCC (gcc -ansi) GNU # ACC (acc) OS VENDOR diff --git a/configure/Makefile b/configure/Makefile index f06390c80..bc6385889 100644 --- a/configure/Makefile +++ b/configure/Makefile @@ -6,6 +6,28 @@ TOP=.. include $(TOP)/configure/CONFIG -DIRS += tools +CONFIGS += CONFIG +CONFIGS += CONFIG_BASE +CONFIGS += CONFIG_BASE_VERSION +CONFIGS += CONFIG_COMMON +CONFIGS += CONFIG_ENV + +CONFIGS += CONFIG.CrossCommon +CONFIGS += $(subst ../,,$(wildcard ../CONFIG.Host.*)) +CONFIGS += $(subst ../,,$(wildcard ../CONFIG.Target.*)) + +CONFIGS += $(subst ../,,$(wildcard ../CONFIG_SITE*)) + +CONFIGS += RELEASE +CONFIGS += RULES_ARCHS +CONFIGS += RULES_BUILD +CONFIGS += RULES_DIRS +CONFIGS += RULES_TOP + +CONFIGS += $(subst ../,,$(wildcard ../tools/*.pl)) +CONFIGS += $(subst ../,,../tools/getrel) +CONFIGS += $(subst ../,,../tools/installEpics) +CONFIGS += $(subst ../,,../tools/testmkdir) + +include $(TOP)/configure/RULES_BUILD -include $(TOP)/configure/RULES_DIRS diff --git a/configure/RELEASE b/configure/RELEASE index 34a4c82c0..144743b5e 100644 --- a/configure/RELEASE +++ b/configure/RELEASE @@ -1 +1,7 @@ #RELEASE Location of external products +# +# NOTE: RELEASE.$(HOST_ARCH) files will override + +# Tornado directory +VX_DIR = /usr/local/vw/tornado101 + diff --git a/configure/RULES_ARCHS b/configure/RULES_ARCHS index b145bb859..e52bd2f9c 100644 --- a/configure/RULES_ARCHS +++ b/configure/RULES_ARCHS @@ -43,7 +43,7 @@ crossDirs = $(addprefix O.,$(crossArchs)) $(crossActionArchTargets) : $(crossDirs) $(MAKE) -C O.$(archPart) -f ../Makefile TOP=../$(TOP) T_A=$(archPart) $(actionPart) $(crossArchs) : % : O.% - $(MAKE) -C O.$@ -f ../Makefile TOP=../$(TOP) T_A=$@ BUILD_TYPE=Vx + $(MAKE) -C O.$@ -f ../Makefile TOP=../$(TOP) T_A=$@ else $(crossActionArchTargets) : $(crossArchs) : diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 59a0882f1..682f43ba4 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -121,23 +121,50 @@ INC += $(INC_DEFAULT) endif endif -# concat specific library contents (if defined) to LIBCONTENS +# concat specific library contents (if defined) # ifneq ($(strip $(LIBSRCS_$(ARCH_CLASS))),) LIBSRCS += $(subst -nil-,,$(LIBSRCS_$(ARCH_CLASS))) else - ifdef LIBSRCS_DEFAULT LIBSRCS+=$(LIBSRCS_DEFAULT) endif +endif +LIBSRCS += $($(addsuffix _SRCS,$(LIBRARY))) + +ifneq ($($(addsuffix _SRCS_$(ARCH_CLASS),$(LIBRARY))),) +LIBSRCS += $(subst -nil-,,$($(addsuffix _SRCS_$(ARCH_CLASS),$(LIBRARY)))) +else +ifdef $(LIBRARY))_SRCS_DEFAULT +LIBSRCS+=$($(addsuffix _SRCS_DEFAULT,$(LIBRARY))) +endif endif # adjust object names for library contents # ifdef LIBSRCS -LIBOBJS+=$(addsuffix $(OBJ), $(basename $(LIBSRCS))) +LIB_OBJS+=$(addsuffix $(OBJ), $(basename $(LIBSRCS))) endif + +IOC_LIBSRCS += $($(addsuffix _SRCS,$(IOC_LIBRARY))) + +ifneq ($($(addsuffix _SRCS_$(ARCH_CLASS),$(IOC_LIBRARY))),) +IOC_LIBSRCS += $(subst -nil-,,$($(addsuffix _SRCS_$(ARCH_CLASS),$(IOC_LIBRARY)))) +else +ifdef $(IOC_LIBRARY))_SRCS_DEFAULT +IOC_LIBSRCS+=$($(addsuffix _SRCS_DEFAULT,$(IOC_LIBRARY))) +endif +endif + +# adjust object names for library contents +# +ifdef IOC_LIBSRCS +IOC_LIB_OBJS+=$(addsuffix $(OBJ), $(basename $(IOC_LIBSRCS))) +endif + +# compatibility +IOC_LIB_OBJS+=$(LIBOBJS) # # concat specific library contents (if defined) to PROD_LIBS @@ -230,15 +257,6 @@ ifdef PROD PROD := $(addsuffix $(EXE), $(PROD)) endif -#--------------------------------------------------------------- -# if we are not building base add base includes and ld dirs -# (convenience for extensions and applications) -ifneq ($(EPICS_BASE),$(TOP)) -ifneq ($(EPICS_BASE),$(INSTALL_LOCATION)) -EPICS_INCLUDES += -I$(EPICS_BASE_INCLUDE) -I$(EPICS_BASE_INCLUDE)/os/$(OS_CLASS) -endif -endif - #--------------------------------------------------------------- # ---------------------------------------------------- # create names (lists) for installed things @@ -273,8 +291,9 @@ else INSTALL_TEMPLATES_SUBDIR = $(INSTALL_TEMPLATES) endif INSTALL_TEMPLATE = $(addprefix $(INSTALL_TEMPLATES_SUBDIR)/, \ - $(subst $(CONFIG),top/config,$(TEMPLATES))) -#INSTALL_TEMPLATE = $($(subst $(CONFIG),top/config,$(TEMPLATES)):%= $(INSTALL_TEMPLATES_SUBDIR)/%) + $(subst $(CONFIG),top/configure,$(TEMPLATES))) +#INSTALL_TEMPLATE = $($(subst $(CONFIG),top/configure,$(TEMPLATES)):%= $(INSTALL_TEMPLATES_SUBDIR)/%) +INSTALL_CONFIGS = $(CONFIGS:%= $(INSTALL_CONFIG)/%) INSTALL_BPTS = $(BPTS:%= $(INSTALL_DBD)/%) INSTALL_DBS = $(DBDINSTALL:%= $(INSTALL_DBD)/%)\ @@ -288,6 +307,24 @@ INSTALL_IOC_LIBNAME= $(IOC_LIBNAME:%=$(INSTALL_BIN)/%) INSTALL_IOC_SCRIPTS= $(IOC_SCRIPTS_$(OS_CLASS):%=$(INSTALL_BIN)/%) MAN_DIRECTORY_TARGETS = $(foreach n, $(MANLIST),$(INSTALL_MAN)/man$(n)) +#--------------------------------------------------------------- +ifneq ($(strip $(BIN_INSTALLS_$(OS_CLASS))),) +BIN_INSTALLS+=$(subst -nil-,,$(BIN_INSTALLS_$(OS_CLASS))) +else +ifdef BIN_INSTALLS_DEFAULT +BIN_INSTALLS+=$(BIN_INSTALLS_DEFAULT) +endif +endif + +#--------------------------------------------------------------- +ifneq ($(strip $(IOC_BIN_INSTALLS_$(OS_CLASS))),) +IOC_BIN_INSTALLS+=$(subst -nil-,,$(IOC_BIN_INSTALLS_$(OS_CLASS))) +else +ifdef IOC_BIN_INSTALLS_DEFAULT +IOC_BIN_INSTALLS+=$(IOC_BIN_INSTALLS_DEFAULT) +endif +endif + #--------------------------------------------------------------- ifneq ($(strip $(IOC_PROD_$(OS_CLASS))),) IOC_PROD+=$(subst -nil-,,$(IOC_PROD_$(OS_CLASS))) @@ -297,6 +334,15 @@ IOC_PROD+=$(IOC_PROD_DEFAULT) endif endif +#--------------------------------------------------------------- +ifneq ($(strip $(LIBRARY_$(OS_CLASS))),) +LIBRARY+=$(subst -nil-,,$(LIBRARY_$(OS_CLASS))) +else +ifdef LIBRARY_DEFAULT +LIBRARY+=$(LIBRARY_DEFAULT) +endif +endif + #--------------------------------------------------------------- ifneq ($(strip $(IOC_LIBRARY_$(OS_CLASS))),) IOC_LIBRARY+=$(subst -nil-,,$(IOC_LIBRARY_$(OS_CLASS))) @@ -321,14 +367,7 @@ endif ifneq ($(strip $(CPLUSPLUS)),) LINK.c = $(LINK.cc) endif # CPLUSPLUS -#endif # LIBTYPE - -#--------------------------------------------------------------- -# Version number for base shared libraries (and win32 products) -ifeq ($(EPICS_BASE),$(TOP)) -SHRLIB_VERSION = $(EPICS_VERSION).$(EPICS_REVISION) -PROD_VERSION = $(EPICS_VERSION).$(EPICS_REVISION) -endif # EPICS_BASE +#endif # SHARED_LIBRARIES #--------------------------------------------------------------- # Libraries @@ -340,13 +379,16 @@ ifdef IOC_LIBRARY IOC_LIBTARGETS += $(IOC_LIBNAME) $(INSTALL_IOC_LIBNAME) CFLAGS += $($(ANSI)_SHRLIB_CFLAGS_YES) CXXFLAGS += $($(ANSI)_SHRLIB_CFLAGS_YES) + +ifneq ($(strip $(CPLUSPLUS)),) SHRLIB_LINKER = $(CXX) -IOC_LIB_SRCS=$(IOC_LIBRARY_SRCS) $($(basename $(IOC_LIBRARY))_SRCS) -IOC_LIBRARY_OBJS+=$(addsuffix $(OBJ), $(basename $(IOC_LIB_SRCS))) +else +SHRLIB_LINKER = $(CC) +endif endif ifdef LIBRARY -ifdef LIBOBJS +ifdef LIB_OBJS LIBTARGETS += $(LIBNAME) $(INSTALL_LIBS) CFLAGS += $($(ANSI)_SHRLIB_CFLAGS_YES) CXXFLAGS += $($(ANSI)_SHRLIB_CFLAGS_YES) @@ -364,7 +406,7 @@ LIBTARGETS += $(SHRLIBNAME) $(INSTALL_SHRLIBS) $(INSTALL_DLL_LINK_LIBS) endif # SHARED_LIBRARIES=YES -endif # LIBOBJS +endif # LIB_OBJS endif # LIBRARY #--------------------------------------------------------------- @@ -413,16 +455,22 @@ buildInstall :: $(INSTALL_MANS) \ $(INSTALL_DOCS) \ $(INSTALL_HTMLS) \ $(INSTALL_TEMPLATE) \ + $(INSTALL_CONFIGS) \ $(INSTALL_DBS) $(INSTALL_BPTS) \ $(INSTALL_DBDNAME) $(INSTALL_INCREC) +ifdef IOC_BIN_INSTALLS +buildInstall :: iocBinInstalls +endif + + ifdef BIN_INSTALLS buildInstall :: binInstalls endif clean:: @echo "Cleaning" - @$(RM) *.i *$(OBJ) *.a $(PROD) $(TESTPROD) $(LIBNAME) $(SHRLIBNAME) \ + @$(RM) *.i *$(OBJ) *.a $(PROD) $(TESTPROD) $(LIBNAME) $(IOC_LIBNAME) $(SHRLIBNAME) \ $(INC) *$(RES) $(TARGETS) \ $(DBDINSTALL) $(MENUS) $(RECTYPES) $(BPTS) $(DBDNAME) *.out @@ -526,7 +574,7 @@ endif JAR_DEPFILES += $(wildcard $(JAR_INPUT) $(addsuffix /*,$(JAR_INPUT))) $(DIRECTORY_TARGETS) : - $(MKDIR) $@ +# $(MKDIR) -p $@ build:: $(TESTCLASSES) $(JAR) @@ -720,9 +768,9 @@ ifneq (,$(wildcard ../baseLIBOBJS)) $(IOC_LIBNAME): ../baseLIBOBJS endif -$(IOC_LIBNAME): $(IOC_LIBRARY_OBJS) +$(IOC_LIBNAME): $(IOC_LIB_OBJS) $(RM) $@ - $(ARCMD) $(IOC_LIBRARY_OBJS) + $(ARCMD) $(IOC_LIB_OBJS) ifneq ($(RANLIB)xx,xx) $(RANLIB) $@; endif # RANLIB @@ -731,15 +779,20 @@ $(DLL_LINK_LIBNAME) $(SHRLIBNAME): $(LIBOBJS) $(LINK.shrlib) $(LIBOBJS) $(DLL_LDLIBS) # rule for lib (archive of object files) creation -$(LIBNAME): $(LIBOBJS) +$(LIBNAME): $(LIB_OBJS) $(RM) $@ - $(ARCMD) $(LIBOBJS) + $(ARCMD) $(LIB_OBJS) ifneq ($(RANLIB)xx,xx) $(RANLIB) $@; endif # RANLIB binInstalls: $(BIN_INSTALLS) - $(INSTALL) -d -m 555 $^ $(INSTALL_BIN) + @echo "Installing $(^F)" + @$(INSTALL) -d -m 555 $^ $(INSTALL_BIN) + +iocBinInstalls: $(IOC_BIN_INSTALLS) + @echo "Installing $(^F)" + @$(INSTALL) -d -m 555 $^ $(INSTALL_BIN) $(INSTALL_BIN)/%: ../os/$(ARCH_CLASS)/% @echo "Installing os-specific script $@" @@ -779,7 +832,15 @@ $(INSTALL_TCLLIB)/%: % $(INSTALL_TCLLIB)/%: ../% @echo "Installing Tcl library $@" @$(INSTALL) -d -m 555 $< $(INSTALL_TCLLIB) - + +$(INSTALL_CONFIG)/%: % + @echo "Installing config file $@" + @$(INSTALL) -d -m 644 $< $(@D) + +$(INSTALL_CONFIG)/%: ../% + @echo "Installing config file $@" + @$(INSTALL) -d -m 644 $< $(@D) + $(addsuffix /%,$(MAN_DIRECTORY_TARGETS)) : % @echo "Installing man file $@" @$(INSTALL) -d -m 644 $< $(@D) @@ -824,7 +885,8 @@ $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: % -include DEPENDS -.PHONY:: all inc depends build install clean rebuild buildInstall binInstalls +.PHONY:: all inc depends build install clean rebuild buildInstall binInstalls \ + iocBinInstalls $(DBDNAME): ../base.dbd $(RECTYPES:%.h=../%.dbd) diff --git a/configure/RULES_TOP b/configure/RULES_TOP index 0a2cad2d3..b83474363 100644 --- a/configure/RULES_TOP +++ b/configure/RULES_TOP @@ -5,22 +5,22 @@ include $(CONFIG)/RULES_DIRS uninstall$(DIVIDER)%:: - $(RMDIR) $(INSTALL_LOCATION_BIN)/$* $(INSTALL_LOCATION_LIB)/$* + @$(RMDIR) $(INSTALL_LOCATION_BIN)/$* $(INSTALL_LOCATION_LIB)/$* cleandirs: ifeq ($(wildcard $(INSTALL_LOCATION_BIN)/*),) - $(RMDIR) $(INSTALL_LOCATION_BIN) + @$(RMDIR) $(INSTALL_LOCATION_BIN) endif ifeq ($(wildcard $(INSTALL_LOCATION_LIB)/*),) - $(RMDIR) $(INSTALL_LOCATION_LIB) + @$(RMDIR) $(INSTALL_LOCATION_LIB) endif uninstall:: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS)) - $(RMDIR) rec.bak rec - $(RMDIR) $(INSTALL_DBD) $(INSTALL_MAN) $(INSTALL_INCLUDE) $(INSTALL_DOC)\ + @$(RMDIR) rec.bak rec + @$(RMDIR) $(INSTALL_DBD) $(INSTALL_MAN) $(INSTALL_INCLUDE) $(INSTALL_DOC)\ $(INSTALL_HTML) $(INSTALL_JAVA) $(INSTALL_TEMPLATES) - $(MAKE) -f Makefile cleandirs + @$(MAKE) -f Makefile cleandirs tar: @DIRNAME=$(notdir $(shell pwd)); \