diff --git a/config/CONFIG.Host.Borland b/config/CONFIG.Host.Borland new file mode 100644 index 000000000..cc5aa357d --- /dev/null +++ b/config/CONFIG.Host.Borland @@ -0,0 +1,218 @@ +# CONFIG.Host.Borland +# +# This file is maintained by the EPICS community. +# Sites may override these definitions in CONFIG_SITE.Borland + +# Use std path variables from ms +HOME = $(HOMEDRIVE)$(HOMEPATH) + +# +# +ANSI = ACC +CPLUSPLUS = CCC + +# +# +WINLINK = ilink32 + +RCCMD = brcc32 -i . -i .. -i $(INSTALL_INCLUDE) -i $(EPICS_BASE_INCLUDE) -fo $@ $< + +ARCMD = tlib $@ + +# +# Configure OS vendor C compiler +CCLINKOPT = -WM -D_WIN32 +ACC = bcc32 $(CCLINKOPT) + +# +# __STDC__=0 is a real great idea of Jeff that gives us both: +# 1) define STDC for EPICS code (pretend ANSI conformance) +# 2) set it to 0 to use MS C "extensions" (open for _open etc.) +# because MS uses: if __STDC__ ... disable many nice things +# +ACC_ANSI = $(ACC) -D__STDC__=0 +ACC_STRICT = $(ACC) -D__STDC__=0 +ACC_TRAD = $(ACC) /nologo + +# +ACC_WARN_YES = -w -g0 +ACC_WARN_NO = -w- + +# +# -O1 optimization for size +# -k- turn off standard stack frame +# -H- Turn off precompiled headers +# -R- Don't include browser info in .obj files +ACC_OPT_YES = -k- -H- -R- -O1 + +# +ACC_OPT_NO = + + +# +# no special libs for static link +# +ACC_SLIBS_YES= +ACC_SLIBS_NO= + +# Configure OS vendor C++ compiler +# +# __STDC__=0 is a real great idea of Jeff that gives us both: +# 1) define STDC for EPICS code (pretend ANSI conformance) +# 2) set it to 0 to use MS C "extensions" (open for _open etc.) +# because MS uses: if __STDC__ ... disable many nice things +# +CCC = bcc32 $(CCLINKOPT) +CCC_NORMAL = $(CCC) -D__STDC__=0 +CCC_STRICT = $(CCC) -D__STDC__=0 +CCC_TEMPL_INST_FLAG = + +# +CCC_WARN_YES = -w -g0 +CCC_WARN_NO = -w- + +# +# -O1 optimization for size +# -k- turn off standard stack frame +# -H- Turn off precompiled headers +# -R- Don't include browser info in .obj files +CCC_OPT_YES = -k- -H- -R- -O1 + +# +CCC_OPT_NO = + +# +# no special libs for static link +# +CCC_SLIBS_YES= +CCC_SLIBS_NO= + +PROD_VERSION=3.13 +# -w display warnings on +# -C clear state before linking +# -Gn no state files +# -x no map +# -Gi generate import library +# -Tpd this flag specifies the output file type +# -aa this flag specifies the application type +# -c case sensitive linking +LINK_OPT_FLAGS_YES = -w -C -Gn -x -Gi -Tpd -aa -c +LINK_OPT_FLAGS_NO = -w- -C -Gn -x -Gi -Tpd -aa -c +WIN32_DLLFLAGS = $(LINK_OPT_FLAGS_$(HOST_OPT)) +OPT_LDFLAGS = + +ARCH_DEP_CFLAGS= + +# to identify the general architecture class: +# should be BSD, SYSV, WIN32, ... +# is: WIN32, sun4, hpux, linux, ... +# +ARCH_CLASS=WIN32 + +# ifdef WIN32 looks better that ifeq ($(ARCH_CLASS),WIN32) ?? +WIN32=1 + +EXE=.exe +OBJ=.obj +RES=.res + +# Problem: BorlandC does not recognize *.cc as C++ source, +# we have to compile xx.cc using the flag -P xx.cc, +SOURCE_CXXFLAG = -P + +# Operating system flags +OP_SYS_CFLAGS = + +# +# Borland specific include files +# +OP_SYS_INCLUDES = -I$(INCLUDE) +# +OP_SYS_LDLIBS = + +# +# specify dll .def file only if it exists +# +DLL_DEF_FLAG = $(subst /,\\,$(wildcard ../$(LIBRARY).def)) + +# HOST_OPT_FLAGS is part of CFLAGS/CXXFLAGS, +# which in turn are used in COMPILE.c[c] +# +# If we compile a .c, .cc into an $(OBJ), +# we test if this object is part of the +# library objects LIBOBJS. +# If so, we define _WINDLL so that +# e.g. include/shareLib.h works correctly. +# +HOST_OPT_FLAGS += $(subst $@, /_WINDLL, $(findstring $@,$(LIBOBJS))) + +# +# A WIN32 dll has three parts: +# x.dll: the real dll (SHRLIBNAME) +# x.lib: what you link to progs that use the dll (LIBNAME) +# x.exp: what you need to build the dll (in no variable) +# +LINK.shrlib = $(WINLINK) $(WIN32_DLLFLAGS) -L$(LIB) -L$(LIB)\\Psdk c0d32.obj + +# adjust names of libraries to build +# +# But: if there are no objects LIBOBJS to include +# in this library (may be for e.g. base/src/libCompat +# on some archs), don't define (and build) any library! +SHRLIBNAME = $(LIBRARY).dll + +# +# Under WIN32 we have the unique situation where the DLL link creates the +# DLL link library xxx.lib and we need to be very careful to avoid replacing +# the xxx.lib created by the dll link with an xxx.lib created by $(AR). +# Therefore, the object library is named xxxObj.lib +# +# SHARED_LIBRARIES is YES if we are building a DLL and NO if we aren't +# +DLL_LINK_LIBNAME_YES = $(LIBRARY).lib +DLL_LINK_LIBNAME = $(DLL_LINK_LIBNAME_$(SHARED_LIBRARIES)) +LIBNAME = $(LIBRARY)Obj.lib + +# dll install location +INSTALL_SHRLIB = $(INSTALL_BIN) + +#-------------------------------------------------- +# Dependancy definitions +OBJECT_LIB_EXT_YES = Obj.lib # object library extension for static build +OBJECT_LIB_EXT_NO = .lib # object library extension for dynamic build +OBJECT_LIB_EXT = $(OBJECT_LIB_EXT_$(STATIC_BUILD)) +COND_PROD_DEPLIBS = $(foreach prod,$(PROD), $(foreach lib, $($(basename $(prod))_LIBS),\ + $(firstword $($(lib)_DIR) $(EPICS_BASE_LIB))/$(lib)$(OBJECT_LIB_EXT))) +PRODNAME_DEPLIBS = $(foreach lib,$(PRODNAME_LIBS),$(firstword $(wildcard $($(lib)_DIR)/$(lib).lib $($(lib)_DIR)/$(lib)Obj.lib $(EPICS_BASE_LIB)/$(lib).lib $(EPICS_BASE_LIB)/$(lib)Obj.lib ) $(filter $(LIBRARY)$(OBJECT_LIB_EXT), $(lib)$(OBJECT_LIB_EXT)) )) +PROD_DEPLIBS = $(foreach lib,$(PROD_LIBS),$(firstword $(wildcard $($(lib)_DIR)/$(lib).lib $($(lib)_DIR)/$(lib)Obj.lib $(EPICS_BASE_LIB)/$(lib).lib $(EPICS_BASE_LIB)/$(lib)Obj.lib ) $(filter $(LIBRARY)$(OBJECT_LIB_EXT), $(lib)$(OBJECT_LIB_EXT)) )) + +USR_DEPLIBS = $(foreach lib,$(USR_LIBS),$(firstword $(wildcard $($(lib)_DIR)/$(lib).lib $($(lib)_DIR)/$(lib)Obj.lib $(EPICS_BASE_LIB)/$(lib).lib $(EPICS_BASE_LIB)/$(lib)Obj.lib ) $(filter $(LIBRARY)$(OBJECT_LIB_EXT), $(lib)$(OBJECT_LIB_EXT)) )) + +# by default the libraries used when linking the DLL are just +# PROD_LIBS ans SYS_PROD_LIBS minus the DLL name +DLL_LIBS = $(subst $(LIBRARY),, $(PROD_LIBS)) + +# +# EPICS libs that we need to link the DLL with +# (it isnt necessary to rebuild the dll if these change) +DLL_DEPLIBS = $(foreach lib,$(DLL_LIBS),$(firstword $(wildcard $($(lib)_DIR)/$(lib).lib $($(lib)_DIR)/$(lib)Obj.lib $(EPICS_BASE_LIB)/$(lib).lib $(EPICS_BASE_LIB)/$(lib)Obj.lib) $(filter $(LIBRARY)$(OBJECT_LIB_EXT), $(lib)$(OBJECT_LIB_EXT)) )) + +USR_LDLIBS = $(PRODNAME_DEPLIBS) $(PROD_DEPLIBS) $(USR_DEPLIBS) $(SYS_PROD_LIBS:%=%.lib) + +DLL_LDLIBS = $(DLL_DEPLIBS) $(SYS_PROD_LIBS:%=%.lib) $(OP_SYS_LDLIBS) + +#multithreaded +LIBSUF=mt +# -w display warnings on +# -C clear state before linking +# -Gn no state files +# -x no map +# -c case sensitive linking +LDFLAGS += -w -C -Gn -x -c -L$(LIB) -L$(LIB)\\Psdk +LINKSTARTUP = c0x32.obj +LINKLIBS=import32.lib cw32$(LIBSUF).lib + +LINK.c = $(WINLINK) $(LDFLAGS) $(LINKSTARTUP) +LINK.cc = $(WINLINK) $(LDFLAGS) $(LINKSTARTUP) + + diff --git a/config/CONFIG.Host.Linux b/config/CONFIG.Host.Linux index b81e4b22b..e593c42c9 100644 --- a/config/CONFIG.Host.Linux +++ b/config/CONFIG.Host.Linux @@ -31,7 +31,6 @@ ACC_SFLAGS_NO= ACC_SLIBS_YES = ACC_SLIBS_NO= ACC_SHRLIB_CFLAGS_YES = -fPIC -#ACC_SHRLIB_CFLAGS_YES = -fPIC -D_BSD_SOURCE ACC_SHRLIB_LDFLAGS_YES = -shared -Wl,-soname,$@ @@ -49,6 +48,8 @@ CCC_SFLAGS_NO= CCC_SLIBS_YES = CCC_SLIBS_NO= CCC_DEPENDS_FLAG = -MM +CCC_SHRLIB_CFLAGS_YES = -fPIC +CCC_SHRLIB_LDFLAGS_YES = -shared -Wl,-soname,$@ # added smh 6/5/98 : when building fdmgr - seems to use this not ACC # in effect this overides orig def in CONFIG_COMMON : diff --git a/config/CONFIG.Host.UnixCommon b/config/CONFIG.Host.UnixCommon index 221c37804..6290c7606 100644 --- a/config/CONFIG.Host.UnixCommon +++ b/config/CONFIG.Host.UnixCommon @@ -19,7 +19,6 @@ LIBNAME = $(LIBRARY:%=lib%.a) SHRLIB_SUFFIX = .so SHRLIBNAME = lib$(LIBRARY)$(SHRLIB_SUFFIX)$(SHRLIB_VERSION:%=.%) -SHRLIB_LDFLAGS = $($(ANSI)_SHRLIB_LDFLAGS_$(strip $(SHARED_LIBRARIES))) DLL_LDLIBS = $(PRODNAME_LIBS:%=-l%) $(PROD_LIBS:%=-l%) $(USR_LIBS:%=-l%) @@ -47,7 +46,6 @@ OBJ = .o COND_PROD_DEPLIBS = $(foreach prod,$(PROD), $(foreach lib, $($(basename $(prod))_LIBS),$(firstword $(wildcard $($(lib)_DIR)/lib$(lib).* $(EPICS_BASE_LIB)/lib$(lib).*)))) PRODNAME_DEPLIBS = $(foreach lib,$(PRODNAME_LIBS),$(firstword $(wildcard $($(lib)_DIR)/lib$(lib).* $(EPICS_BASE_LIB)/lib$(lib).*))) PROD_DEPLIBS = $(foreach lib,$(PROD_LIBS),$(firstword $(wildcard $($(lib)_DIR)/lib$(lib).* $(EPICS_BASE_LIB)/lib$(lib).*))) - USR_DEPLIBS = $(foreach lib,$(USR_LIBS),$(firstword $(wildcard $($(lib)_DIR)/lib$(lib).* $(EPICS_BASE_LIB)/lib$(lib).*))) #-------------------------------------------------- diff --git a/config/CONFIG.Host.WIN32 b/config/CONFIG.Host.WIN32 index 83efdef7e..d0facff5e 100644 --- a/config/CONFIG.Host.WIN32 +++ b/config/CONFIG.Host.WIN32 @@ -20,12 +20,10 @@ CPLUSPLUS = CCC MSVISC = c:\\Program\ Files\\DevStudio\\Vc WINLINK = link -RCCMD = rc -l 0x409 -fo $@ $< +RCCMD = rc -l 0x409 -i . -i .. -i $(INSTALL_INCLUDE) -i $(EPICS_BASE_INCLUDE) -fo $@ $< ARCMD = lib /nologo /verbose /out:$@ -BAFCMD = bscmake /nologo /o $@ - # # Configure OS vendor C compiler ACC = cl @@ -90,11 +88,10 @@ ACC_SLIBS_NO= # because MS uses: if __STDC__ ... disable many nice things # # Use of /Za would dissable DLL import/export keywords which -# Use of /GX supports C++ extensions # EPICS include/excludes using architecture neutral macros CCC = cl -CCC_NORMAL = $(CCC) /nologo /D__STDC__=0 /GX -CCC_STRICT = $(CCC) /nologo /D__STDC__=0 /GX +CCC_NORMAL = $(CCC) /nologo /D__STDC__=0 +CCC_STRICT = $(CCC) /nologo /D__STDC__=0 CCC_TEMPL_INST_FLAG = # @@ -129,7 +126,7 @@ CCC_SFLAGS_NO= /MD$(VISC_SFLAGS_DEBUG) $(VISC_EPICS_DLL) # CCC_SLIBS_YES= CCC_SLIBS_NO= - + LINK_OPT_FLAGS_YES = /WARN:3 /incremental:no /opt:ref\ /release $(PROD_VERSION:%=/version:%) LINK_OPT_FLAGS_NO = /WARN:3 /debug @@ -149,8 +146,6 @@ WIN32=1 EXE=.exe OBJ=.obj RES=.res -BAF=.bsc -BOF=.sbr # Problem: MS Visual C++ does not recognize *.cc as C++ source, # we have to compile xx.cc using the flag -Tp xx.cc, diff --git a/config/CONFIG.Host.alpha b/config/CONFIG.Host.alpha index 78df9a385..7420959c3 100644 --- a/config/CONFIG.Host.alpha +++ b/config/CONFIG.Host.alpha @@ -39,6 +39,8 @@ CCC_SFLAGS_YES= CCC_SFLAGS_NO= CCC_SLIBS_YES = CCC_SLIBS_NO= +CCC_SHRLIB_CFLAGS_YES = +CCC_SHRLIB_LDFLAGS_YES = -shared CCC_DEPENDS_FLAG = ARCH_DEP_CFLAGS = -D_OSF_SOURCE diff --git a/config/CONFIG.Host.hp700 b/config/CONFIG.Host.hp700 index a54c1d4d4..cbb43a0cf 100644 --- a/config/CONFIG.Host.hp700 +++ b/config/CONFIG.Host.hp700 @@ -44,7 +44,11 @@ HPCC_SLIBS_NO= HPCC_SHRLIB_CFLAGS_YES = +Z HPCC_SHRLIB_LDFLAGS_YES = -b -# New HP C++ compiler +#Old HP C++ compiler +#CCC = CC +#CCC_NORMAL = $(CCC) +p + +#New HP C++ compiler CCC = aCC # avoid treating "future errors" as actual errors CCC_NORMAL = $(CCC) +W302 +W829 +W818 +W392 +W469 +W495 +W749 +W667 +W392 +W684 @@ -62,12 +66,12 @@ CCC_SHRLIB_CFLAGS_YES = +Z # shared libs will be found by searching environment variable SHLIB_PATH, # then by searching the specified path (see below) CCC_SHRLIB_LDFLAGS_YES = -b - -CCC_DEPENDS_FLAG = +CCC_DEPENDS_FLAG = +m # +DAportable causes portable object code to be created for execution # on different PA-Risc machines ARCH_DEP_CFLAGS = -D_HPUX_SOURCE -DHP_UX +DAportable ARCH_DEP_CXXFLAGS = -D_HPUX_SOURCE -DHP_UX +DAportable ARCH_DEP_LDLIBS = -ARCH_DEP_LDFLAGS = -Wl,+s,+b$(DEFAULT_SHRLIB_SEARCH_PATH) +ARCH_DEP_LDFLAGS = -Wl,+b$(DEFAULT_SHRLIB_SEARCH_PATH),+s + diff --git a/config/CONFIG.Host.sgi b/config/CONFIG.Host.sgi index 6d5f582f7..8df92c701 100644 --- a/config/CONFIG.Host.sgi +++ b/config/CONFIG.Host.sgi @@ -40,6 +40,8 @@ CCC_SFLAGS_NO= CCC_SLIBS_YES = CCC_SLIBS_NO= CCC_DEPENDS_FLAG = +CCC_SHRLIB_CFLAGS_YES = -KPIC +CCC_SHRLIB_LDFLAGS_YES = -shared ####KRCC = ?? diff --git a/config/CONFIG.Host.solaris b/config/CONFIG.Host.solaris index edcfebb2c..eb9448e5a 100644 --- a/config/CONFIG.Host.solaris +++ b/config/CONFIG.Host.solaris @@ -53,6 +53,8 @@ CCC_SFLAGS_NO= CCC_SLIBS_YES= -lw -lintl -Bdynamic -ldl -Bstatic -lXext -lX CCC_SLIBS_NO= CCC_DEPENDS_FLAG = -xM1 +CCC_SHRLIB_CFLAGS_YES = +CCC_SHRLIB_LDFLAGS_YES = -G -h $@ ARCH_DEP_CFLAGS = -DSOLARIS diff --git a/config/CONFIG.Host.sun4 b/config/CONFIG.Host.sun4 index 73a701397..71f7d6781 100644 --- a/config/CONFIG.Host.sun4 +++ b/config/CONFIG.Host.sun4 @@ -68,6 +68,8 @@ CCC_SFLAGS_YES= -Bstatic CCC_SFLAGS_NO= CCC_SLIBS_YES= CCC_SLIBS_NO= +CCC_SHRLIB_CFLAGS_YES = -pic +CCC_SHRLIB_LDFLAGS_YES = -assert pure-text -h $@ CCC_DEPENDS_FLAG = -xM1 GCC_ANSI += -D__USE_FIXED_PROTOTYPES__ diff --git a/config/CONFIG.Vx b/config/CONFIG.Vx index 383b2174c..6eb907eab 100644 --- a/config/CONFIG.Vx +++ b/config/CONFIG.Vx @@ -11,7 +11,7 @@ OS_CLASS = vxWorks # The definitions VX_DIR, VX_GNU, GNU_DIR and GNU_LIB # can be overridden for specific host architectures -# by creating a CONFIG_SITE.Vx. file with +# by creating a CONFIG_SITE.Vx. DEPENDS @@ -217,7 +208,7 @@ DEPENDS_RULE = -$(COMPILE.cc) $(DEPENDS_FLAG) $^ > DEPENDS # Include files -INCLUDES = $(USR_INCLUDES) -I. -I.. $(EPICS_INCLUDES) $(TARGET_INCLUDES) $(OP_SYS_INCLUDES) +INCLUDES = -I. -I.. $(USR_INCLUDES) $(EPICS_INCLUDES) $(TARGET_INCLUDES) $(OP_SYS_INCLUDES) CFLAGS = $(OPT_CFLAGS) $(DEBUG_CFLAGS) $(WARN_CFLAGS) $(TARGET_CFLAGS)\ $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(VENDOR_DEP_CFLAGS) $(STATIC_CFLAGS)\ @@ -237,9 +228,11 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS) $(ARCH_DEP_CPPFLAGS) CPPSNCFLAGS = $(INCLUDES) +DBDFLAGS = -I . -I .. $(USR_DBDFLAGS) $(EPICS_DBDFLAGS) + # Build compile line here -COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c $(SOURCE_FLAG) -COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(SOURCE_CXXFLAG) +COMPILE.c = $(CC) $(CPPFLAGS) $(CFLAGS) -c $(SOURCE_FLAG) +COMPILE.cc = $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SOURCE_CXXFLAG) endif diff --git a/config/CONFIG_HOST_ARCH.Borland b/config/CONFIG_HOST_ARCH.Borland new file mode 100644 index 000000000..6f09d7ee6 --- /dev/null +++ b/config/CONFIG_HOST_ARCH.Borland @@ -0,0 +1,20 @@ +# CONFIG_HOST_ARCH.Borland +# + +EXE=.exe +HOSTEXE=.exe + +CP =$(PERL) $(EPICS_BASE_HOST_BIN)/cp.pl +MV =$(PERL) $(EPICS_BASE_HOST_BIN)/mv.pl +RM =$(PERL) $(EPICS_BASE_HOST_BIN)/rm.pl -f +MKDIR=$(PERL) $(EPICS_BASE_HOST_BIN)/mkdir.pl +RMDIR=$(PERL) $(EPICS_BASE_HOST_BIN)/rm.pl -rf +FN =$(PERL) $(EPICS_BASE_HOST_BIN)/fullName.pl +CHMOD=echo +ECHO=echo + +WIND_HOST_TYPE = x86-win32 + +# Use std path variables from ms +HOME = $(HOMEDRIVE)$(HOMEPATH) + diff --git a/config/CONFIG_HOST_ARCH.UnixCommon b/config/CONFIG_HOST_ARCH.UnixCommon index 23308c4b3..57c714e3f 100644 --- a/config/CONFIG_HOST_ARCH.UnixCommon +++ b/config/CONFIG_HOST_ARCH.UnixCommon @@ -10,3 +10,11 @@ MKDIR = mkdir RMDIR = rm -rf CHMOD = "/bin/chmod" +# Set LD_LIBRARY_PATH for shared library builds +ifneq ($(EPICS_BASE),$(INSTALL_LOCATION)) +export LD_LIBRARY_PATH := $(INSTALL_HOST_LIB):$(EPICS_BASE_HOST_LIB):$(LD_LIBRARY_PATH) +else +export LD_LIBRARY_PATH := $(EPICS_BASE_HOST_LIB):$(LD_LIBRARY_PATH) +endif + + diff --git a/config/CONFIG_HOST_ARCH.WIN32 b/config/CONFIG_HOST_ARCH.WIN32 index 232272128..ab1642bc2 100644 --- a/config/CONFIG_HOST_ARCH.WIN32 +++ b/config/CONFIG_HOST_ARCH.WIN32 @@ -2,6 +2,7 @@ # EXE=.exe +HOSTEXE=.exe CP =$(PERL) $(EPICS_BASE_HOST_BIN)/cp.pl MV =$(PERL) $(EPICS_BASE_HOST_BIN)/mv.pl diff --git a/config/CONFIG_HOST_ARCH.cygwin32 b/config/CONFIG_HOST_ARCH.cygwin32 index 46c99c9d0..5e60ebaf1 100644 --- a/config/CONFIG_HOST_ARCH.cygwin32 +++ b/config/CONFIG_HOST_ARCH.cygwin32 @@ -6,6 +6,7 @@ -include $(EPICS_BASE)/config/CONFIG_HOST_ARCH.UnixCommon EXE=.exe +HOSTEXE=.exe TORNADO=YES diff --git a/config/CONFIG_SITE b/config/CONFIG_SITE index fa3552d4b..70724dc3e 100644 --- a/config/CONFIG_SITE +++ b/config/CONFIG_SITE @@ -13,14 +13,15 @@ # i.e.: the arch running DCT/getrel/etc. # # Currently Supporting: -# sun4 -# hp700 -# alpha -# solaris -# sgi +# Borland # Linux # WIN32 -# LynxOS +# alpha +# cygwin32 +# hp700 +# sgi +# solaris +# sun4 # # HOST_ARCH now an environment variable # HOST_ARCH=$(shell /usr/local/epics/startup/HostArch) @@ -31,17 +32,22 @@ endif # The architectures to build EPICS for # # Currently Supporting: -# mv167 +# frc40 +# frc5ce +# hkbaja47 +# hkv2f +# mv147 +# mv1604 # mv162 # mv162lc -# mv147 -# hkv2f -# niCpu030 -# pc486 -# frc5ce -# hkbaja47 +# mv167 +# mv177 +# niCpu030 +# pc486 +# ppc604 +# vxipc # -CROSS_COMPILER_TARGET_ARCHS=vxWorks-68040 +CROSS_COMPILER_TARGET_ARCHS=vxWorks-68040 vxWorks-ppc604 # If only a subset of the host architectures perform @@ -57,7 +63,8 @@ TORNADO=YES # VxWorks directory for TORNADO=YES #VX_DIR_YES=c:\\Tornado -VX_DIR_YES = /usr/local/vw/tornado101 +#VX_DIR_YES = /usr/local/vw/tornado101 +VX_DIR_YES = /usr/local/vw/tornado20 # VxWorks directory for TORNADO=NO #VX_DIR_NO=$(VW) @@ -77,7 +84,7 @@ 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 -# HPCC (cc -Aa) OTHER VENDOR +# HPACC (cc -Aa) OTHER VENDOR ANSI=ACC # C++ Compiler (for Host builds) @@ -100,6 +107,10 @@ CMPLR=STRICT # Individual Makefiles may override CXXCMPLR=STRICT +# Build should install all include files first? +# must be either YES or NO +MAKE_INC_TARGET_FIRST=NO + # Build shared libraries? # (archive libraries will also be built) # must be either YES or NO diff --git a/config/CONFIG_SITE.Host.Borland b/config/CONFIG_SITE.Host.Borland new file mode 100644 index 000000000..74f6697ee --- /dev/null +++ b/config/CONFIG_SITE.Host.Borland @@ -0,0 +1,8 @@ +# +# $Id$ +# +# Site Specific Configuration Information +# Only the local epics system manager should modify this file + +SHARED_LIBRARIES = YES + diff --git a/config/CONFIG_SITE.Vx.ppc604 b/config/CONFIG_SITE.Vx.ppc604 index bb765e7b8..6fb406871 100644 --- a/config/CONFIG_SITE.Vx.ppc604 +++ b/config/CONFIG_SITE.Vx.ppc604 @@ -1,3 +1,3 @@ -# Vx directory override for APS -VX_DIR_YES = /usr/local/vw/tornado101ppc +# APS override of tornado directory for ppc +#VX_DIR_YES = /usr/local/vw/tornado101ppc2 diff --git a/config/RULES.Host b/config/RULES.Host index fa8d18f5a..d4c3a7265 100644 --- a/config/RULES.Host +++ b/config/RULES.Host @@ -1,7 +1,6 @@ # $Id$ # # Rules for making things specified in Makefile.Host -# # Some rules for filename-massage are system specific # and have "ifdefs" here instead of using definitions # from CONFIG.Host.$(ARCH_CLASS) - sorry about this, @@ -31,9 +30,6 @@ vpath %.h $(USER_VPATH) vpath %.c $(USER_VPATH) ../os/$(ARCH_CLASS) ../os/generic .. vpath %.cc $(USER_VPATH) ../os/$(ARCH_CLASS) ../os/generic .. vpath %.rc $(USER_VPATH) ../os/$(ARCH_CLASS) ../os/generic .. -# This prevents base/src/include/*.h from being installed. Why?? -#vpath %.h ../os/$(ARCH_CLASS) ../os/generic .. -vpath %.h $(USER_VPATH) # check for add-on CFLAGS and CXXFLAGS # @@ -223,15 +219,21 @@ ifdef PROD PROD := $(addsuffix $(EXE), $(PROD)) endif +#----------------------------------------------------------------- +# if we are not building base add base includes and dbd 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) +EPICS_DBDFLAGS += -I $(EPICS_BASE)/dbd +endif +endif + #--------------------------------------------------------------- # ---------------------------------------------------- # create names (lists) for installed things # ---------------------------------------------------- -# each list starts with the destination directory name(s) -# to make sure it's there - - INCREC +=$(RECTYPES) $(MENUS) INSTALL_PROD= $(PROD:%= $(INSTALL_BIN)/%) @@ -279,9 +281,7 @@ endif #--------------------------------------------------------------- # always use c++ linker -ifdef CPLUSPLUS LINK.c = $(LINK.cc) -endif #--------------------------------------------------------------- # Version number for base shared libraries (and win32 products) @@ -300,18 +300,24 @@ ifdef LIBRARY ifdef LIBOBJS LIBTARGETS += $(LIBNAME) $(INSTALL_LIBS) +LIBNAME_RCS=$(foreach lib, $(basename $(LIBRARY)), $(RCS) $($(lib)_RCS) $($(lib)_RCS_$(ARCH_CLASS))) +LIBNAME_RESS=$(addsuffix $(RES), $(basename $(LIBNAME_RCS))) + +ifneq ($(words $(DLL_LIBS)), $(words $(DLL_DEPLIBS))) +# If invalid library names, don't make DLL file +SHARED_LIBRARIES = NO +endif + # check if shared libraries requested ifeq ($(strip $(SHARED_LIBRARIES)),YES) CFLAGS += $($(ANSI)_SHRLIB_CFLAGS_YES) -CXXFLAGS += $($(ANSI)_SHRLIB_CFLAGS_YES) +CXXFLAGS += $($(CPLUSPLUS)_SHRLIB_CFLAGS_YES) +SHRLIB_LDFLAGS = $($(CPLUSPLUS)_SHRLIB_LDFLAGS_YES) PROD_VERSION =$(SHRLIB_VERSION) -ifeq ($(findstring cc,$(suffix $(LIBSRCS))),cc) +# always use c++ linker SHRLIB_LINKER = $(CXX) -else -SHRLIB_LINKER = $(CC) -endif LIBTARGETS += $(SHRLIBNAME) $(INSTALL_SHRLIBS) $(INSTALL_DLL_LINK_LIBS) endif # SHARED_LIBRARIES=YES @@ -324,6 +330,8 @@ endif # LIBRARY all:: install +build:: inc + build:: $(LIBTARGETS) $(PROD) $(TESTPROD) $(INSTALLS) \ $(MENUS) $(RECTYPES) $(BPTS) ifdef DBDEXPAND @@ -332,16 +340,9 @@ endif inc:: $(INSTALL_INC) $(INSTALL_OSINC) -# WIN95/NT source browser -#ifdef BAF -PROD_BAF = $(addsuffix $(BAF), $(basename $(PROD))) -LIB_BAF = $(addsuffix $(BAF), $(basename $(LIBRARY))) -browse: $(LIB_BAF) $(PROD_BAF) -#endif - rebuild:: clean install -install:: inc buildInstall +install:: buildInstall buildInstall :: build $(TARGETS) \ $(INSTALL_SCRIPTS) $(INSTALL_PROD) \ @@ -358,9 +359,6 @@ clean:: @echo "Cleaning" @$(RM) *.i *$(OBJ) *.a $(PROD) $(TESTPROD) $(LIBNAME) $(SHRLIBNAME) $(INC) \ *$(RES) $(TARGETS) $(DBDINSTALL) $(MENUS) $(RECTYPES) $(BPTS) -ifdef BAF - @$(RM) $(PROD_BAF) $(LIB_BAF) *$(BOF) -endif ifdef DBDEXPAND @$(RM) $(DBDNAME) endif @@ -406,25 +404,18 @@ endif PRODNAME_OBJS=$(addsuffix $(OBJ), $(basename $(PRODNAME_SRCS))) PRODNAME_RESS=$(addsuffix $(RES), $(basename $(PRODNAME_RCS))) -BROWSE_OBJECTS = $(addsuffix $(BOF), $(basename $(PRODNAME_SRCS))) +ifeq ($(HOST_ARCH),Borland) +$(PRODNAME): $(PRODNAME_OBJS) $(PRODNAME_RESS) + @$(RM) $@ + $(PRODNAME_LINKER) $(PRODNAME_OBJS) , $@ ,,$(LINKLIBS) $(subst /,\\,$(LDLIBS)),, $(PRODNAME_RESS) +else $(PRODNAME): $(PRODNAME_OBJS) $(PRODNAME_RESS) @$(RM) $@ $(PRODNAME_LINKER) $(PRODNAME_OBJS) $(PRODNAME_RESS) $(LDLIBS) -else # ifdef PRODNAME_SRCS - -BROWSE_OBJECTS = $(addsuffix $(BOF), $(basename $(PRODNAME))) - -endif # ifdef PRODNAME_SRCS - -# WIN95/NT source browser -ifdef BAF -$(addsuffix $(BAF), $(basename $(PRODNAME))): $(BROWSE_OBJECTS) - @echo "Building source browser archive $@" - @$(RM) $@ - $(BAFCMD) $^ endif +endif # ifdef PRODNAME_SRCS else # PRODNAME not defined @@ -437,7 +428,7 @@ PROD_OBJS=$(addsuffix $(OBJ), $(basename $(SRCS) $(COND_PROD_SRCS))) PROD_RESS=$(addsuffix $(RES), $(basename $(RCS) $(COND_PROD_RCS))) PROD_MAKE_COMMAND=$(MAKE) $@\ - PRODNAME=$(addsuffix $(EXE), $(basename $@)) \ + PRODNAME="$@"\ PRODNAME_SRCS="$(SRCS) $($(basename $@)_SRCS)"\ PRODNAME_SRCS_DEFAULT="$($(basename $@)_SRCS_DEFAULT)"\ PRODNAME_SRCS_$(ARCH_CLASS)="$($(basename $@)_SRCS_$(ARCH_CLASS))"\ @@ -449,11 +440,6 @@ PROD_MAKE_COMMAND=$(MAKE) $@\ $(PROD): $(SRCS) $(PROD_OBJS) $(COND_PROD_SRCS) $(PROD_RESS) $(PROD_DEPLIBS) $(COND_PROD_DEPLIBS) @$(PROD_MAKE_COMMAND) -ifdef BAF -$(PROD_BAF): $(PROD) - @$(PROD_MAKE_COMMAND) -endif - endif endif #ifdef PRODNAME @@ -510,6 +496,11 @@ $(INSTALL_JAVA)/%.jar: %.jar @echo "Installing jar file $@" $(INSTALL) -d -m 644 $< $(@D) +$(PACKAGE)_%.h:$(INSTALL_JAVA)/$(PACKAGE)/%.class + $(JAVAHCMD) $(PACKAGE).$* + +.PRECIOUS: $(INSTALL_CLASSES) + #--------------------------------------------------------------- #--------------------------------------------------------------- # Generic Rules for 'simple' targets that @@ -530,20 +521,40 @@ depends:: $(LIBSRCS) $(SRCS) $(COND_PROD_SRCS) $(RM) DEPENDS $(DEPENDS_RULE) +ifeq ($(HOST_ARCH),Borland) %$(EXE): %.c @$(RM) $@ $(COMPILE.c) $< - $(LINK.c) $(notdir $(basename $<))$(OBJ) $(LDLIBS) + $(LINK.c) $(subst ../,,$(basename $<))$(OBJ) , $@ ,,$(LINKLIBS) $(subst /,\\,$(LDLIBS)) %$(EXE): %.cc @$(RM) $@ $(COMPILE.cc) $< - $(LINK.cc) $(notdir $(basename $<))$(OBJ) $(LDLIBS) + $(LINK.cc) $(subst ../,,$(basename $<))$(OBJ) , $@ ,,$(LINKLIBS) $(subst /,\\,$(LDLIBS)) %$(EXE): %.C @$(RM) $@ $(COMPILE.cc) $< - $(LINK.cc) $(notdir $(basename $<))$(OBJ) $(LDLIBS) + $(LINK.cc) $(subst ../,,$(basename $<))$(OBJ) , $@ ,,$(LINKLIBS) $(subst /,\\,$(LDLIBS)) + +else + +%$(EXE): %.c + @$(RM) $@ + $(COMPILE.c) $< + $(LINK.c) $(subst ../,,$(basename $<))$(OBJ) $(LDLIBS) + +%$(EXE): %.cc + @$(RM) $@ + $(COMPILE.cc) $< + $(LINK.cc) $(subst ../,,$(basename $<))$(OBJ) $(LDLIBS) + +%$(EXE): %.C + @$(RM) $@ + $(COMPILE.cc) $< + $(LINK.cc) $(subst ../,,$(basename $<))$(OBJ) $(LDLIBS) + +endif %$(OBJ): %.c @$(RM) $@ @@ -562,13 +573,6 @@ depends:: $(LIBSRCS) $(SRCS) $(COND_PROD_SRCS) @$(RM) $@ $(RCCMD) - -# WIN95/NT source browser -%.bsc: %.sbr - @echo "building source browser archive $@" - $(RM) $@ - $(BAFCMD) $< - # # rename the y.tab.h file only if we # are creating it @@ -641,12 +645,12 @@ $(INSTALL_DBD)/%: ../% %Record.h: %Record.dbd $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH$(EXE) \ - $(USER_DBDFLAGS) $< + $(DBDFLAGS) $< %Record.h: ../%Record.dbd $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH$(EXE) \ - $(USER_DBDFLAGS) $< + $(DBDFLAGS) $< menu%.h: menu%.dbd $(RM) $@ @@ -664,24 +668,38 @@ bpt%.dbd: ../bpt%.data $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/makeBpt$(EXE) $< +# Patch for old applications +ifdef USER_DBDFLAGS +DBDFLAGS = $(USER_DBDFLAGS) +endif + ifdef DBDEXPAND $(DBDNAME): ../$(DBDEXPAND) @echo Expanding dbd @$(RM) $@ - $(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand$(EXE) $(USER_DBDFLAGS) $< > $@ + $(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand$(EXE) $(DBDFLAGS) $< > $@ + +ifneq (,$(wildcard ../base.dbd)) +$(DBDNAME): ../base.dbd +endif endif -# WIN95/NT source browser -ifdef BAF -$(LIB_BAF): $(addsuffix $(BOF), $(basename $(LIBSRCS))) - @echo "Building source browser archive $@" - @$(RM) $@ - $(BAFCMD) $^ +ifeq ($(HOST_ARCH),Borland) +$(DLL_LINK_LIBNAME) $(SHRLIBNAME): $(LIBOBJS) $(LIBNAME_RESS) + $(LINK.shrlib) $(LIBOBJS) , $@ ,,$(LINKLIBS) $(subst /,\\,$(DLL_LDLIBS)), $(DLL_DEF_FLAG), $(LIBNAME_RESS) + +else +$(DLL_LINK_LIBNAME) $(SHRLIBNAME): $(LIBOBJS) $(LIBNAME_RESS) + $(LINK.shrlib) $(LIBOBJS) $(DLL_LDLIBS) $(LIBNAME_RESS) + endif +ifeq ($(HOST_ARCH),Borland) +# rule for lib (archive of object files) creation +$(LIBNAME): $(LIBOBJS) + $(RM) $@ + $(ARCMD) $(foreach lib,$(LIBOBJS),+$(lib)) -$(DLL_LINK_LIBNAME) $(SHRLIBNAME): $(LIBOBJS) - $(LINK.shrlib) $(LIBOBJS) $(DLL_LDLIBS) - +else # rule for lib (archive of object files) creation $(LIBNAME): $(LIBOBJS) $(RM) $@ @@ -690,6 +708,8 @@ ifdef RANLIB $(RANLIB) $@; endif # RANLIB +endif + $(INSTALL_BIN)/%: ../os/$(ARCH_CLASS)/% @echo "Installing os-specific script $@" @$(INSTALL_PRODUCT) -d -m 555 $< $(INSTALL_BIN) diff --git a/config/RULES.Unix b/config/RULES.Unix index 3e171b6f3..8bdcad536 100644 --- a/config/RULES.Unix +++ b/config/RULES.Unix @@ -57,7 +57,7 @@ buildInstall :: build \ $(INSTALL_MAN) $(INSTALL_MANS) $(INSTALL_HTMLS) \ $(INSTALL_DOC) $(INSTALL_DOCS) $(INSTALL_TEMPLATES) \ $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR) $(INSTALL_TEMPLATE) \ - $(INSTALL_CONFIG) $(INSTALL_CONFIGS) \ + $(INSTALL_CONFIG) $(INSTALL_CONFIGS) \ $(INSTALL_DBD) $(INSTALL_DBS) $(INSTALL_BPTS) \ $(INSTALL_DBDNAME) $(INSTALL_INCREC) \ $(INSTALL_TCLLIBS) $(INSTALL_TCLINDEX) @@ -180,12 +180,12 @@ $(INSTALL_DBD)/%: ../% %Record.h: %Record.dbd $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH \ - $(USER_DBDFLAGS) $< + $(DBDFLAGS) $< %Record.h: ../%Record.dbd $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH \ - $(USER_DBDFLAGS) $< + $(DBDFLAGS) $< menu%.h: menu%.dbd $(RM) $@ @@ -203,10 +203,21 @@ bpt%.dbd: ../bpt%.data $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/makeBpt $< +# Patch for old applications +ifdef USER_DBDFLAGS +DBDFLAGS = $(USER_DBDFLAGS) +endif + +ifdef DBDEXPAND $(DBDNAME): ../$(DBDEXPAND) @echo expanding dbd @$(RM) $@ - $(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand $(USER_DBDFLAGS) $< > $@ + $(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand $(DBDFLAGS) $< > $@ + +ifneq (,$(wildcard ../base.dbd)) +$(DBDNAME): ../base.dbd +endif +endif $(LIBNAME): $(LIBOBJS) @echo Building library $@ diff --git a/config/RULES.Vx b/config/RULES.Vx index e67613175..f2ea04ca4 100644 --- a/config/RULES.Vx +++ b/config/RULES.Vx @@ -7,10 +7,11 @@ ifdef LIBOBJS_DEFAULT LIBOBJS+=$(LIBOBJS_DEFAULT) endif endif - + INCREC +=$(RECTYPES) $(MENUS) INSTALL_PROD = $(PROD:%= $(INSTALL_BIN)/%) INSTALL_LIBS = $(LIBNAME:%= $(INSTALL_BIN)/%) +INSTALL_MUNCHES = $(MUNCHNAME:%= $(INSTALL_BIN)/%) INSTALL_LIBS_CXX = $(LIBNAME_CXX:%= $(INSTALL_BIN)/%) INSTALL_INC = $(INC:%= $(INSTALL_INCLUDE)/%) INSTALL_OSINCLUDE = $(INSTALL_INCLUDE)/os/vxWorks @@ -33,21 +34,36 @@ INSTALL_DBDNAME = $(DBDNAME:%= $(INSTALL_DBD)/%) MAN_DIRECTORY_TARGETS = $(foreach n, $(MANLIST),$(INSTALL_MAN)/man$(n)) +#----------------------------------------------------------------- +# if we are not building base add base includes and dbd 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) +EPICS_DBDFLAGS += -I $(EPICS_BASE)/dbd +endif +endif + all:: install +build:: inc + rebuild:: clean install pre_build:: build:: pre_build $(MENUS) $(RECTYPES) $(BPTS)\ - $(LIBNAME) $(LIBNAME_CXX) $(TARGETS) $(PROD) $(DBDNAME) + $(LIBNAME) $(LIBNAME_CXX) $(MUNCHNAME) $(TARGETS) $(PROD) +ifdef DBDEXPAND +build:: $(DBDNAME) +endif inc:: $(INSTALL_INC) $(INSTALL_OSINC) - -install:: inc buildInstall + +install:: buildInstall buildInstall :: build $(INSTALL_INCREC)\ - $(INSTALL_LIBS) $(INSTALL_LIBS_CXX) \ + $(INSTALL_LIBS) $(INSTALL_LIBS_CXX) $(INSTALL_MUNCHES) \ $(TARGETS) $(INSTALL_PROD) \ $(INSTALL_MANS) $(INSTALL_DOCS) \ $(INSTALL_HTMLS) \ @@ -67,6 +83,9 @@ clean:: @echo "Cleaning" @$(RM) *.i *.o *.a *.out $(TARGETS) $(PROD) $(LIBNAME) $(INC) \ $(DBDINSTALL) $(MENUS) $(RECTYPES) $(BPTS) $(DBDNAME) +ifdef MUNCH + @$(RM) $(MUNCHNAME) ctdt.c ctdt.o nm.out +endif # The order of the following dependencies is # VERY IMPORTANT !!!! @@ -103,6 +122,16 @@ clean:: $(LINK.c) $@ $< ctdt.o @ $(RM) ctdt.c ctdt.o +# C++ munching +$(MUNCHNAME):%.munch : % + @ $(RM) ctct.o ctdt.c nm.out + $(NM) $< > nm.out + $(MUNCH) < nm.out > ctdt.c + $(COMPILE.c) -traditional ctdt.c + $(LINK.cc) $@ $< ctdt.o + + + # # rename the y.tab.h file only if we # are creating it @@ -128,7 +157,7 @@ endif %.c: ../%.st @echo "preprocessing $*.st" @$(RM) $*.i - $(CPP) $(CPPFLAGS) $(CPPSNCFLAGS) $< $*.i + $(CPP) $(CPPFLAGS) $(CPPSNCFLAGS) $< > $*.i @echo "converting $*.i" @$(RM) $@ $(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $*.i @@ -178,12 +207,12 @@ $(INSTALL_DBD)/%: ../% %Record.h: %Record.dbd $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH$(EXE) \ - $(USER_DBDFLAGS) $< + $(DBDFLAGS) $< %Record.h: ../%Record.dbd $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH$(EXE) \ - $(USER_DBDFLAGS) $< + $(DBDFLAGS) $< menu%.h: menu%.dbd $(RM) $@ @@ -201,10 +230,17 @@ bpt%.dbd: ../bpt%.data $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/makeBpt$(EXE) $< +# Patch for old applications +ifdef USER_DBDFLAGS +DBDFLAGS = $(USER_DBDFLAGS) +endif + +ifdef DBDEXPAND $(DBDNAME): ../$(DBDEXPAND) - @echo expanding dbd + @echo Expanding dbd @$(RM) $@ - $(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand$(EXE) $(USER_DBDFLAGS) $< > $@ + $(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand$(EXE) $(DBDFLAGS) $< > $@ +endif $(LIBNAME): $(LIBOBJS) @echo Building library $@ @@ -275,7 +311,13 @@ $(INSTALL_HTML)/$(HTMLS_DIR)/%: ../% ifneq (,$(wildcard ../baseLIBOBJS)) $(LIBNAME): ../baseLIBOBJS endif + +ifneq (,$(wildcard ../base.dbd)) +$(DBDNAME): ../base.dbd $(RECTYPES:%.h=../%.dbd) +else +$(DBDNAME): $(RECTYPES:%.h=../%.dbd) +endif + #=====> ???? the following line causes a rebuild every time #=====> $(LIBNAME): ../Makefile.Vx -$(DBDNAME): ../base.dbd $(RECTYPES:%.h=../%.dbd) diff --git a/config/RULES_DIRS b/config/RULES_DIRS index 4531d90a1..14f649f63 100644 --- a/config/RULES_DIRS +++ b/config/RULES_DIRS @@ -4,35 +4,35 @@ ARCHS += $(BUILD_ARCHS) host cross -ACTIONS += clean inc depends buildInstall browse +ACTIONS += clean inc depends build install buildInstall dirPart = $(word 1, $(subst $(DIVIDER), ,$@)) -actionArchPart = $(subst $(dirPart)$(DIVIDER), ,$@) +actionArchPart = $(join $(word 2, $(subst $(DIVIDER), ,$@)), \ + $(addprefix $(DIVIDER),$(word 3, $(subst $(DIVIDER), ,$@)))) dirActionArchTargets = $(foreach dir, $(DIRS), \ - $(foreach action, $(ACTIONS) install,\ + $(foreach action, $(ACTIONS),\ $(foreach arch, $(ARCHS), \ $(dir)$(DIVIDER)$(action)$(DIVIDER)$(arch)))) dirArchTargets += $(foreach dir, $(DIRS), \ $(foreach arch, $(ARCHS),\ $(dir)$(DIVIDER)$(arch))) dirActionTargets += $(foreach dir, $(DIRS), \ - $(foreach action, $(ACTIONS) install,\ + $(foreach action, $(ACTIONS),\ $(dir)$(DIVIDER)$(action))) -actionArchTargets = $(foreach action, $(ACTIONS) install,\ +actionArchTargets = $(foreach action, $(ACTIONS),\ $(foreach arch, $(ARCHS), \ $(action)$(DIVIDER)$(arch))) - -installArchTargets = $(foreach action, install,\ - $(foreach arch, $(ARCHS), \ - $(action)$(DIVIDER)$(arch))) - +ifeq ($(MAKE_INC_TARGET_FIRST),YES) all install :: inc buildInstall +$(ARCHS) $(installArchTargets) :: inc +else +all install :: buildInstall +endif + rebuild:: clean all -$(ARCHS) $(installArchTargets) :: inc - $(DIRS) $(dirActionTargets) $(dirArchTargets)$(dirActionArchTargets) :: $(MAKE) -C $(dirPart) $(actionArchPart) @@ -40,11 +40,9 @@ $(ARCHS) $(ACTIONS) $(actionArchTargets) ::%: \ $(foreach dir, $(DIRS), $(dir)$(DIVIDER)%) -.PHONY :: $(DIRS) all install rebuild +.PHONY :: $(DIRS) all rebuild .PHONY :: $(ARCHS) $(ACTIONS) .PHONY :: $(dirActionTargets) $(dirArchTargets) .PHONY :: $(dirActionArchTargets) .PHONY :: $(actionArchTargets) -.PHONY :: $(installArchTargets) - diff --git a/config/RULES_TOP b/config/RULES_TOP index 15850900b..aa60e7d55 100644 --- a/config/RULES_TOP +++ b/config/RULES_TOP @@ -4,10 +4,11 @@ include $(TOP)/config/RULES_DIRS -uninstall$(DIVIDER)%:: - @$(RMDIR) $(INSTALL_LOCATION_BIN)/$* $(INSTALL_LOCATION_LIB)/$* +uninstall$(DIVIDER)%: uninstallDirs + @$(RMDIR) $(INSTALL_LOCATION_BIN)/$* $(INSTALL_LOCATION_LIB)/$* cleandirs: + @echo " " #stops "nothing to be done for cleandirs" message ifeq ($(wildcard $(INSTALL_LOCATION_BIN)/*),) @$(RMDIR) $(INSTALL_LOCATION_BIN) endif @@ -15,8 +16,12 @@ ifeq ($(wildcard $(INSTALL_LOCATION_LIB)/*),) @$(RMDIR) $(INSTALL_LOCATION_LIB) endif +distclean: clean uninstall + uninstall:: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS)) @$(MAKE) -f Makefile cleandirs + +uninstallDirs: @$(RMDIR) rec.bak rec @$(RMDIR) $(INSTALL_DBD) $(INSTALL_MAN) $(INSTALL_INCLUDE) $(INSTALL_DOC)\ $(INSTALL_HTML) $(INSTALL_JAVA) $(INSTALL_TEMPLATES) @@ -55,9 +60,5 @@ help: @echo "Indiv. object targets are supported by O. level Makefile .e.g" @echo " xxxRecord.o" -distclean: clean uninstall - -.PHONY :: uninstall tar help cleandirs distclean - - +.PHONY :: uninstall tar help cleandirs distclean uninstallDirs