| 1 | # Top level makefile for pvfs2 |
|---|
| 2 | |
|---|
| 3 | ############################################################### |
|---|
| 4 | # LIST OF TARGETS WHICH MAY BE USED WHEN RUNNING MAKE: |
|---|
| 5 | # |
|---|
| 6 | # all default rule; builds libs, server, and test programs |
|---|
| 7 | # clean cleans up files |
|---|
| 8 | # distclean _really_ cleans up; returns to pristine tree |
|---|
| 9 | # docs builds documentation in docs subdirectory |
|---|
| 10 | # docsclean cleans up documentation files |
|---|
| 11 | # publish copy over documents to the PVFS.org web pags |
|---|
| 12 | # admintools builds admin tools |
|---|
| 13 | # usertools builds user tools |
|---|
| 14 | # kernapps builds userland helper programs for kernel driver |
|---|
| 15 | # cscope generates information for cscope utility |
|---|
| 16 | # tags generates tags file for use by editors |
|---|
| 17 | # codecheck checks source code for nonconformance to our std. |
|---|
| 18 | # kmod builds 2.6.x kernel module |
|---|
| 19 | # kmod24 builds 2.4.x kernel module |
|---|
| 20 | # kmod_install installs 2.6.x module in default module location |
|---|
| 21 | # kmod24_install installs 2.4.x module in default module location |
|---|
| 22 | # |
|---|
| 23 | # NOTE: you can also specify any single object or executable to |
|---|
| 24 | # build by providing its name (including the relative path) as the |
|---|
| 25 | # make target |
|---|
| 26 | # |
|---|
| 27 | |
|---|
| 28 | ############################################################### |
|---|
| 29 | # General documentation |
|---|
| 30 | # |
|---|
| 31 | # This is a single makefile that runs the entire pvfs2 build |
|---|
| 32 | # process. There are no makefiles in subdirectories. For a |
|---|
| 33 | # general introduction to this approach, please read this document |
|---|
| 34 | # by Peter Miller: |
|---|
| 35 | # |
|---|
| 36 | # http://www.tip.net.au/~millerp/rmch/recu-make-cons-harm.html |
|---|
| 37 | # |
|---|
| 38 | # Each subdirectory contains a module.mk file that gets included |
|---|
| 39 | # when make is executed. These module.mk files tell make about the |
|---|
| 40 | # files in each subdirectory that must be built, including any |
|---|
| 41 | # special case rules. Make uses this information to generate a |
|---|
| 42 | # sinle dependency graph and orchestrate the build process from this |
|---|
| 43 | # top level directory. |
|---|
| 44 | # |
|---|
| 45 | # We categorize our source depending on what it will be used for. |
|---|
| 46 | # For example, there are lists of source files for building the |
|---|
| 47 | # server, building the library, building documentation, etc. |
|---|
| 48 | # |
|---|
| 49 | |
|---|
| 50 | ############################################################### |
|---|
| 51 | # Generic makefile setup |
|---|
| 52 | |
|---|
| 53 | # define a few generic variables that we need to use; DESTDIR may |
|---|
| 54 | # be overridden on the command line during make install |
|---|
| 55 | DESTDIR = |
|---|
| 56 | srcdir = @srcdir@ |
|---|
| 57 | builddir = @BUILD_ABSOLUTE_TOP@ |
|---|
| 58 | prefix = @prefix@ |
|---|
| 59 | datarootdir = @datarootdir@ |
|---|
| 60 | exec_prefix = @exec_prefix@ |
|---|
| 61 | includedir = $(DESTDIR)@includedir@ |
|---|
| 62 | mandir = $(DESTDIR)@mandir@ |
|---|
| 63 | sbindir = $(DESTDIR)@sbindir@ |
|---|
| 64 | bindir = $(DESTDIR)@bindir@ |
|---|
| 65 | libdir = $(DESTDIR)@libdir@ |
|---|
| 66 | |
|---|
| 67 | VPATH = $(srcdir) |
|---|
| 68 | SHELL = @SHELL@ |
|---|
| 69 | INSTALL = @INSTALL@ |
|---|
| 70 | # TODO: should probably check for bison and flex in configure |
|---|
| 71 | BISON = bison |
|---|
| 72 | FLEX = flex |
|---|
| 73 | LN_S = ln -snf |
|---|
| 74 | BUILD_BMI_TCP = @BUILD_BMI_TCP@ |
|---|
| 75 | BUILD_BMI_ONLY = @BUILD_BMI_ONLY@ |
|---|
| 76 | BUILD_GM = @BUILD_GM@ |
|---|
| 77 | BUILD_MX = @BUILD_MX@ |
|---|
| 78 | BUILD_IB = @BUILD_IB@ |
|---|
| 79 | BUILD_OPENIB = @BUILD_OPENIB@ |
|---|
| 80 | BUILD_PORTALS = @BUILD_PORTALS@ |
|---|
| 81 | BUILD_VIS = @BUILD_VIS@ |
|---|
| 82 | BUILD_KARMA = @BUILD_KARMA@ |
|---|
| 83 | BUILD_FUSE = @BUILD_FUSE@ |
|---|
| 84 | BUILD_SERVER = @BUILD_SERVER@ |
|---|
| 85 | BUILD_TAU = @BUILD_TAU@ |
|---|
| 86 | BUILD_KERNEL = @BUILD_KERNEL@ |
|---|
| 87 | NEEDS_LIBRT = @NEEDS_LIBRT@ |
|---|
| 88 | TARGET_OS_DARWIN = @TARGET_OS_DARWIN@ |
|---|
| 89 | TARGET_OS_LINUX = @TARGET_OS_LINUX@ |
|---|
| 90 | GNUC = @GNUC@ |
|---|
| 91 | INTELC = @INTELC@ |
|---|
| 92 | # configure default is silent, unless --enable-verbose-build in |
|---|
| 93 | # which case QUIET_COMPILE will _not_ be defined. Further allow |
|---|
| 94 | # silence to be overriden with "make V=1". |
|---|
| 95 | QUIET_COMPILE = @QUIET_COMPILE@ |
|---|
| 96 | ifdef V |
|---|
| 97 | QUIET_COMPILE = 0 |
|---|
| 98 | endif |
|---|
| 99 | LINUX_KERNEL_SRC = @LINUX_KERNEL_SRC@ |
|---|
| 100 | LINUX24_KERNEL_SRC = @LINUX24_KERNEL_SRC@ |
|---|
| 101 | |
|---|
| 102 | ifeq ($(QUIET_COMPILE),1) |
|---|
| 103 | # say a one-line description of the action, do not echo the command |
|---|
| 104 | Q=@echo |
|---|
| 105 | E=@ |
|---|
| 106 | else |
|---|
| 107 | # do not say the short Q lines, but do echo the entire command |
|---|
| 108 | Q=@echo >/dev/null |
|---|
| 109 | E= |
|---|
| 110 | endif |
|---|
| 111 | |
|---|
| 112 | # build which client libs |
|---|
| 113 | build_shared = @build_shared@ |
|---|
| 114 | build_static = @build_static@ |
|---|
| 115 | |
|---|
| 116 | # Eliminate all default suffixes. We want explicit control. |
|---|
| 117 | .SUFFIXES: |
|---|
| 118 | |
|---|
| 119 | # PHONEY targets are targets that do not result in the generation |
|---|
| 120 | # of a file that has the same name as the target. Listing them |
|---|
| 121 | # here keeps make from accidentally doing too much work (see GNU |
|---|
| 122 | # make manual). |
|---|
| 123 | .PHONY: all clean dist distclean docs docsclean publish cscope tags codecheck admintools kernapps usertools |
|---|
| 124 | |
|---|
| 125 | ################################################################ |
|---|
| 126 | # Find project subdirectories |
|---|
| 127 | |
|---|
| 128 | # MODULES is a list of subdirectories that we wish to operate on. |
|---|
| 129 | # They are identified by the presence of module.mk files (makefile |
|---|
| 130 | # includes). |
|---|
| 131 | MODULES := $(shell find . -name "*.mk" | sed -e 's/^.\///;s/module.mk//') |
|---|
| 132 | |
|---|
| 133 | # List of directories to search for headers. |
|---|
| 134 | ifdef BUILD_BMI_ONLY |
|---|
| 135 | BUILD_SERVER="" |
|---|
| 136 | INCLUDES := \ |
|---|
| 137 | include \ |
|---|
| 138 | src/io/bmi \ |
|---|
| 139 | src/common/misc \ |
|---|
| 140 | src/common/quickhash \ |
|---|
| 141 | src/common/quicklist \ |
|---|
| 142 | src/common/id-generator \ |
|---|
| 143 | src/common/gossip \ |
|---|
| 144 | src/common/gen-locks \ |
|---|
| 145 | src/common/events |
|---|
| 146 | GENINCLUDES := \ |
|---|
| 147 | include |
|---|
| 148 | else |
|---|
| 149 | INCLUDES := \ |
|---|
| 150 | src/client/sysint \ |
|---|
| 151 | src/common/misc \ |
|---|
| 152 | src/common/quickhash \ |
|---|
| 153 | src/common/quicklist \ |
|---|
| 154 | src/common/id-generator \ |
|---|
| 155 | src/common/gossip \ |
|---|
| 156 | src/common/gen-locks \ |
|---|
| 157 | src/common/events \ |
|---|
| 158 | src/io/trove \ |
|---|
| 159 | src/io/bmi \ |
|---|
| 160 | src/io/description \ |
|---|
| 161 | src/io/buffer \ |
|---|
| 162 | src/io/job \ |
|---|
| 163 | src/io/dev \ |
|---|
| 164 | src/proto \ |
|---|
| 165 | src/common/mgmt |
|---|
| 166 | GENINCLUDES := \ |
|---|
| 167 | include |
|---|
| 168 | endif |
|---|
| 169 | |
|---|
| 170 | ################################################################# |
|---|
| 171 | # Setup global flags |
|---|
| 172 | |
|---|
| 173 | # These should all be self explanatory; they are standard flags |
|---|
| 174 | # for compiling and linking unless otherwise noted |
|---|
| 175 | CC = @CC@ |
|---|
| 176 | LD = @CC@ |
|---|
| 177 | BUILD_CC = @BUILD_CC@ |
|---|
| 178 | BUILD_LD = @BUILD_CC@ |
|---|
| 179 | BUILD_CFLAGS = @BUILD_CFLAGS@ |
|---|
| 180 | BUILD_LDFLAGS = @BUILD_LDFLAGS@ |
|---|
| 181 | # make sure the srcdir include gets included first |
|---|
| 182 | CFLAGS = -I$(srcdir)/include @CFLAGS@ @CPPFLAGS@ |
|---|
| 183 | LDFLAGS = -L@BUILD_ABSOLUTE_TOP@/lib |
|---|
| 184 | LDFLAGS += @LDFLAGS@ |
|---|
| 185 | SERVER_LDFLAGS = -L@BUILD_ABSOLUTE_TOP@/lib |
|---|
| 186 | SERVER_LDFLAGS += @SERVER_LDFLAGS@ |
|---|
| 187 | DB_CFLAGS = @DB_CFLAGS@ |
|---|
| 188 | LDSHARED = $(CC) -shared |
|---|
| 189 | PICFLAGS = -fPIC |
|---|
| 190 | LIBS += -lpvfs2 @LIBS@ |
|---|
| 191 | LIBS_THREADED += -lpvfs2-threaded @LIBS@ |
|---|
| 192 | # need to include external dependency libs when building shared libraries |
|---|
| 193 | DEPLIBS := @LIBS@ |
|---|
| 194 | MMAP_RA_CACHE = @MMAP_RA_CACHE@ |
|---|
| 195 | TRUSTED_CONNECTIONS = @TRUSTED_CONNECTIONS@ |
|---|
| 196 | REDHAT_RELEASE = @REDHAT_RELEASE@ |
|---|
| 197 | NPTL_WORKAROUND = @NPTL_WORKAROUND@ |
|---|
| 198 | STRICT_CFLAGS = @STRICT_CFLAGS@ |
|---|
| 199 | SO_VER = @PVFS2_VERSION_MAJOR@ |
|---|
| 200 | SO_MINOR = @PVFS2_VERSION_MINOR@ |
|---|
| 201 | SO_RELEASE = @PVFS2_VERSION_SUB@ |
|---|
| 202 | SO_FULLVER = $(SO_VER).$(SO_MINOR).$(SO_RELEASE) |
|---|
| 203 | # for Solaris: |
|---|
| 204 | # LIBS += -lsocket -lnsl |
|---|
| 205 | |
|---|
| 206 | # enable Flow debugging protocol |
|---|
| 207 | #CFLAGS += -D__STATIC_FLOWPROTO_DUMP_OFFSETS__ |
|---|
| 208 | # enable new style Flow BMI/Trove protocol |
|---|
| 209 | CFLAGS += -D__STATIC_FLOWPROTO_MULTIQUEUE__ |
|---|
| 210 | # turn on large file support by default |
|---|
| 211 | CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE |
|---|
| 212 | # include current directory (for pvfs2-config.h) |
|---|
| 213 | CFLAGS += -I . |
|---|
| 214 | # include toplevel source dir |
|---|
| 215 | CFLAGS += -I $(srcdir) |
|---|
| 216 | # add selected include directories |
|---|
| 217 | CFLAGS += $(patsubst %,-I$(srcdir)/%,$(INCLUDES)) |
|---|
| 218 | CFLAGS += $(patsubst %,-I$(builddir)/%,$(GENINCLUDES)) |
|---|
| 219 | |
|---|
| 220 | # add package version information |
|---|
| 221 | CFLAGS += -DPVFS2_VERSION="\"@PVFS2_VERSION@\"" |
|---|
| 222 | |
|---|
| 223 | # always want these gcc flags |
|---|
| 224 | GCC_CFLAGS := -pipe -Wall -Wstrict-prototypes |
|---|
| 225 | |
|---|
| 226 | ifneq (,$(STRICT_CFLAGS)) |
|---|
| 227 | GCC_CFLAGS += -Wcast-align -Wbad-function-cast |
|---|
| 228 | GCC_CFLAGS += -Wmissing-prototypes -Wmissing-declarations |
|---|
| 229 | GCC_CFLAGS += -Wundef -Wpointer-arith |
|---|
| 230 | GCC_CFLAGS += -Wnested-externs |
|---|
| 231 | GCC_CFLAGS += -Wredundant-decls |
|---|
| 232 | # These are very noisy, and probably too strict. |
|---|
| 233 | #GCC_CFLAGS += -W -Wno-unused -Wno-sign-compare |
|---|
| 234 | #GCC_CFLAGS += -Wcast-qual |
|---|
| 235 | #GCC_CFLAGS += -Wshadow |
|---|
| 236 | #GCC_CFLAGS += -Wwrite-strings |
|---|
| 237 | endif |
|---|
| 238 | |
|---|
| 239 | # Intel cc options, enable all warnings, then disable some |
|---|
| 240 | INTEL_CFLAGS := -Wall |
|---|
| 241 | # #279: controlling expression is constant |
|---|
| 242 | # shows up in ifdefs such as "do { ... } while (0)" construct |
|---|
| 243 | INTEL_CFLAGS += -wd279 |
|---|
| 244 | # #424: extra ";" ignored e.g. in endecode_fields_2(); usage |
|---|
| 245 | INTEL_CFLAGS += -wd424 |
|---|
| 246 | # #188: enumerated type mixed with another type, like flag |= ENUM_VALUE; |
|---|
| 247 | # bogus compiler warning |
|---|
| 248 | INTEL_CFLAGS += -wd188 |
|---|
| 249 | # #981: operands are evaluated in unspecified order, like printf that |
|---|
| 250 | # uses functions to get some values; unimportant. |
|---|
| 251 | INTEL_CFLAGS += -wd981 |
|---|
| 252 | |
|---|
| 253 | # do not disable these if strict, i.e. enable some more warnings |
|---|
| 254 | ifeq (,$(STRICT_CFLAGS)) |
|---|
| 255 | # #1419: external declaration in primary source file; would be good |
|---|
| 256 | # to get rid of these someday |
|---|
| 257 | INTEL_CFLAGS += -wd1419 |
|---|
| 258 | # #1419: external definition with no prior declaration; most of these |
|---|
| 259 | # want to be static |
|---|
| 260 | INTEL_CFLAGS += -wd1418 |
|---|
| 261 | # #181: argument is incompatible with corresponding format string |
|---|
| 262 | # conversion; investigate someday. |
|---|
| 263 | INTEL_CFLAGS += -wd181 |
|---|
| 264 | # #869: parameter .. was never referenced, like -Wunused |
|---|
| 265 | INTEL_CFLAGS += -wd869 |
|---|
| 266 | # #810: conversion from .. to .. may lose significant bits; investigate |
|---|
| 267 | # but probably harmless |
|---|
| 268 | INTEL_CFLAGS += -wd810 |
|---|
| 269 | endif |
|---|
| 270 | |
|---|
| 271 | ################################################################ |
|---|
| 272 | # Setup component specific flags |
|---|
| 273 | |
|---|
| 274 | # the server can use a threaded trove and job configuration. |
|---|
| 275 | # Working combinations of trove/job thread configurations |
|---|
| 276 | # are as follows: |
|---|
| 277 | # |
|---|
| 278 | # NOTE: __PVFS2_TROVE_SUPPORT__, and __GEN_POSIX_LOCKING__ |
|---|
| 279 | # are required for all server configurations |
|---|
| 280 | # |
|---|
| 281 | # config 1) |
|---|
| 282 | # ========= |
|---|
| 283 | # __PVFS2_TROVE_THREADED__ |
|---|
| 284 | # __PVFS2_JOB_THREADED__ |
|---|
| 285 | # __PVFS2_TROVE_AIO_THREADED__ (auto detected MISC_TROVE_FLAGS) |
|---|
| 286 | # e.g. |
|---|
| 287 | # |
|---|
| 288 | #SERVERCFLAGS = -D__GEN_POSIX_LOCKING__ -D__PVFS2_JOB_THREADED__ \ |
|---|
| 289 | #-D__PVFS2_TROVE_THREADED__ @MISC_TROVE_FLAGS@ \ |
|---|
| 290 | #-D__PVFS2_TROVE_SUPPORT__ |
|---|
| 291 | # |
|---|
| 292 | # config 2) |
|---|
| 293 | # ========= |
|---|
| 294 | # __PVFS2_TROVE_THREADED__ |
|---|
| 295 | # __PVFS2_JOB_THREADED__ |
|---|
| 296 | # e.g. |
|---|
| 297 | # |
|---|
| 298 | #SERVERCFLAGS = -D__GEN_POSIX_LOCKING__ -D__PVFS2_JOB_THREADED__ \ |
|---|
| 299 | #-D__PVFS2_TROVE_THREADED__ -D__PVFS2_TROVE_SUPPORT__ |
|---|
| 300 | # |
|---|
| 301 | # config 3) |
|---|
| 302 | # ========= |
|---|
| 303 | # none (non-threaded) |
|---|
| 304 | # e.g. |
|---|
| 305 | # |
|---|
| 306 | #SERVERCFLAGS = -D__GEN_POSIX_LOCKING__ -D__PVFS2_TROVE_SUPPORT__ |
|---|
| 307 | |
|---|
| 308 | SERVERCFLAGS = @CFLAGS@ -D__GEN_POSIX_LOCKING__ -D__PVFS2_JOB_THREADED__ \ |
|---|
| 309 | -D__PVFS2_TROVE_THREADED__ @MISC_TROVE_FLAGS@ @DB_CFLAGS@ \ |
|---|
| 310 | -D__PVFS2_TROVE_SUPPORT__ -D__PVFS2_SERVER__ |
|---|
| 311 | |
|---|
| 312 | # server side flow protocol connecting BMI with NCAC cache |
|---|
| 313 | SERVERCFLAGS += -D__STATIC_FLOWPROTO_BMI_CACHE__ |
|---|
| 314 | |
|---|
| 315 | SERVERLIBS = -lpvfs2-server @LIBS@ @DB_LIB@ -lpthread |
|---|
| 316 | |
|---|
| 317 | ifdef NEEDS_LIBRT |
|---|
| 318 | SERVERLIBS += -lrt |
|---|
| 319 | endif |
|---|
| 320 | |
|---|
| 321 | # you can optionally disable thread safety support in the client |
|---|
| 322 | # though it's not recommended unless *required*. |
|---|
| 323 | # |
|---|
| 324 | # run ./configure --help for information on how to do this cleanly. |
|---|
| 325 | LIBCFLAGS=@LIBCFLAGS@ -D__PVFS2_CLIENT__ |
|---|
| 326 | LIBTHREADEDCFLAGS=-D__GEN_POSIX_LOCKING__ -D__PVFS2_JOB_THREADED__ -D__PVFS2_CLIENT__ |
|---|
| 327 | LIBS += @THREAD_LIB@ |
|---|
| 328 | DEPLIBS += @THREAD_LIB@ |
|---|
| 329 | LIBS_THREADED += @THREAD_LIB@ |
|---|
| 330 | |
|---|
| 331 | ################################################################ |
|---|
| 332 | # build BMI TCP? |
|---|
| 333 | |
|---|
| 334 | ifdef BUILD_BMI_TCP |
|---|
| 335 | CFLAGS += -D__STATIC_METHOD_BMI_TCP__ |
|---|
| 336 | endif |
|---|
| 337 | |
|---|
| 338 | |
|---|
| 339 | ################################################################ |
|---|
| 340 | # enable GM if configure detected it |
|---|
| 341 | |
|---|
| 342 | ifdef BUILD_GM |
|---|
| 343 | # other settings in bmi_gm/module.mk.in |
|---|
| 344 | CFLAGS += -D__STATIC_METHOD_BMI_GM__ |
|---|
| 345 | GMLIBS := -L@GM_LIBDIR@ -lgm |
|---|
| 346 | LIBS += $(GMLIBS) |
|---|
| 347 | DEPLIBS += $(GMLIBS) |
|---|
| 348 | LIBS_THREADED += $(GMLIBS) |
|---|
| 349 | SERVERLIBS += $(GMLIBS) |
|---|
| 350 | endif |
|---|
| 351 | |
|---|
| 352 | ################################################################ |
|---|
| 353 | # enable MX if configure detected it |
|---|
| 354 | |
|---|
| 355 | ifdef BUILD_MX |
|---|
| 356 | # other settings in bmi_mx/module.mk.in |
|---|
| 357 | CFLAGS += -D__STATIC_METHOD_BMI_MX__ |
|---|
| 358 | MXLIBS := -L@MX_LIBDIR@ -lmyriexpress -lpthread |
|---|
| 359 | LIBS += $(MXLIBS) |
|---|
| 360 | DEPLIBS += $(MXLIBS) |
|---|
| 361 | LIBS_THREADED += $(MXLIBS) |
|---|
| 362 | SERVERLIBS += $(MXLIBS) |
|---|
| 363 | endif |
|---|
| 364 | |
|---|
| 365 | ##################################### |
|---|
| 366 | # enable IB if configure requested it |
|---|
| 367 | |
|---|
| 368 | ifdef BUILD_IB |
|---|
| 369 | # other settings in bmi_ib/module.mk.in |
|---|
| 370 | CFLAGS += -D__STATIC_METHOD_BMI_IB__ |
|---|
| 371 | IBLIBS := -L@IB_LIBDIR@ \ |
|---|
| 372 | -lvapi -lmtl_common -lmosal -lmpga -lpthread -ldl |
|---|
| 373 | LIBS += $(IBLIBS) |
|---|
| 374 | DEPLIBS += $(IBLIBS) |
|---|
| 375 | LIBS_THREADED += $(IBLIBS) |
|---|
| 376 | SERVERLIBS += $(IBLIBS) |
|---|
| 377 | endif |
|---|
| 378 | |
|---|
| 379 | ifdef BUILD_OPENIB |
|---|
| 380 | ifndef BUILD_IB |
|---|
| 381 | CFLAGS += -D__STATIC_METHOD_BMI_IB__ |
|---|
| 382 | endif |
|---|
| 383 | OPENIBLIBS := -L@OPENIB_LIBDIR@ -libverbs |
|---|
| 384 | LIBS += $(OPENIBLIBS) |
|---|
| 385 | DEPLIBS += $(OPENIBLIBS) |
|---|
| 386 | LIBS_THREADED += $(OPENIBLIBS) |
|---|
| 387 | SERVERLIBS += $(OPENIBLIBS) |
|---|
| 388 | endif |
|---|
| 389 | |
|---|
| 390 | # Portals |
|---|
| 391 | ifdef BUILD_PORTALS |
|---|
| 392 | CFLAGS += -D__STATIC_METHOD_BMI_PORTALS__ |
|---|
| 393 | ifneq (,@PORTALS_LIBS@) |
|---|
| 394 | PORTALS_LIBS := @PORTALS_LIBS@ |
|---|
| 395 | LIBS += $(PORTALS_LIBS) |
|---|
| 396 | DEPLIBS += $(PORTALS_LIBS) |
|---|
| 397 | LIBS_THREADED += $(PORTALS_LIBS) |
|---|
| 398 | SERVERLIBS += $(PORTALS_LIBS) |
|---|
| 399 | endif |
|---|
| 400 | endif |
|---|
| 401 | |
|---|
| 402 | # enable mmap-readahead cache (unless disabled by configure) |
|---|
| 403 | ifdef MMAP_RA_CACHE |
|---|
| 404 | CFLAGS += @MMAP_RA_CACHE@ |
|---|
| 405 | endif |
|---|
| 406 | |
|---|
| 407 | # enable trusted connections (unless disabled by configure) |
|---|
| 408 | ifdef TRUSTED_CONNECTIONS |
|---|
| 409 | CFLAGS += @TRUSTED_CONNECTIONS@ |
|---|
| 410 | endif |
|---|
| 411 | |
|---|
| 412 | # enable redhat-release patches (if detected and if any) |
|---|
| 413 | ifdef REDHAT_RELEASE |
|---|
| 414 | CFLAGS += @REDHAT_RELEASE@ |
|---|
| 415 | endif |
|---|
| 416 | |
|---|
| 417 | # Add gcc-specific flags if we know it is a gnu compiler. |
|---|
| 418 | ifdef GNUC |
|---|
| 419 | CFLAGS += $(GCC_CFLAGS) |
|---|
| 420 | endif |
|---|
| 421 | ifdef INTELC |
|---|
| 422 | CFLAGS += $(INTEL_CFLAGS) |
|---|
| 423 | endif |
|---|
| 424 | |
|---|
| 425 | ################################################################# |
|---|
| 426 | # Starter variables |
|---|
| 427 | |
|---|
| 428 | # NOTES: These variables are used to categorize the various source |
|---|
| 429 | # files. We let the makefile includes append to them so that we |
|---|
| 430 | # gradually build up a list of source files without having to |
|---|
| 431 | # list them all at the top level. |
|---|
| 432 | |
|---|
| 433 | # ADMINSRC is source code for administrative programs |
|---|
| 434 | ADMINSRC := |
|---|
| 435 | # ADMINSRC_SERVER special version of ADMINSRC for tools that need server |
|---|
| 436 | # library |
|---|
| 437 | ADMINSRC_SERVER := |
|---|
| 438 | # usRSRC is source code for userland programs |
|---|
| 439 | USERSRC := |
|---|
| 440 | # LIBSRC is source code for libpvfs2 |
|---|
| 441 | LIBSRC := |
|---|
| 442 | # SERVERSRC is souce code for the pvfs2 server |
|---|
| 443 | SERVERSRC := |
|---|
| 444 | ifdef BUILD_BMI_ONLY |
|---|
| 445 | # LIBBMISRC is source code for libbmi |
|---|
| 446 | LIBBMISRC := |
|---|
| 447 | endif |
|---|
| 448 | # SERVERBINSRC is source files that don't get added to the server library but must be added to the server binary |
|---|
| 449 | SERVERBINSRC := |
|---|
| 450 | # DOCSRC is source code for documentation |
|---|
| 451 | DOCSRC := |
|---|
| 452 | # VISSRC is the source code for visualization tools |
|---|
| 453 | VISSRC := |
|---|
| 454 | # VISMISCSRC is a collection of sources that must be built into objects for |
|---|
| 455 | # visualization tools |
|---|
| 456 | VISMISCSRC := |
|---|
| 457 | # KARMASRC is source for the karma gui |
|---|
| 458 | KARMASRC := |
|---|
| 459 | # FUSESRC is source for the FUSE interface daemon |
|---|
| 460 | FUSESRC := |
|---|
| 461 | # userland helper programs for kernel drivers |
|---|
| 462 | KERNAPPSRC := |
|---|
| 463 | KERNAPPTHRSRC := |
|---|
| 464 | # MISCSRC are sources that don't fall into the other categories |
|---|
| 465 | MISCSRC := |
|---|
| 466 | # c files generated from state machines |
|---|
| 467 | SMCGEN := |
|---|
| 468 | |
|---|
| 469 | ################################################################ |
|---|
| 470 | # Top level (default) targets |
|---|
| 471 | |
|---|
| 472 | ifdef BUILD_SERVER |
|---|
| 473 | # SERVER_STUB is a wrapper script that export the LD_ASSUME_KERNEL variable for |
|---|
| 474 | # systems with buggy NPTL/Pthread implementations, such as early RedHat |
|---|
| 475 | # EL 3 distributions |
|---|
| 476 | SERVER_STUB := src/server/pvfs2-server-stub |
|---|
| 477 | # SERVER is the pvfs2 server |
|---|
| 478 | SERVER := src/server/pvfs2-server |
|---|
| 479 | endif |
|---|
| 480 | |
|---|
| 481 | # LIBRARIES is a list of the pvfs2 client libraries that will be installed |
|---|
| 482 | LIBRARIES := |
|---|
| 483 | ifdef BUILD_BMI_ONLY |
|---|
| 484 | BMILIBRARIES := |
|---|
| 485 | endif |
|---|
| 486 | LIBRARIES_THREADED := |
|---|
| 487 | ifeq ($(build_shared),yes) |
|---|
| 488 | ifdef BUILD_BMI_ONLY |
|---|
| 489 | BMILIBRARIES := lib/libbmi.so |
|---|
| 490 | endif |
|---|
| 491 | LIBRARIES_SHARED = lib/libpvfs2.so |
|---|
| 492 | LIBRARIES += $(LIBRARIES_SHARED) |
|---|
| 493 | LIBRARIES_THREADED_SHARED += lib/libpvfs2-threaded.so |
|---|
| 494 | LIBRARIES_THREADED += $(LIBRARIES_THREADED_SHARED) |
|---|
| 495 | endif |
|---|
| 496 | ifeq ($(build_static),yes) |
|---|
| 497 | ifdef BUILD_BMI_ONLY |
|---|
| 498 | BMILIBRARIES += lib/libbmi.a |
|---|
| 499 | endif |
|---|
| 500 | LIBRARIES_STATIC = lib/libpvfs2.a |
|---|
| 501 | LIBRARIES += $(LIBRARIES_STATIC) |
|---|
| 502 | LIBRARIES_THREADED_STATIC += lib/libpvfs2-threaded.a |
|---|
| 503 | LIBRARIES_THREADED += $(LIBRARIES_THREADED_STATIC) |
|---|
| 504 | endif |
|---|
| 505 | |
|---|
| 506 | ################################################################ |
|---|
| 507 | # Default target forward pointer, to avoid other targets in make stubs |
|---|
| 508 | all:: |
|---|
| 509 | |
|---|
| 510 | ################################################################ |
|---|
| 511 | # Makefile includes |
|---|
| 512 | |
|---|
| 513 | # this is how we pull build information from all of the project |
|---|
| 514 | # subdirectories, make sure to catch top level module.mk as well |
|---|
| 515 | include module.mk |
|---|
| 516 | include $(patsubst %, %/module.mk, $(MODULES)) |
|---|
| 517 | |
|---|
| 518 | ################################################################ |
|---|
| 519 | # Derived file lists |
|---|
| 520 | |
|---|
| 521 | # NOTES: At this point, the subdirectory makefile includes have informed |
|---|
| 522 | # us what the source files are. Now we want to generate some |
|---|
| 523 | # other lists (such as objects, executables, and dependency files) |
|---|
| 524 | # by manipulating the lists of source files |
|---|
| 525 | |
|---|
| 526 | # LIBOBJS is a list of objects to put in the client lib |
|---|
| 527 | LIBOBJS := $(patsubst %.c,%.o, $(filter %.c,$(LIBSRC))) |
|---|
| 528 | # LIBPICOBJS are the same, but compiled for use in a shared library |
|---|
| 529 | LIBPICOBJS := $(patsubst %.c,%.po, $(filter %.c,$(LIBSRC))) |
|---|
| 530 | # LIBDEPENDS is a list of dependency files for the client lib |
|---|
| 531 | LIBDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(LIBSRC))) |
|---|
| 532 | |
|---|
| 533 | ifdef BUILD_BMI_ONLY |
|---|
| 534 | # LIBBMIOBJS is a list of objects to put in the bmi lib |
|---|
| 535 | LIBBMIOBJS := $(patsubst %.c,%.o, $(filter %.c,$(LIBBMISRC))) |
|---|
| 536 | # LIBBMIPICOBJS are the same, but compiled for use in a shared library |
|---|
| 537 | LIBBMIPICOBJS := $(patsubst %.c,%.po, $(filter %.c,$(LIBBMISRC))) |
|---|
| 538 | # LIBBMIDEPENDS is a list of dependency files for the bmi lib |
|---|
| 539 | LIBBMIDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(LIBBMISRC))) |
|---|
| 540 | endif |
|---|
| 541 | |
|---|
| 542 | # LIBTHREADEDOBJS is a list of objects to put in the multithreaded client lib |
|---|
| 543 | LIBTHREADEDOBJS := $(patsubst %.c,%-threaded.o, $(filter %.c,$(LIBSRC))) |
|---|
| 544 | # LIBTHREADEDPICOBJS are the same, but compiled for use in a shared library |
|---|
| 545 | LIBTHREADEDPICOBJS := $(patsubst %.c,%-threaded.po, $(filter %.c,$(LIBSRC))) |
|---|
| 546 | # LIBTHREADEDDEPENDS is a list of dependency files for the multithreaded client lib |
|---|
| 547 | LIBTHREADEDDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(LIBSRC))) |
|---|
| 548 | # ADMINOBJS is a list of admin program objects |
|---|
| 549 | ADMINOBJS := $(patsubst %.c,%.o, $(filter %.c,$(ADMINSRC))) |
|---|
| 550 | # ADMINTOOLS is a list of admin program executables |
|---|
| 551 | ADMINTOOLS := $(patsubst %.c,%, $(filter %.c, $(ADMINSRC))) |
|---|
| 552 | # ADMINDEPENDS is a list of dependency files for admin programs |
|---|
| 553 | ADMINDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(ADMINSRC))) |
|---|
| 554 | # |
|---|
| 555 | # USEROBJS is a list of user program objects |
|---|
| 556 | USEROBJS := $(patsubst %.c,%.o, $(filter %.c,$(USERSRC))) |
|---|
| 557 | # USERTOOLS is a list of user program executables |
|---|
| 558 | USERTOOLS := $(patsubst %.c,%, $(filter %.c, $(USERSRC))) |
|---|
| 559 | # USERDEPENDS is a list of dependency files for user programs |
|---|
| 560 | USERDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(USERSRC))) |
|---|
| 561 | |
|---|
| 562 | ifdef BUILD_SERVER |
|---|
| 563 | ADMINOBJS_SERVER := $(patsubst %.c,%.o, $(filter %.c,$(ADMINSRC_SERVER))) |
|---|
| 564 | ADMINTOOLS_SERVER := $(patsubst %.c,%, $(filter %.c, $(ADMINSRC_SERVER))) |
|---|
| 565 | ADMINDEPENDS_SERVER := $(patsubst %.c,%.d, $(filter %.c,$(ADMINSRC_SERVER))) |
|---|
| 566 | # SERVEROBJS is a list of objects to put into the server |
|---|
| 567 | SERVEROBJS := $(patsubst %.c,%-server.o, $(filter %.c,$(SERVERSRC))) |
|---|
| 568 | # SERVERDEPENDS is a list of dependency files for the server |
|---|
| 569 | SERVERDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(SERVERSRC))) |
|---|
| 570 | # SERVERBINOBJS is a list of objects not in SERVEROBJS to put into the server |
|---|
| 571 | SERVERBINOBJS := $(patsubst %.c,%-server.o, $(filter %.c,$(SERVERBINSRC))) |
|---|
| 572 | SERVERBINDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(SERVERBINSRC))) |
|---|
| 573 | endif |
|---|
| 574 | |
|---|
| 575 | # MISCOBJS is a list of misc. objects not in the above categories |
|---|
| 576 | MISCOBJS := $(patsubst %.c,%.o, $(filter %.c,$(MISCSRC))) |
|---|
| 577 | # MISCDEPENDS is a list of dependency files for misc. objects |
|---|
| 578 | MISCDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(MISCSRC))) |
|---|
| 579 | |
|---|
| 580 | # KERNAPPOBJS is a list of kernel driver userland objects |
|---|
| 581 | KERNAPPOBJS := $(patsubst %.c,%.o, $(filter %.c,$(KERNAPPSRC))) \ |
|---|
| 582 | $(patsubst %.c,%-threaded.o, $(filter %.c,$(KERNAPPTHRSRC))) |
|---|
| 583 | # KERNAPPS is a list of kernel driver userland executables |
|---|
| 584 | KERNAPPS := $(patsubst %.c,%, $(filter %.c, $(KERNAPPSRC))) |
|---|
| 585 | KERNAPPSTHR := $(patsubst %.c,%, $(filter %.c, $(KERNAPPTHRSRC))) |
|---|
| 586 | # KERNAPPDEPENDS is a list of dependency files for kernel driver userland |
|---|
| 587 | # objects |
|---|
| 588 | KERNAPPDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(KERNAPPSRC) $(KERNAPPTHRSRC))) |
|---|
| 589 | # Be sure to build/install the threaded lib too; just pick the shared |
|---|
| 590 | # one if configure asked for both. |
|---|
| 591 | ifneq (,$(KERNAPPSTHR)) |
|---|
| 592 | ifeq (,$(filter $(firstword $(LIBRARIES_THREADED)),$(LIBRARIES))) |
|---|
| 593 | LIBRARIES += $(firstword $(LIBRARIES_THREADED)) |
|---|
| 594 | endif |
|---|
| 595 | endif |
|---|
| 596 | |
|---|
| 597 | # VISOBJS is a list of visualization program objects |
|---|
| 598 | VISOBJS := $(patsubst %.c,%.o, $(filter %.c,$(VISSRC))) |
|---|
| 599 | # VISS is a list of visualization program executables |
|---|
| 600 | VISS := $(patsubst %.c,%, $(filter %.c, $(VISSRC))) |
|---|
| 601 | # VISDEPENDS is a list of dependency files for visualization programs |
|---|
| 602 | VISDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(VISSRC))) |
|---|
| 603 | # VISMISCOBJS is a list of misc. vis objects not in the above categories |
|---|
| 604 | VISMISCOBJS := $(patsubst %.c,%.o, $(filter %.c,$(VISMISCSRC))) |
|---|
| 605 | # VISMISCDEPENDS is a list of dependency files for vis misc. objects |
|---|
| 606 | VISMISCDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(VISMISCSRC))) |
|---|
| 607 | |
|---|
| 608 | # KARMAOBJS, KARMADEPENDS for the karma gui (requires gtk2.0) |
|---|
| 609 | KARMAOBJS := $(patsubst %.c,%.o, $(filter %.c,$(KARMASRC))) |
|---|
| 610 | KARMADEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(KARMASRC))) |
|---|
| 611 | |
|---|
| 612 | # FUSEOBJS |
|---|
| 613 | FUSEOBJS := $(patsubst %.c,%.o, $(filter %.c,$(FUSESRC))) |
|---|
| 614 | FUSEDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(FUSESRC))) |
|---|
| 615 | |
|---|
| 616 | # state machine generation tool, built for the build machine, not the |
|---|
| 617 | # host machine, in the case of cross-compilation |
|---|
| 618 | STATECOMPOBJS := $(patsubst %.c,%.o,$(STATECOMPSRC)) |
|---|
| 619 | STATECOMPDEPS := $(patsubst %.c,%.d,$(STATECOMPSRC)) |
|---|
| 620 | |
|---|
| 621 | # DOCSPDF, DOCSPS, and DOCSHTML are lists of documentation files generated |
|---|
| 622 | # from latex |
|---|
| 623 | DOCSPDF := $(patsubst %.tex,%.pdf, $(filter %.tex,$(DOCSRC))) |
|---|
| 624 | DOCSPS := $(patsubst %.tex,%.ps, $(filter %.tex,$(DOCSRC))) |
|---|
| 625 | DOCSHTML := $(patsubst %.tex,%.html, $(filter %.tex,$(DOCSRC))) |
|---|
| 626 | |
|---|
| 627 | # DOCSCRUFT is a list of intermediate files generated by latex |
|---|
| 628 | DOCSCRUFT := $(patsubst %.tex,%.aux, $(filter %.tex,$(DOCSRC))) |
|---|
| 629 | DOCSCRUFT += $(patsubst %.tex,%.dvi, $(filter %.tex,$(DOCSRC))) |
|---|
| 630 | DOCSCRUFT += $(patsubst %.tex,%.log, $(filter %.tex,$(DOCSRC))) |
|---|
| 631 | DOCSCRUFT += $(patsubst %.tex,%.toc, $(filter %.tex,$(DOCSRC))) |
|---|
| 632 | |
|---|
| 633 | # DEPENDS is a global list of all of our dependency files. |
|---|
| 634 | # NOTE: sort is just a trick to remove duplicates; the order |
|---|
| 635 | # doesn't matter at all. |
|---|
| 636 | ifdef BUILD_BMI_ONLY |
|---|
| 637 | DEPENDS := $(sort $(LIBBMIDEPENDS)) |
|---|
| 638 | else |
|---|
| 639 | DEPENDS := $(sort $(LIBDEPENDS) $(SERVERDEPENDS) $(SERVERBINDEPENDS) \ |
|---|
| 640 | $(MISCDEPENDS) $(USERDEPENDS) \ |
|---|
| 641 | $(ADMINDEPENDS) $(ADMINDEPENDS_SERVER) $(KERNAPPDEPENDS) $(VISDEPENDS) \ |
|---|
| 642 | $(VISMISCDEPENDS) $(KARMADEPENDS) $(STATECOMPDEPS) $(FUSEDEPENDS)) |
|---|
| 643 | endif |
|---|
| 644 | |
|---|
| 645 | #################################################################### |
|---|
| 646 | # Rules and dependencies |
|---|
| 647 | |
|---|
| 648 | # default rule builds server, library, and applications |
|---|
| 649 | ifdef BUILD_BMI_ONLY |
|---|
| 650 | all:: $(BMILIBRARIES) |
|---|
| 651 | else |
|---|
| 652 | all:: $(SERVER) $(KARMA) $(LIBRARIES) admintools usertools $(VISS) $(KARMA) $(FUSE) |
|---|
| 653 | endif |
|---|
| 654 | |
|---|
| 655 | # target for building admin tools |
|---|
| 656 | admintools: $(ADMINTOOLS) $(ADMINTOOLS_SERVER) |
|---|
| 657 | |
|---|
| 658 | #target for building user tools |
|---|
| 659 | usertools: $(USERTOOLS) |
|---|
| 660 | |
|---|
| 661 | # target for building kernel driver userland programs |
|---|
| 662 | kernapps: $(KERNAPPS) $(KERNAPPSTHR) |
|---|
| 663 | |
|---|
| 664 | # this is needed for the make dist |
|---|
| 665 | statecompgen: $(STATECOMPGEN) |
|---|
| 666 | |
|---|
| 667 | # Build linux-2.6 kernel module if requested. |
|---|
| 668 | # Can't use the actual file target since we don't know how to figure out |
|---|
| 669 | # dependencies---only the kernel source tree can do that. |
|---|
| 670 | ifneq (,$(LINUX_KERNEL_SRC)) |
|---|
| 671 | .PHONY: kmod |
|---|
| 672 | kmod: just_kmod kernapps |
|---|
| 673 | just_kmod: |
|---|
| 674 | @$(MAKE) --no-print-directory -C src/kernel/linux-2.6 |
|---|
| 675 | endif |
|---|
| 676 | |
|---|
| 677 | # Build linux-2.4 kernel module if requested. |
|---|
| 678 | ifneq (,$(LINUX24_KERNEL_SRC)) |
|---|
| 679 | .PHONY: kmod24 |
|---|
| 680 | kmod24: just_kmod24 kernapps |
|---|
| 681 | just_kmod24: |
|---|
| 682 | @$(MAKE) --no-print-directory -C src/kernel/linux-2.4 |
|---|
| 683 | endif |
|---|
| 684 | |
|---|
| 685 | # Just like dir, but strip the slash off the end, to be pretty. |
|---|
| 686 | dirname = $(patsubst %/,%,$(dir $(1))) |
|---|
| 687 | |
|---|
| 688 | # Generate the canonical in-tree location of a file, given a possibly |
|---|
| 689 | # out-of-tree reference. |
|---|
| 690 | canonname = $(patsubst $(srcdir)/%,%,$(call dirname,$(1))) |
|---|
| 691 | |
|---|
| 692 | # Grab any CFLAGS defined by the make stub for a particular file, and |
|---|
| 693 | # for the directory in which the source resides. |
|---|
| 694 | # Always add the source directory in question for "local" includes. |
|---|
| 695 | # Similar for ldflags. |
|---|
| 696 | modcflags = $(MODCFLAGS_$(call canonname,$(1))) \ |
|---|
| 697 | $(MODCFLAGS_$(patsubst $(srcdir)/%,%,$(1))) \ |
|---|
| 698 | -I$(srcdir)/$(call dirname,$(1)) |
|---|
| 699 | modldflags = $(MODLDFLAGS_$(call canonname,$(1))) \ |
|---|
| 700 | $(MODLDFLAGS_$(patsubst $(srcdir)/%,%,$(1))) |
|---|
| 701 | |
|---|
| 702 | # note: this will look better if you use two tabs instead of spaces between |
|---|
| 703 | # SHORT_NAME and the object |
|---|
| 704 | |
|---|
| 705 | # rule for building the pvfs2 server |
|---|
| 706 | $(SERVER): $(SERVERBINOBJS) lib/libpvfs2-server.a |
|---|
| 707 | $(Q) " LD $@" |
|---|
| 708 | $(E)$(LD) $^ -o $@ $(SERVER_LDFLAGS) $(SERVERLIBS) |
|---|
| 709 | |
|---|
| 710 | # special rules for admin tool objects which also require server components |
|---|
| 711 | $(ADMINOBJS_SERVER): %.o: %.c |
|---|
| 712 | $(Q) " CC $@" |
|---|
| 713 | $(E) $(CC) $(CFLAGS) $(SERVERCFLAGS) $(call modcflags,$<) $< -c -o $@ |
|---|
| 714 | |
|---|
| 715 | # special rules for admin tools which also require server components |
|---|
| 716 | $(ADMINTOOLS_SERVER): %: %.o |
|---|
| 717 | $(Q) " LD $@" |
|---|
| 718 | $(E)$(LD) $< $(LDFLAGS) $(SERVER_LDFLAGS) $(SERVERLIBS) -o $@ |
|---|
| 719 | |
|---|
| 720 | ifdef BUILD_BMI_ONLY |
|---|
| 721 | # rule for building the bmi library |
|---|
| 722 | lib/libbmi.a: $(LIBBMIOBJS) |
|---|
| 723 | $(Q) " RANLIB $@" |
|---|
| 724 | $(E)$(INSTALL) -d lib |
|---|
| 725 | $(E)ar rcs $@ $(LIBBMIOBJS) |
|---|
| 726 | |
|---|
| 727 | # rule for building the shared bmi library |
|---|
| 728 | lib/libbmi.so: $(LIBBMIPICOBJS) |
|---|
| 729 | $(Q) " LDSO $@" |
|---|
| 730 | $(E)$(INSTALL) -d lib |
|---|
| 731 | $(E)$(LDSHARED) -Wl,-soname,libbmi.so -o $@ $(LIBBMIPICOBJS) $(DEPLIBS) |
|---|
| 732 | endif |
|---|
| 733 | |
|---|
| 734 | # rule for building the pvfs2 library |
|---|
| 735 | lib/libpvfs2.a: $(LIBOBJS) |
|---|
| 736 | $(Q) " RANLIB $@" |
|---|
| 737 | $(E)$(INSTALL) -d lib |
|---|
| 738 | $(E)ar rcs $@ $(LIBOBJS) |
|---|
| 739 | |
|---|
| 740 | # rule for building the _multithreaded_ pvfs2 library |
|---|
| 741 | lib/libpvfs2-threaded.a: $(LIBTHREADEDOBJS) |
|---|
| 742 | $(Q) " RANLIBTHREADED $@" |
|---|
| 743 | $(E)$(INSTALL) -d lib |
|---|
| 744 | $(E)ar rcs $@ $(LIBTHREADEDOBJS) |
|---|
| 745 | |
|---|
| 746 | # rule for building the pvfs2 library |
|---|
| 747 | lib/libpvfs2.so: $(LIBPICOBJS) |
|---|
| 748 | $(Q) " LDSO $@" |
|---|
| 749 | $(E)$(INSTALL) -d lib |
|---|
| 750 | $(E)$(LDSHARED) -Wl,-soname,libpvfs2.so -o $@ $(LIBPICOBJS) $(DEPLIBS) |
|---|
| 751 | |
|---|
| 752 | # rule for building the pvfs2 _multithreaded_ library |
|---|
| 753 | lib/libpvfs2-threaded.so: $(LIBTHREADEDPICOBJS) |
|---|
| 754 | $(Q) " LDSO $@" |
|---|
| 755 | $(E)$(INSTALL) -d lib |
|---|
| 756 | $(E)$(LDSHARED) -Wl,-soname,libpvfs2-threaded.so -o $@ $(LIBTHREADEDPICOBJS) $(DEPLIBS) |
|---|
| 757 | |
|---|
| 758 | # rule for building the pvfs2 server library |
|---|
| 759 | lib/libpvfs2-server.a: $(SERVEROBJS) |
|---|
| 760 | $(Q) " RANLIB $@" |
|---|
| 761 | $(E)$(INSTALL) -d lib |
|---|
| 762 | $(E)ar rcs $@ $(SERVEROBJS) |
|---|
| 763 | |
|---|
| 764 | # rule for building karma gui and its objects |
|---|
| 765 | $(KARMA): $(KARMAOBJS) $(LIBRARIES) |
|---|
| 766 | $(Q) " LD $@" |
|---|
| 767 | $(E)$(LD) -o $@ $(LDFLAGS) $(KARMAOBJS) $(LIBS) $(call modldflags,$<) |
|---|
| 768 | |
|---|
| 769 | # fule for building FUSE interface and its objects |
|---|
| 770 | $(FUSE): $(FUSEOBJS) $(LIBRARIES) |
|---|
| 771 | $(Q) " LD $@" |
|---|
| 772 | $(E)$(LD) -o $@ $(LDFLAGS) $(FUSEOBJS) $(LIBS) $(call modldflags,$<) |
|---|
| 773 | |
|---|
| 774 | # rule for building vis executables from object files |
|---|
| 775 | $(VISS): %: %.o $(VISMISCOBJS) $(LIBRARIES) |
|---|
| 776 | $(Q) " LD $@" |
|---|
| 777 | $(E)$(LD) -o $@ $(LDFLAGS) $< $(VISMISCOBJS) $(LIBS) $(call modldflags,$<) |
|---|
| 778 | |
|---|
| 779 | # default rule for building executables from object files |
|---|
| 780 | %: %.o $(LIBRARIES) |
|---|
| 781 | $(Q) " LD $@" |
|---|
| 782 | $(E)$(LD) -o $@ $(LDFLAGS) $< $(LIBS) $(call modldflags,$<) |
|---|
| 783 | |
|---|
| 784 | %-threaded: %.o $(LIBRARIES) |
|---|
| 785 | $(Q) " LD $@" |
|---|
| 786 | $(E)$(LD) -o $@ $(LDFLAGS) $< $(LIBS_THREADED) $(call modldflags,$<) |
|---|
| 787 | |
|---|
| 788 | # rule for building server objects |
|---|
| 789 | %-server.o: %.c |
|---|
| 790 | $(Q) " CC $@" |
|---|
| 791 | $(E)$(CC) $(CFLAGS) $(SERVERCFLAGS) $(call modcflags,$<) $< -c -o $@ |
|---|
| 792 | |
|---|
| 793 | # default rule for building objects for threaded library |
|---|
| 794 | %-threaded.o: %.c |
|---|
| 795 | $(Q) " CC $@" |
|---|
| 796 | $(E)$(CC) $(LIBTHREADEDCFLAGS) $(LIBCFLAGS) $(CFLAGS) $(call modcflags,$<) $< -c -o $@ |
|---|
| 797 | |
|---|
| 798 | # rule for building shared objects for threaded library |
|---|
| 799 | %-threaded.po: %.c |
|---|
| 800 | $(Q) " CCPIC $@" |
|---|
| 801 | $(E)$(CC) $(LIBTHREADEDCFLAGS) $(CFLAGS) $(PICFLAGS) $(call modcflags,$<) $< -c -o $@ |
|---|
| 802 | |
|---|
| 803 | # default rule for building objects |
|---|
| 804 | %.o: %.c |
|---|
| 805 | $(Q) " CC $@" |
|---|
| 806 | $(E)$(CC) $(LIBCFLAGS) $(CFLAGS) $(call modcflags,$<) $< -c -o $@ |
|---|
| 807 | |
|---|
| 808 | # rule for building shared objects |
|---|
| 809 | %.po: %.c |
|---|
| 810 | $(Q) " CCPIC $@" |
|---|
| 811 | $(E)$(CC) $(LIBCFLAGS) $(CFLAGS) $(PICFLAGS) $(call modcflags,$<) $< -c -o $@ |
|---|
| 812 | |
|---|
| 813 | # c++ rule for building server objects |
|---|
| 814 | %-server.o: %.cpp |
|---|
| 815 | $(Q) " CC $@" |
|---|
| 816 | $(E)$(CC) $(CFLAGS) $(SERVERCFLAGS) $(call modcflags,$<) $< -c -o $@ |
|---|
| 817 | |
|---|
| 818 | # c++ default rule for building objects for threaded library |
|---|
| 819 | %-threaded.o: %.cpp |
|---|
| 820 | $(Q) " CC $@" |
|---|
| 821 | $(E)$(CC) $(LIBTHREADEDCFLAGS) $(LIBCFLAGS) $(CFLAGS) $(call modcflags,$<) $< -c -o $@ |
|---|
| 822 | |
|---|
| 823 | # c++ rule for building shared objects for threaded library |
|---|
| 824 | %-threaded.po: %.cpp |
|---|
| 825 | $(Q) " CCPIC $@" |
|---|
| 826 | $(E)$(CC) $(LIBTHREADEDCFLAGS) $(CFLAGS) $(PICFLAGS) $(call modcflags,$<) $< -c -o $@ |
|---|
| 827 | |
|---|
| 828 | # c++ default rule for building objects |
|---|
| 829 | %.o: %.cpp |
|---|
| 830 | $(Q) " CC $@" |
|---|
| 831 | $(E)$(CC) $(LIBCFLAGS) $(CFLAGS) $(call modcflags,$<) $< -c -o $@ |
|---|
| 832 | |
|---|
| 833 | # c++ rule for building shared objects |
|---|
| 834 | %.po: %.cpp |
|---|
| 835 | $(Q) " CCPIC $@" |
|---|
| 836 | $(E)$(CC) $(LIBCFLAGS) $(CFLAGS) $(PICFLAGS) $(call modcflags,$<) $< -c -o $@ |
|---|
| 837 | |
|---|
| 838 | # bison and yacc |
|---|
| 839 | %.c: %.y |
|---|
| 840 | $(Q) " BISON $@" |
|---|
| 841 | $(E)$(BISON) -d $< -o $@ |
|---|
| 842 | |
|---|
| 843 | %.c: %.l |
|---|
| 844 | $(Q) " FLEX $@" |
|---|
| 845 | $(E)$(FLEX) -o$@ $< |
|---|
| 846 | |
|---|
| 847 | # handy rule to generate cpp-output file, for debugging |
|---|
| 848 | .PHONY: FORCE |
|---|
| 849 | %-server.i: %.c FORCE |
|---|
| 850 | $(Q) " CPP $@" |
|---|
| 851 | $(E)$(CC) $(CFLAGS) $(SERVERCFLAGS) $(call modcflags,$<) $< -E -o $@ |
|---|
| 852 | |
|---|
| 853 | %.i: %.c FORCE |
|---|
| 854 | $(Q) " CPP $@" |
|---|
| 855 | $(E)$(CC) $(LIBCFLAGS) $(CFLAGS) $(call modcflags,$<) $< -E -o $@ |
|---|
| 856 | |
|---|
| 857 | %-threaded.i: %.c FORCE |
|---|
| 858 | $(Q) " CPP $@" |
|---|
| 859 | $(E)$(CC) $(LIBTHREADEDCFLAGS) $(CFLAGS) $(call modcflags,$<) $< -E -o $@ |
|---|
| 860 | |
|---|
| 861 | # all applications depend on the pvfs2 library |
|---|
| 862 | $(ADMINTOOLS): %: %.o $(LIBRARIES) |
|---|
| 863 | $(ADMINTOOLS_SERVER): %: %.o $(LIBRARIES) lib/libpvfs2-server.a |
|---|
| 864 | |
|---|
| 865 | $(USERTOOLS): %: %.o $(LIBRARIES) |
|---|
| 866 | |
|---|
| 867 | $(KERNAPPS): %: %.o $(LIBRARIES) |
|---|
| 868 | $(KERNAPPSTHR): %: %.o $(LIBRARIES_THREADED) |
|---|
| 869 | $(Q) " LD $@" |
|---|
| 870 | $(E)$(LD) -o $@ $(LDFLAGS) $< $(LIBS_THREADED) $(call modldflags,$<) |
|---|
| 871 | |
|---|
| 872 | # special rules to build state machine compiler using build host compiler |
|---|
| 873 | $(STATECOMPOBJS): %.o: %.c |
|---|
| 874 | $(Q) " BUILD_CC $@" |
|---|
| 875 | $(E)$(BUILD_CC) $(BUILD_CFLAGS) $< -c -o $@ $(call modcflags,$<) |
|---|
| 876 | |
|---|
| 877 | $(STATECOMP): $(STATECOMPOBJS) |
|---|
| 878 | $(Q) " BUILD_LD $@" |
|---|
| 879 | $(E)$(BUILD_LD) -o $@ $(BUILD_LDFLAGS) $(STATECOMPOBJS) $(call modldflags,$<) |
|---|
| 880 | |
|---|
| 881 | # rule for generating cscope information |
|---|
| 882 | cscope: |
|---|
| 883 | find @SRC_ABSOLUTE_TOP@ -iname "*.[ch]" -o -iname "*.sm" \ |
|---|
| 884 | > $(srcdir)/cscope.files |
|---|
| 885 | ( cd @SRC_ABSOLUTE_TOP@; cscope -be -i @SRC_ABSOLUTE_TOP@/cscope.files ) |
|---|
| 886 | |
|---|
| 887 | # Build editor tags file over all source files *.[ch] *.sm and |
|---|
| 888 | # some known scripts. Grab the config files from the build dir. |
|---|
| 889 | # Ignore all generated C files by echoing them and trusting uniq to |
|---|
| 890 | # throw away the duplicates. Echo them twice so they do not survive |
|---|
| 891 | # uniq for out-of-tree builds. |
|---|
| 892 | tags: |
|---|
| 893 | ( find $(addprefix $(srcdir)/,$(MODULES)) $(srcdir)/include \ |
|---|
| 894 | $(srcdir)/src/kernel/linux-2.6 \ |
|---|
| 895 | -maxdepth 1 -name '*.[ch]' -o -name '*.sm' ;\ |
|---|
| 896 | find . -maxdepth 1 -name pvfs2-config.h ;\ |
|---|
| 897 | echo $(srcdir)/src/apps/admin/pvfs2-genconfig ;\ |
|---|
| 898 | echo $(patsubst %,./%,$(SMCGEN) $(SMCGEN)) | tr ' ' '\012' ;\ |
|---|
| 899 | ) | sort | uniq -u | ctags -L- --excmd=pattern -B --extra=+f \ |
|---|
| 900 | --langmap=c:+.sm -I __hidden,DOTCONF_CB,nested,machine=struct |
|---|
| 901 | |
|---|
| 902 | # rule for running code check |
|---|
| 903 | codecheck: |
|---|
| 904 | find $(srcdir) -iname "*.[ch]" | xargs -n 1 $(srcdir)/maint/pvfs2codecheck.pl |
|---|
| 905 | |
|---|
| 906 | # target for building documentation |
|---|
| 907 | docs: $(DOCSPS) $(DOCSPDF) $(DOCSHTML) |
|---|
| 908 | |
|---|
| 909 | publish: docs |
|---|
| 910 | $(srcdir)/maint/pvfs2-publish-pages `pwd`/doc |
|---|
| 911 | |
|---|
| 912 | # rule for cleaning up documentation |
|---|
| 913 | # latex2html puts all its output in a directory |
|---|
| 914 | # don't get rid of generated files in dist releases |
|---|
| 915 | docsclean: |
|---|
| 916 | rm -f $(DOCSCRUFT) |
|---|
| 917 | ifndef DIST_RELEASE |
|---|
| 918 | rm -f $(DOCSPS) $(DOCSPDF) |
|---|
| 919 | rm -rf $(basename $(DOCSHTML)) |
|---|
| 920 | endif |
|---|
| 921 | |
|---|
| 922 | # top rule for cleaning up tree |
|---|
| 923 | clean:: |
|---|
| 924 | $(Q) " CLEAN" |
|---|
| 925 | $(E)rm -f $(LIBOBJS) $(LIBTHREADEDOBJS) \ |
|---|
| 926 | $(SERVEROBJS) $(SERVERBINOBJS) $(MISCOBJS) \ |
|---|
| 927 | $(LIBRARIES) $(LIBRARIES_THREADED) $(DEPENDS) $(SERVER) \ |
|---|
| 928 | $(ADMINOBJS) $(ADMINOBJS_SERVER) $(ADMINTOOLS)\ |
|---|
| 929 | $(ADMINTOOLS_SERVER) lib/libpvfs2-server.a\ |
|---|
| 930 | $(USERTOOLS) $(USEROBJS) \ |
|---|
| 931 | $(KERNAPPOBJS) $(KERNAPPS) $(KERNAPPSTHR) \ |
|---|
| 932 | $(VISS) $(VISMISCOBJS) $(VISOBJS) $(VISDEPENDS)\ |
|---|
| 933 | $(VISMISCDEPENDS) $(KARMAOBJS) $(LIBPICOBJS) \ |
|---|
| 934 | $(STATECOMP) $(STATECOMPOBJS) $(LIBBMIOBJS) $(BMILIBRARIES) $(FUSEOBJS) \ |
|---|
| 935 | $(VISMISCDEPENDS) $(KARMAOBJS) $(LIBPICOBJS)\ |
|---|
| 936 | $(STATECOMP) $(STATECOMPOBJS) \ |
|---|
| 937 | src/server/pvfs2-server-server.o \ |
|---|
| 938 | src/apps/karma/karma src/apps/fuse/pvfs2fuse |
|---|
| 939 | ifndef DIST_RELEASE |
|---|
| 940 | $(E)rm -f $(STATECOMPGEN) |
|---|
| 941 | endif |
|---|
| 942 | |
|---|
| 943 | ifneq (,$(LINUX_KERNEL_SRC)) |
|---|
| 944 | clean:: |
|---|
| 945 | @$(MAKE) --no-print-directory -C src/kernel/linux-2.6 clean |
|---|
| 946 | endif |
|---|
| 947 | |
|---|
| 948 | ifneq (,$(LINUX24_KERNEL_SRC)) |
|---|
| 949 | clean:: |
|---|
| 950 | @$(MAKE) --no-print-directory -C src/kernel/linux-2.4 clean |
|---|
| 951 | endif |
|---|
| 952 | |
|---|
| 953 | # builds a tarball of the source tree suitable for distribution |
|---|
| 954 | dist: $(SMCGEN) cleaner |
|---|
| 955 | @sh $(srcdir)/maint/make-dist.sh $(srcdir) @PVFS2_VERSION@ |
|---|
| 956 | |
|---|
| 957 | ifdef BUILD_BMI_ONLY |
|---|
| 958 | # builds a tarball of the BMI source tree suitable for distribution |
|---|
| 959 | bmidist: cleaner |
|---|
| 960 | @sh $(srcdir)/maint/make-bmi-dist.sh $(srcdir) $(builddir) @PVFS2_VERSION@ |
|---|
| 961 | cp -u $(builddir)/config.save $(builddir)/config.status |
|---|
| 962 | endif |
|---|
| 963 | |
|---|
| 964 | # some stuff that is cleaned in both distclean and dist targets |
|---|
| 965 | cleaner: clean |
|---|
| 966 | rm -f tags |
|---|
| 967 | rm -f src/kernel/linux-2.6/Makefile |
|---|
| 968 | rm -f src/kernel/linux-2.4/Makefile |
|---|
| 969 | rm -f maint/mpi-depend.sh |
|---|
| 970 | rm -f examples/pvfs2-server.rc |
|---|
| 971 | rm -f doc/doxygen/pvfs2-doxygen.conf |
|---|
| 972 | rm -f examples/fs.conf |
|---|
| 973 | rm -rf autom4te*.cache |
|---|
| 974 | rm -f pvfs2-config.h.in~ |
|---|
| 975 | rm -f $(srcdir)/cscope.out $(srcdir)/cscope.files |
|---|
| 976 | cp -p config.status config.save |
|---|
| 977 | rm -f config.log config.status config.cache |
|---|
| 978 | rm -f pvfs-@PVFS2_VERSION@.tar.gz |
|---|
| 979 | |
|---|
| 980 | # _really_ clean the tree; should go back to pristine state |
|---|
| 981 | # except, don't remove generated .c files if this is a distributed release |
|---|
| 982 | distclean: cleaner docsclean |
|---|
| 983 | find . -name "module.mk" -exec rm \{\} \; |
|---|
| 984 | rm -f Makefile pvfs2-config.h |
|---|
| 985 | rm -f src/server/simple.conf |
|---|
| 986 | rm -f src/apps/admin/pvfs2-config |
|---|
| 987 | ifndef DIST_RELEASE |
|---|
| 988 | rm -f $(SMCGEN) |
|---|
| 989 | endif |
|---|
| 990 | |
|---|
| 991 | # this is where we include all of our automatic dependencies. |
|---|
| 992 | # NOTE: we wrap this in ifneq's in order to prevent the |
|---|
| 993 | # dependencies from being generated for special targets that don't |
|---|
| 994 | # require them |
|---|
| 995 | ifeq (,$(filter clean distclean dist docs cscope tags nodep,$(MAKECMDGOALS))) |
|---|
| 996 | -include $(DEPENDS) |
|---|
| 997 | endif |
|---|
| 998 | # add this as a make goal to disable rebuilding dependencies |
|---|
| 999 | .PHONY: nodep |
|---|
| 1000 | nodep:; @: |
|---|
| 1001 | |
|---|
| 1002 | # default rule for generating dependency files |
|---|
| 1003 | %.d: %.c |
|---|
| 1004 | $(Q) " DEP $@" |
|---|
| 1005 | $(E)CC="$(CC)" $(srcdir)/maint/depend.sh $(call dirname,$*) $(CFLAGS) $(DB_CFLAGS) $(call modcflags,$<) $< > $@ |
|---|
| 1006 | |
|---|
| 1007 | # default rules for building documents in .tex format: |
|---|
| 1008 | # TODO: these documentation rules are a big hack! |
|---|
| 1009 | %.dvi: %.tex |
|---|
| 1010 | $(srcdir)/maint/pvfs2latexwrapper.pl -i $< -o $@ |
|---|
| 1011 | %.ps: %.dvi |
|---|
| 1012 | ( cd $(@D); dvips -t letter $(<F) -o $(@F) ) |
|---|
| 1013 | %.pdf: %.dvi |
|---|
| 1014 | ( cd $(@D); dvipdf $(<F) $(@F) ) |
|---|
| 1015 | %.html: %.tex |
|---|
| 1016 | $(srcdir)/maint/pvfs2latexwrapper.pl -html -i $(basename $<).tex -o $@ |
|---|
| 1017 | $(srcdir)/maint/pvfs2htmlfixup.sh $(@D)/*/$(@F) |
|---|
| 1018 | |
|---|
| 1019 | # rule for automatically generated source files |
|---|
| 1020 | %.c: %.sm $(STATECOMP) |
|---|
| 1021 | $(Q) " SMC $@" |
|---|
| 1022 | $(E)$(STATECOMP) $< $@ |
|---|
| 1023 | |
|---|
| 1024 | # if this is not a distribution tarball, then drop some example |
|---|
| 1025 | # config files in the server build directory with good defaults for |
|---|
| 1026 | # debugging |
|---|
| 1027 | ifndef DIST_RELEASE |
|---|
| 1028 | all:: src/server/simple.conf |
|---|
| 1029 | endif |
|---|
| 1030 | src/server/simple.conf: src/apps/admin/pvfs2-genconfig |
|---|
| 1031 | $(Q) " GENCONFIG $@" |
|---|
| 1032 | $(E)$(srcdir)/src/apps/admin/pvfs2-genconfig --protocol tcp --port 3334 \ |
|---|
| 1033 | --ioservers localhost --metaservers localhost --logfile /tmp/pvfs2-server.log \ |
|---|
| 1034 | --storage /tmp/pvfs2-test-space --logging "server,network,storage,flow" \ |
|---|
| 1035 | --quiet src/server/simple.conf |
|---|
| 1036 | |
|---|
| 1037 | # whether this is a distribution tarball or not, drop some config files |
|---|
| 1038 | # into the "examples" subdir of the build dir |
|---|
| 1039 | ifndef BUILD_BMI_ONLY |
|---|
| 1040 | all:: examples/fs.conf |
|---|
| 1041 | examples/fs.conf: src/apps/admin/pvfs2-genconfig |
|---|
| 1042 | $(Q) " GENCONFIG $@" |
|---|
| 1043 | $(E)$(srcdir)/src/apps/admin/pvfs2-genconfig --protocol tcp --port 3334 \ |
|---|
| 1044 | --ioservers localhost --metaservers localhost --logfile /tmp/pvfs2-server.log \ |
|---|
| 1045 | --storage /tmp/pvfs2-test-space \ |
|---|
| 1046 | --quiet examples/fs.conf |
|---|
| 1047 | endif |
|---|
| 1048 | |
|---|
| 1049 | install_doc: |
|---|
| 1050 | install -d $(mandir)/man1 |
|---|
| 1051 | install -d $(mandir)/man5 |
|---|
| 1052 | install -m 644 $(srcdir)/doc/man/*.1 $(mandir)/man1 |
|---|
| 1053 | install -m 644 $(srcdir)/doc/man/*.5 $(mandir)/man5 |
|---|
| 1054 | |
|---|
| 1055 | ifdef BUILD_BMI_ONLY |
|---|
| 1056 | install:: all |
|---|
| 1057 | install -d $(includedir) |
|---|
| 1058 | install -m 644 $(srcdir)/src/io/bmi/bmi.h $(includedir) |
|---|
| 1059 | install -m 644 $(srcdir)/src/io/bmi/bmi-types.h $(includedir) |
|---|
| 1060 | |
|---|
| 1061 | install -d $(libdir) |
|---|
| 1062 | install -m 755 lib/*.* $(libdir) |
|---|
| 1063 | else |
|---|
| 1064 | install:: all install_doc |
|---|
| 1065 | install -d $(includedir) |
|---|
| 1066 | install -m 644 $(builddir)/include/pvfs2.h $(includedir) |
|---|
| 1067 | install -m 644 $(srcdir)/include/pvfs2-request.h $(includedir) |
|---|
| 1068 | install -m 644 $(srcdir)/include/pvfs2-debug.h $(includedir) |
|---|
| 1069 | install -m 644 $(srcdir)/include/pvfs2-sysint.h $(includedir) |
|---|
| 1070 | install -m 644 $(srcdir)/include/pvfs2-mgmt.h $(includedir) |
|---|
| 1071 | install -m 644 $(srcdir)/include/pvfs2-types.h $(includedir) |
|---|
| 1072 | install -m 644 $(srcdir)/include/pvfs2-util.h $(includedir) |
|---|
| 1073 | install -m 644 $(srcdir)/include/pvfs2-encode-stubs.h $(includedir) |
|---|
| 1074 | install -m 644 $(srcdir)/include/pvfs2-hint.h $(includedir) |
|---|
| 1075 | install -m 644 $(srcdir)/include/pvfs2-compat.h $(includedir) |
|---|
| 1076 | install -m 644 $(srcdir)/include/pvfs2-mirror.h $(includedir) |
|---|
| 1077 | |
|---|
| 1078 | install -d $(libdir) |
|---|
| 1079 | ifneq (,$(LIBRARIES_STATIC)) |
|---|
| 1080 | for i in $(notdir $(LIBRARIES_STATIC)) ; do \ |
|---|
| 1081 | install -m 755 lib/$$i $(libdir) ;\ |
|---|
| 1082 | done |
|---|
| 1083 | ifneq (,$(KERNAPPSTHR)) |
|---|
| 1084 | for i in $(notdir $(LIBRARIES_THREADED_STATIC)) ; do \ |
|---|
| 1085 | install -m 755 lib/$$i $(libdir) ;\ |
|---|
| 1086 | done |
|---|
| 1087 | endif |
|---|
| 1088 | endif |
|---|
| 1089 | ifneq (,$(LIBRARIES_SHARED)) |
|---|
| 1090 | for i in $(notdir $(LIBRARIES_SHARED)) ; do \ |
|---|
| 1091 | install -m 755 lib/$$i $(libdir)/$$i.$(SO_FULLVER) ;\ |
|---|
| 1092 | $(LN_S) $$i.$(SO_FULLVER) $(libdir)/$$i.$(SO_VER) ;\ |
|---|
| 1093 | $(LN_S) $$i.$(SO_VER) $(libdir)/$$i ;\ |
|---|
| 1094 | done |
|---|
| 1095 | ifneq (,$(KERNAPPSTHR)) |
|---|
| 1096 | for i in $(notdir $(LIBRARIES_THREADED_SHARED)) ; do \ |
|---|
| 1097 | install -m 755 lib/$$i $(libdir)/$$i.$(SO_FULLVER) ;\ |
|---|
| 1098 | $(LN_S) $$i.$(SO_FULLVER) $(libdir)/$$i.$(SO_VER) ;\ |
|---|
| 1099 | $(LN_S) $$i.$(SO_VER) $(libdir)/$$i ;\ |
|---|
| 1100 | done |
|---|
| 1101 | endif |
|---|
| 1102 | endif |
|---|
| 1103 | |
|---|
| 1104 | ifdef TARGET_OS_DARWIN |
|---|
| 1105 | # TOC needs to be regenerated in libs after they get moved |
|---|
| 1106 | ranlib $(patsubst %,$(prefix)/%,$(LIBRARIES)) |
|---|
| 1107 | endif |
|---|
| 1108 | |
|---|
| 1109 | install -d $(bindir) |
|---|
| 1110 | install -m 755 $(ADMINTOOLS) $(bindir) |
|---|
| 1111 | install -m 755 $(USERTOOLS) $(bindir) |
|---|
| 1112 | # for compatibility in case anyone really wants "lsplus" |
|---|
| 1113 | $(LN_S) pvfs2-ls $(bindir)/pvfs2-lsplus |
|---|
| 1114 | install -m 755 src/apps/admin/pvfs2-config $(bindir) |
|---|
| 1115 | @# if we ever auto-generate genconfig, remove the $(srcdir) |
|---|
| 1116 | install -m 755 $(srcdir)/src/apps/admin/pvfs2-genconfig $(bindir) |
|---|
| 1117 | install -m 755 $(srcdir)/src/apps/admin/pvfs2-config-convert $(bindir) |
|---|
| 1118 | install -m 755 $(srcdir)/src/apps/admin/pvfs2-getmattr $(bindir) |
|---|
| 1119 | install -m 755 $(srcdir)/src/apps/admin/pvfs2-setmattr $(bindir) |
|---|
| 1120 | ifdef BUILD_KARMA |
|---|
| 1121 | install -m 755 $(KARMA) $(bindir) |
|---|
| 1122 | endif |
|---|
| 1123 | |
|---|
| 1124 | ifdef BUILD_FUSE |
|---|
| 1125 | install -m 755 $(FUSE) $(prefix)/bin |
|---|
| 1126 | endif |
|---|
| 1127 | |
|---|
| 1128 | install -d $(sbindir) |
|---|
| 1129 | |
|---|
| 1130 | ifdef BUILD_SERVER |
|---|
| 1131 | install -m 755 $(ADMINTOOLS_SERVER) $(bindir) |
|---|
| 1132 | ifeq ($(NPTL_WORKAROUND),) |
|---|
| 1133 | install -m 755 $(SERVER) $(sbindir) |
|---|
| 1134 | else |
|---|
| 1135 | install -m 755 $(srcdir)/$(SERVER_STUB) $(sbindir)/pvfs2-server |
|---|
| 1136 | install -m 755 $(SERVER) $(sbindir)/pvfs2-server.bin |
|---|
| 1137 | endif |
|---|
| 1138 | endif |
|---|
| 1139 | endif |
|---|
| 1140 | |
|---|
| 1141 | ifneq (,$(LINUX_KERNEL_SRC)) |
|---|
| 1142 | |
|---|
| 1143 | NUM_UTS_LINES := $(shell grep -c UTS_RELEASE $(LINUX_KERNEL_SRC)/include/linux/version.h) |
|---|
| 1144 | ifeq ($(NUM_UTS_LINES),1) |
|---|
| 1145 | KERNEL_VERS := $(shell grep UTS_RELEASE $(LINUX_KERNEL_SRC)/include/linux/version.h | cut -d\" -f2) |
|---|
| 1146 | else |
|---|
| 1147 | KERNEL_VERS := $(shell uname -r) |
|---|
| 1148 | endif |
|---|
| 1149 | KMOD_DIR ?= $(DESTDIR)/${kmod_prefix}/lib/modules/$(KERNEL_VERS)/kernel/fs/pvfs2 |
|---|
| 1150 | |
|---|
| 1151 | .PHONY: just_kmod_install |
|---|
| 1152 | just_kmod_install: just_kmod |
|---|
| 1153 | install -d $(KMOD_DIR) |
|---|
| 1154 | install -m 755 src/kernel/linux-2.6/pvfs2.ko $(KMOD_DIR) |
|---|
| 1155 | |
|---|
| 1156 | .PHONY: kmod_install |
|---|
| 1157 | kmod_install: kmod kernapps just_kmod_install |
|---|
| 1158 | install -d $(sbindir) |
|---|
| 1159 | install -m 755 $(KERNAPPS) $(KERNAPPSTHR) $(sbindir) |
|---|
| 1160 | endif |
|---|
| 1161 | |
|---|
| 1162 | ifneq (,$(LINUX24_KERNEL_SRC)) |
|---|
| 1163 | |
|---|
| 1164 | NUM_UTS_LINES := $(shell grep -c UTS_RELEASE $(LINUX24_KERNEL_SRC)/include/linux/version.h) |
|---|
| 1165 | ifeq ($(NUM_UTS_LINES),1) |
|---|
| 1166 | KERNEL_VERS := $(shell grep UTS_RELEASE $(LINUX24_KERNEL_SRC)/include/linux/version.h | cut -d\" -f2) |
|---|
| 1167 | else |
|---|
| 1168 | KERNEL_VERS := $(shell uname -r) |
|---|
| 1169 | endif |
|---|
| 1170 | KMOD_DIR := $(DESTDIR)/lib/modules/$(KERNEL_VERS)/kernel/fs/pvfs2 |
|---|
| 1171 | |
|---|
| 1172 | .PHONY: just_kmod24_install |
|---|
| 1173 | just_kmod24_install: just_kmod24 |
|---|
| 1174 | install -d $(KMOD_DIR) |
|---|
| 1175 | install -m 755 src/kernel/linux-2.4/pvfs2.o $(KMOD_DIR) |
|---|
| 1176 | |
|---|
| 1177 | .PHONY: kmod24_install |
|---|
| 1178 | kmod24_install: kmod24 kernapps just_kmod24_install |
|---|
| 1179 | install -d $(sbindir) |
|---|
| 1180 | install -m 755 $(KERNAPPS) $(KERNAPPSTHR) $(sbindir) |
|---|
| 1181 | install -m 755 src/apps/kernel/linux/mount.pvfs2 $(sbindir) |
|---|
| 1182 | @echo "" |
|---|
| 1183 | @echo "For improved linux-2.4 support," |
|---|
| 1184 | @echo "install $(sbindir)/mount.pvfs2 to /sbin/mount.pvfs2" |
|---|
| 1185 | @echo "" |
|---|
| 1186 | endif |
|---|