1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
|
#
# Standard make variables and rules for all UNIX platforms.
#
UnixPlatform = 1
#
# Any recursively-expanded variable set here can be overridden _afterwards_ by
# a platform-specific mk file which includes this one.
#
#
# Standard unix programs - note that GNU make already defines some of
# these such as AR, RM, etc (see section 10.3 of the GNU make manual).
#
RANLIB = ranlib
MKDIRHIER = mkdirhier
INSTALL = installbsd -c
INSTLIBFLAGS = -m 0644
INSTEXEFLAGS = -m 0755
CP = cp
MV = mv -f
CPP = /lib/cpp
#
# Replacements for implicit rules
#
%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
%.o: %.cc
$(CXX) -c $(CXXFLAGS) -o $@ $<
#
# General rules for cleaning.
#
define CleanRule
$(RM) *.o *.a *.class
endef
# XXX VeryCleanRule should delete Java stubs too.
define VeryCleanRule
$(RM) *.d
$(RM) $(CORBA_STUB_FILES)
endef
#
# Patterns for various file types
#
LibPattern = lib%.a
LibSuffixPattern = %.a
LibSearchPattern = -l%
BinPattern = %
TclScriptPattern = %
#
# Stuff to generate statically-linked libraries.
#
define StaticLinkLibrary
(set -x; \
$(RM) $@; \
$(AR) $@ $^; \
$(RANLIB) $@; \
)
endef
ifdef EXPORT_TREE
define ExportLibrary
(dir="$(EXPORT_TREE)/$(LIBDIR)"; \
files="$^"; \
for file in $$files; do \
$(ExportFileToDir); \
done; \
)
endef
endif
#
# Stuff to generate executable binaries.
#
# These rules are used like this
#
# target: objs lib_depends
# @(libs="libs"; $(...Executable))
#
# The command we want to generate is like this
#
# linker -o target ... objs libs
# i.e. we need to filter out the lib_depends from the command
#
IMPORT_LIBRARY_FLAGS = $(patsubst %,-L%,$(IMPORT_LIBRARY_DIRS))
define CXXExecutable
(set -x; \
$(RM) $@; \
$(CXXLINK) -o $@ $(CXXLINKOPTIONS) $(IMPORT_LIBRARY_FLAGS) \
$(filter-out $(LibSuffixPattern),$^) $$libs; \
)
endef
define CExecutable
(set -x; \
$(RM) $@; \
$(CLINK) -o $@ $(CLINKOPTIONS) $(IMPORT_LIBRARY_FLAGS) \
$(filter-out $(LibSuffixPattern),$^) $$libs; \
)
endef
ifdef EXPORT_TREE
define ExportExecutable
(dir="$(EXPORT_TREE)/$(BINDIR)"; \
files="$^"; \
for file in $$files; do \
$(ExportExecutableFileToDir); \
done; \
)
endef
endif
#
# CORBA stuff
#
lib_depend := $(patsubst %,$(LibPattern),omniORB2)
omniORB_lib_depend := $(GENERATE_LIB_DEPEND)
lib_depend := $(patsubst %,$(LibPattern),omniDynamic2)
omniDynamic_lib_depend := $(GENERATE_LIB_DEPEND)
OMNIORB2_IDL_ONLY = omniidl2
OMNIORB2_IDL_ANY_FLAGS = -a
OMNIORB2_IDL = $(OMNIORB2_IDL_ONLY) $(OMNIORB2_IDL_ANY_FLAGS)
OMNIORB2_CPPFLAGS = -D__OMNIORB2__ -I$(CORBA_STUB_DIR) $(OMNITHREAD_CPPFLAGS)
OMNIORB2_LIB = $(patsubst %,$(LibSearchPattern),omniORB2) \
$(patsubst %,$(LibSearchPattern),omniDynamic2) \
$(OMNITHREAD_LIB) $(SOCKET_LIB)
OMNIORB2_LIB_NODYN = $(patsubst %,$(LibSearchPattern),omniORB2) \
$(OMNITHREAD_LIB) $(SOCKET_LIB)
OMNIORB2_LIB_NODYN_DEPEND = $(omniORB_lib_depend) $(OMNITHREAD_LIB_DEPEND)
OMNIORB2_LIB_DEPEND = $(omniORB_lib_depend) $(OMNITHREAD_LIB_DEPEND) \
$(omniDynamic_lib_depend)
OMNIORB2_STATIC_STUB_OBJS = $(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%SK.o)
OMNIORB2_STATIC_STUB_SRCS = $(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%SK.cc)
OMNIORB2_DYN_STUB_OBJS = $(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%DynSK.o)
OMNIORB2_DYN_STUB_SRCS = $(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%DynSK.cc)
OMNIORB2_STUB_SRCS = $(OMNIORB2_STATIC_STUB_SRCS) $(OMNIORB2_DYN_STUB_SRCS)
OMNIORB2_STUB_OBJS = $(OMNIORB2_STATIC_STUB_OBJS) $(OMNIORB2_DYN_STUB_OBJS)
OMNIORB2_STUB_SRC_PATTERN = $(CORBA_STUB_DIR)/%SK.cc
OMNIORB2_STUB_OBJ_PATTERN = $(CORBA_STUB_DIR)/%SK.o
OMNIORB2_DYN_STUB_SRC_PATTERN = $(CORBA_STUB_DIR)/%DynSK.cc
OMNIORB2_DYN_STUB_OBJ_PATTERN = $(CORBA_STUB_DIR)/%DynSK.o
OMNIORB2_STUB_HDR_PATTERN = $(CORBA_STUB_DIR)/%.hh
# omniORB2 access control policy modules
OMNIORB2_DUMMYGK_LIB = $(patsubst %,$(LibSearchPattern),omniGK_stub)
lib_depend := $(patsubst %,$(LibPattern),omniGK_stub)
OMNIORB2_DUMMYGK_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
OMNIORB2_TCPWRAPGK_LIB = $(patsubst %,$(LibSearchPattern),tcpwrapGK)
lib_depend := $(patsubst %,$(LibPattern),tcpwrapGK)
OMNIORB2_TCPWRAPGK_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
omniORB2GatekeeperImplementation = OMNIORB2_DUMMYGK
OMNIORB2_LIB += $($(omniORB2GatekeeperImplementation)_LIB)
OMNIORB2_LIB_NODYN += $($(omniORB2GatekeeperImplementation)_LIB)
OMNIORB2_LIB_DEPEND += $($(omniORB2GatekeeperImplementation)_LIB_DEPEND)
OMNIORB2_LIB_NODYN_DEPEND += $($(omniORB2GatekeeperImplementation)_LIB_DEPEND)
# LifeCycle stuff
OMNIORB2_IDL_LC_FLAGS = -l
OMNIORB2_LC_LIB = $(patsubst %,$(LibSearchPattern),omniLC)
#
# Tcl stuff
#
define TclScriptExecutable
((set -x; $(RM) $@); \
if [ "$$wish" = "" ]; then \
wish="$(WISH4)"; \
fi; \
case "$$wish" in \
/*) ;; \
*) \
if [ "$(EXPORT_TREE)" != "" ]; then \
wish="$(EXPORT_TREE)/$(BINDIR)/$$wish"; \
else \
wish="./$$wish"; \
fi ;; \
esac; \
echo echo "#!$$wish >$@"; \
echo "#!$$wish" >$@; \
echo echo "set auto_path [concat {$$tcllibpath} \$$auto_path] >>$@"; \
echo "set auto_path [concat {$$tcllibpath} \$$auto_path]" >>$@; \
echo "cat $< >>$@"; \
cat $< >>$@; \
set -x; \
chmod a+x $@; \
)
endef
|