1#************************************************************** 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance 9# with the License. You may obtain a copy of the License at 10# 11# http://www.apache.org/licenses/LICENSE-2.0 12# 13# Unless required by applicable law or agreed to in writing, 14# software distributed under the License is distributed on an 15# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16# KIND, either express or implied. See the License for the 17# specific language governing permissions and limitations 18# under the License. 19# 20#************************************************************** 21 22 23 24GUI := UNX 25COM := S5ABI 26COMID := s5abi 27#COM := S5ABI 28#COMID := s5abi 29 30# Darwin mktemp -t expects a prefix, not a pattern 31gb_MKTEMP ?= /usr/bin/mktemp -t gbuild. 32 33gb_CC := cc 34gb_CXX := g++ 35gb_GCCP := gcc 36gb_AR := ar 37gb_AWK := awk 38gb_CLASSPATHSEP := : 39 40# use CC/CXX if they are nondefaults 41ifneq ($(origin CC),default) 42gb_CC := $(CC) 43gb_GCCP := $(CC) 44endif 45ifneq ($(origin CXX),default) 46gb_CXX := $(CXX) 47endif 48 49gb_OSDEFS := \ 50 -D$(OS) \ 51 -D_PTHREADS \ 52 -DUNIX \ 53 -DUNX \ 54 -D_REENTRANT \ 55 -DNO_PTHREAD_PRIORITY \ 56 -DQUARTZ \ 57 $(EXTRA_CDEFS) \ 58 59gb_COMPILERDEFS := \ 60 -D$(COM) \ 61 -DHAVE_GCC_VISIBILITY_FEATURE \ 62 -DCPPU_ENV=$(COMID) \ 63 -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \ 64 65ifeq ($(CPUNAME),POWERPC) 66gb_CPUDEFS := -DPOWERPC -DPPC 67else ifeq ($(CPUNAME),INTEL) 68gb_CPUDEFS := -DX86 69else ifeq ($(CPUNAME),X86_64) 70gb_CPUDEFS := -DX86_64 71endif 72 73ifeq ($(strip $(SYSBASE)),) 74 gb_SDKDIR := $(MACOSX_SDK_PATH) 75else 76 gb_SDKDIR := $(SYSBASE)/MacOSX$(MACOSX_DEPLOYMENT_TARGET).sdk 77endif 78 79 80gb_CFLAGS := \ 81 -isysroot $(gb_SDKDIR) \ 82 -Wall \ 83 -Wendif-labels \ 84 -Wextra \ 85 -Wshadow \ 86 -fPIC \ 87 -fmessage-length=0 \ 88 -fno-common \ 89 -fno-strict-aliasing \ 90 -pipe \ 91 92gb_CXXFLAGS := \ 93 -isysroot $(gb_SDKDIR) \ 94 -Wall \ 95 -Wendif-labels \ 96 -Wextra \ 97 -Wno-ctor-dtor-privacy \ 98 -Wno-non-virtual-dtor \ 99 -fPIC \ 100 -fmessage-length=0 \ 101 -fno-common \ 102 -fno-strict-aliasing \ 103 -fsigned-char \ 104 -pipe 105 106ifneq ($(COM),GCC) 107 gb_CXXFLAGS += -DHAVE_STL_INCLUDE_PATH -I../v1/ 108endif 109 110ifeq ($(MACOSX_DEPLOYMENT_TARGET),$(filter $(MACOSX_DEPLOYMENT_TARGET), 10.7 10.8)) 111 gb_CXXFLAGS += -std=c++11 -stdlib=libc++ 112 gb_macos_LDFLAGS := -std=c++11 -stdlib=libc++ 113endif 114 115# these are to get g++ to switch to Objective-C++ mode 116# (see toolkit module for a case where it is necessary to do it this way) 117gb_OBJCXXFLAGS := -x objective-c++ -fobjc-exceptions 118 119ifneq ($(MACOSX_DEPLOYMENT_TARGET),) 120 gb_CXXFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_$(subst .,_,$(MACOSX_DEPLOYMENT_TARGET)) 121endif 122 123ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE) 124gb_CFLAGS_WERROR := -Werror -Wno-error=deprecated 125gb_CXXFLAGS_WERROR := -Werror -Wno-error=deprecated 126endif 127 128gb_LinkTarget_EXCEPTIONFLAGS := \ 129 -DEXCEPTIONS_ON \ 130 -fexceptions 131 132ifeq ($(COM),GCC) 133 gb_LinkTarget_EXCEPTIONFLAGS += -fno-enforce-eh-specs 134endif 135 136gb_LinkTarget_NOEXCEPTIONFLAGS := \ 137 -DEXCEPTIONS_OFF \ 138 -fno-exceptions 139 140gb_LinkTarget_LDFLAGS := \ 141 -Wl,-syslibroot,$(gb_SDKDIR) \ 142 $(subst -L../lib , ,$(SOLARLIB)) \ 143#man ld says: obsolete -Wl,-multiply_defined,suppress \ 144 145ifeq ($(ENABLE_SYMBOLS),SMALL) 146gb_DEBUG_CFLAGS := -g1 147else 148gb_DEBUG_CFLAGS := -g3 149endif 150 151ifeq ($(gb_DEBUGLEVEL),2) 152gb_COMPILEROPTFLAGS := -O0 153gb_COMPILEROPT1FLAGS := -O0 154else 155gb_COMPILEROPTFLAGS := -O2 156gb_COMPILEROPT1FLAGS := -O1 157endif 158 159gb_COMPILERNOOPTFLAGS := -O0 160 161# Helper class 162 163gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs) 164 165# convert parametters filesystem root to native notation 166# does some real work only on windows, make sure not to 167# break the dummy implementations on unx* 168define gb_Helper_convert_native 169$(1) 170endef 171 172# convert parametters filesystem root to native notation 173# does some real work only on windows, make sure not to 174# break the dummy implementations on unx* 175define gb_Helper_convert_native 176$(1) 177endef 178 179 180# CObject class 181 182define gb_CObject__command 183$(call gb_Output_announce,$(2),$(true),C ,3) 184$(call gb_Helper_abbreviate_dirs,\ 185 mkdir -p $(dir $(1)) $(dir $(4)) && \ 186 $(gb_CC) \ 187 $(DEFS) \ 188 $(T_CFLAGS) \ 189 $(CFLAGS) \ 190 -c $(3) \ 191 -o $(1) \ 192 -MMD -MT $(1) \ 193 -MF $(4) \ 194 -I$(dir $(3)) \ 195 $(INCLUDE)) 196endef 197 198 199# CxxObject class 200 201# N.B: $(CXXFLAGS) may contain -x objective-c++, which must come before -c 202define gb_CxxObject__command 203$(call gb_Output_announce,$(2),$(true),CXX,3) 204$(call gb_Helper_abbreviate_dirs,\ 205 mkdir -p $(dir $(1)) $(dir $(4)) && \ 206 $(gb_CXX) \ 207 $(DEFS) \ 208 $(T_CXXFLAGS) \ 209 $(CXXFLAGS) \ 210 -c $(3) \ 211 -o $(1) \ 212 -MMD -MT $(1) \ 213 -MF $(4) \ 214 -I$(dir $(3)) \ 215 $(INCLUDE_STL) $(INCLUDE)) 216endef 217 218 219# ObjCxxObject class 220 221define gb_ObjCxxObject__command 222$(call gb_Output_announce,$(2),$(true),OCX,3) 223$(call gb_Helper_abbreviate_dirs,\ 224 mkdir -p $(dir $(1)) $(dir $(4)) && \ 225 $(gb_CXX) \ 226 $(DEFS) \ 227 $(T_OBJCXXFLAGS) \ 228 $(OBJCXXFLAGS) \ 229 -c $(3) \ 230 -o $(1) \ 231 -MMD -MT $(1) \ 232 -MF $(4) \ 233 -I$(dir $(3)) \ 234 $(INCLUDE_STL) $(INCLUDE)) 235endef 236 237 238# LinkTarget class 239 240define gb_LinkTarget__get_rpath_for_layer 241$(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS))) 242endef 243 244gb_LinkTarget__RPATHS := \ 245 URELIB:@__________________________________________________URELIB/ \ 246 UREBIN: \ 247 OOO:@__________________________________________________OOO/ \ 248 BRAND: \ 249 SDKBIN: \ 250 NONEBIN: \ 251 252define gb_LinkTarget__get_installname 253$(if $(2),-install_name '$(2)$(1)',) 254endef 255 256gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) 257gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) 258gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) $(gb_OBJCXXFLAGS) 259 260gb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) 261gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) 262 263# FIXME framework handling very hackish 264define gb_LinkTarget__get_liblinkflags 265$(patsubst lib%.dylib,-l%,$(foreach lib,$(filter-out $(gb_Library__FRAMEWORKS),$(1)),$(call gb_Library_get_filename,$(lib)))) \ 266$(addprefix -framework ,$(filter $(gb_Library__FRAMEWORKS),$(1))) 267endef 268 269define gb_LinkTarget__get_layer 270$(if $(filter Executable,$(1)),\ 271 $$(call gb_Executable_get_layer,$(2)),\ 272 $$(call gb_Library_get_layer,$(2))) 273endef 274 275# FIXME the DYLIB_FILE mess is only necessary because 276# solver layout is different from installation layout 277define gb_LinkTarget__command_dynamiclink 278$(call gb_Helper_abbreviate_dirs,\ 279 mkdir -p $(dir $(1)) && \ 280 DYLIB_FILE=`$(gb_MKTEMP)` && \ 281 $(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \ 282 $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \ 283 $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ 284 $(subst \d,$$,$(RPATH)) \ 285 $(T_LDFLAGS) \ 286 $(patsubst lib%.dylib,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \ 287 $(patsubst %,-l%,$(EXTERNAL_LIBS)) \ 288 > $${DYLIB_FILE} && \ 289 $(gb_CXX) \ 290 $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \ 291 $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ 292 $(subst \d,$$,$(RPATH)) \ 293 $(T_LDFLAGS) $(gb_macos_LDFLAGS) \ 294 $(if $(VERSIONMAP),$(gb_Library_VERSIONMAPFLAG) $(VERSIONMAP)) \ 295 $(call gb_LinkTarget__get_liblinkflags,$(LINKED_LIBS)) \ 296 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 297 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 298 $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \ 299 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 300 $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \ 301 $(LIBS) \ 302 -o $(1) \ 303 `cat $${DYLIB_FILE}` && \ 304 $(if $(filter Library,$(TARGETTYPE)),\ 305 $(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl Library $(LAYER) $(1) && \ 306 ln -sf $(1) $(patsubst %.dylib,%.jnilib,$(1)) &&) \ 307 rm -f $${DYLIB_FILE}) 308endef 309 310# parameters: 1-linktarget 2-cobjects 3-cxxobjects 311define gb_LinkTarget__command_staticlink 312$(call gb_Helper_abbreviate_dirs,\ 313 mkdir -p $(dir $(1)) && \ 314 $(gb_AR) -rsu $(1) \ 315 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 316 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 317 $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \ 318 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 319 2> /dev/null) 320endef 321 322define gb_LinkTarget__command 323$(call gb_Output_announce,$(2),$(true),LNK,4) 324$(if $(filter Library GoogleTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2))) 325$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) 326endef 327 328 329# Library class 330 331gb_Library_DEFS := 332gb_Library_TARGETTYPEFLAGS := -dynamiclib -single_module 333gb_Library_VERSIONMAPFLAG := -Wl,-exported_symbols_list 334gb_Library_SYSPRE := lib 335gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_ 336gb_Library_PLAINEXT := .dylib 337gb_Library_RTEXT := $(COMID)$(gb_Library_PLAINEXT) 338 339gb_Library_OOOEXT := $(gb_Library_PLAINEXT) 340gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT) 341 342gb_Library__FRAMEWORKS := \ 343 Cocoa \ 344 345gb_Library_PLAINLIBS_NONE += \ 346 Cocoa \ 347 objc \ 348 m \ 349 pthread 350 351gb_Library_FILENAMES := \ 352 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \ 353 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ 354 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ 355 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ 356 $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \ 357 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \ 358 $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \ 359 $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \ 360 $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \ 361 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \ 362 363 364gb_Library_LAYER := \ 365 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ 366 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \ 367 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ 368 $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \ 369 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \ 370 $(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \ 371 $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \ 372 $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \ 373 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \ 374 375define gb_Library_get_rpath 376$(call gb_LinkTarget__get_installname,$(call gb_Library_get_filename,$(1)),$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))) 377endef 378 379define gb_Library_Library_platform 380$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1)) 381$(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Library_get_layer,$(1)) 382 383endef 384 385 386# StaticLibrary class 387 388gb_StaticLibrary_DEFS := 389gb_StaticLibrary_SYSPRE := lib 390gb_StaticLibrary_PLAINEXT := .a 391gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT) 392 393gb_StaticLibrary_FILENAMES := \ 394 $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \ 395 $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \ 396 397gb_StaticLibrary_StaticLibrary_platform = 398 399 400# Executable class 401 402gb_Executable_EXT := 403gb_Executable_TARGETTYPEFLAGS := -bind_at_load 404 405gb_Executable_LAYER := \ 406 $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \ 407 $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \ 408 $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \ 409 $(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \ 410 $(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \ 411 412 413define gb_Executable_get_rpath 414$(call gb_LinkTarget__get_installname,$(1),$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1)))) 415endef 416 417define gb_Executable_Executable_platform 418$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Executable_get_rpath,$(1)) 419$(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Executable_get_layer,$(1)) 420 421endef 422 423 424# GoogleTest class 425 426gb_GoogleTest_GTESTPRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib 427gb_GoogleTest_get_filename = $(1)$(gb_Executable_EXT) 428 429define gb_GoogleTest_GoogleTest_platform 430$(call gb_LinkTarget_get_target,$(2)) : RPATH := 431endef 432 433# JunitTest class 434 435define gb_JunitTest_JunitTest_platform 436$(call gb_JunitTest_get_target,$(1)) : DEFS := \ 437 -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(SRCDIR)/instsetoo_native/$(INPATH)/Apache_OpenOffice/installed/install/en-US/openoffice4/program/soffice}" \ 438 -Dorg.openoffice.test.arg.env=DYLD_LIBRARY_PATH \ 439 -Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \ 440 441endef 442 443# SdiTarget class 444 445gb_SdiTarget_SVIDLPRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib 446 447# SrsPartMergeTarget 448 449gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib 450 451# SrsPartTarget class 452 453gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc 454gb_SrsPartTarget_RSCCOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET) 455 456define gb_SrsPartTarget__command_dep 457$(call gb_Helper_abbreviate_dirs,\ 458 $(gb_GCCP) \ 459 -MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \ 460 $(INCLUDE) \ 461 $(DEFS) \ 462 -c -x c++-header $(2) \ 463 -o $(call gb_SrsPartTarget_get_dep_target,$(1))) 464endef 465 466 467# ComponentTarget 468 469gb_XSLTPROCPRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib 470gb_Library_COMPONENTPREFIXES := \ 471 OOO:vnd.sun.star.expand:\dOOO_BASE_DIR/program/ \ 472 URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \ 473 NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \ 474 475# UnoApiTarget 476 477gb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc 478gb_UnoApiTarget_IDLCCOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_IDLCTARGET) 479gb_UnoApiTarget_REGMERGETARGET := $(OUTDIR)/bin/regmerge 480gb_UnoApiTarget_REGMERGECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGMERGETARGET) 481gb_UnoApiTarget_REGCOMPARETARGET := $(OUTDIR)/bin/regcompare 482gb_UnoApiTarget_REGCOMPARECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGCOMPARETARGET) 483gb_UnoApiTarget_CPPUMAKERTARGET := $(OUTDIR)/bin/cppumaker 484gb_UnoApiTarget_CPPUMAKERCOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_CPPUMAKERTARGET) 485gb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR)/bin/regview 486gb_UnoApiTarget_REGVIEWCOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_UnoApiTarget_REGVIEWTARGET) 487 488 489# vim: set noet sw=4 ts=4: 490