diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2010-12-12 23:13:14 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2011-01-10 21:35:22 -0600 |
commit | 25e20741c861c40a5b473597a360385de721403e (patch) | |
tree | 54af994e0611b313f2c37b15675e934afd804199 | |
parent | f3a8ca72dd136c6b87344d9ddf21fda6903ef764 (diff) |
dependencies for windows
-rw-r--r-- | solenv/gbuild/helper.mk | 4 | ||||
-rw-r--r-- | solenv/gbuild/platform/windows.mk | 45 | ||||
-rw-r--r-- | solenv/gbuild/processdeps.awk | 65 | ||||
-rw-r--r-- | soltools/mkdepend/def.h | 4 |
4 files changed, 110 insertions, 8 deletions
diff --git a/solenv/gbuild/helper.mk b/solenv/gbuild/helper.mk index 523fa5751066..c5417558a3d4 100644 --- a/solenv/gbuild/helper.mk +++ b/solenv/gbuild/helper.mk @@ -49,8 +49,8 @@ endef define gb_Helper_abbreviate_dirs S=$(SRCDIR) && \ -$(subst $(SRCDIR)/,$$S/,W=$(WORKDIR) && O=$(OUTDIR)) && \ -$(subst $(SRCDIR)/,$$S/,$(subst $(WORKDIR)/,$$W/,$(subst $(OUTDIR)/,$$O/,$(1)))) +$(subst $(SRCDIR)/,$$S/,O=$(OUTDIR)) && \ +$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,W=$(WORKDIR) && $(subst $(WORKDIR)/,$$W/,$(1)))) endef define gb_Helper_make_clean_target diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk index 736aa779cd6a..a28363887a33 100644 --- a/solenv/gbuild/platform/windows.mk +++ b/solenv/gbuild/platform/windows.mk @@ -33,6 +33,7 @@ gb_MkTemp := mktemp -p gb_CC := cl gb_CXX := cl gb_LINK := link +gb_AWK := awk gb_OSDEFS :=\ -DWINVER=0x0500 \ @@ -176,8 +177,8 @@ gb_Helper_OUTDIR_NATIVE := $(shell cygpath -m $(OUTDIR)) define gb_Helper_abbreviate_dirs_native S=$(gb_Helper_SRCDIR_NATIVE) && \ -$(subst $(gb_Helper_SRCDIR_NATIVE)/,$$S/,W=$(gb_Helper_WORKDIR_NATIVE) && O=$(gb_Helper_OUTDIR_NATIVE)) && \ -$(subst $(SRCDIR)/,$$S/,$(subst $(WORKDIR)/,$$W/,$(subst $(OUTDIR)/,$$O/,$(1)))) +$(subst $(gb_Helper_SRCDIR_NATIVE)/,$$S/,O=$(gb_Helper_OUTDIR_NATIVE)) && \ +$(subst $(gb_Helper_SRCDIR_NATIVE)/,$$S/,$(subst $(SRCDIR)/,$$S/,$(subst $(gb_Helper_OUTDIR_NATIVE)/,$$O/,$(subst $(OUTDIR)/,$$O/,W=$(gb_Helper_WORKDIR_NATIVE) && $(subst $(gb_Helper_WORKDIR_NATIVE)/,$$W/,$(subst $(WORKDIR)/,$$W/,$(1))))))) endef # CObject class @@ -192,6 +193,19 @@ $(call gb_Helper_abbreviate_dirs_native,\ $(6) \ -c $(3) \ -Fo$(1)" && E=$$($$C) || (echo $$C && echo $$E 1>&2 && false)) +$(call gb_Helper_abbreviate_dirs_native,\ + $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ + $(4) $(5) \ + -I$(dir $(3)) \ + $(6) \ + $(3) \ + -f - \ + | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ + -v OBJECTFILE=$(1) \ + -v OUTDIR=$(OUTDIR)/ \ + -v WORKDIR=$(WORKDIR)/ \ + -v SRCDIR=$(SRCDIR)/ \ + > $(call gb_CxxObject_get_dep_target,$(2))) endef define gb_CObject__command_dep @@ -212,11 +226,24 @@ $(call gb_Helper_abbreviate_dirs_native,\ $(6) \ -c $(3) \ -Fo$(1)" && E=$$($$C) || (echo $$C && echo $$E 1>&2 && false)) +$(call gb_Helper_abbreviate_dirs_native,\ + $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ + $(4) $(5) \ + -I$(dir $(3)) \ + $(6) \ + $(3) \ + -f - \ + | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ + -v OBJECTFILE=$(1) \ + -v OUTDIR=$(OUTDIR)/ \ + -v WORKDIR=$(WORKDIR)/ \ + -v SRCDIR=$(SRCDIR)/ \ + > $(call gb_CxxObject_get_dep_target,$(2))) endef define gb_CxxObject__command_dep mkdir -p $(dir $(1)) && \ - echo '$(call gb_CObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1) + echo '$(call gb_CxxObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1) endef @@ -416,7 +443,17 @@ gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET) define gb_SrsPartTarget__command_dep -$(info gb_SrsPartTarget__command_dep not implemented) +$(call gb_Helper_abbreviate_dirs_native,\ + $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ + $(3) $(4) \ + $(2) \ + -f - \ + | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ + -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \ + -v OUTDIR=$(OUTDIR)/ \ + -v WORKDIR=$(WORKDIR)/ \ + -v SRCDIR=$(SRCDIR)/ \ + > $(call gb_SrsPartTarget_get_dep_target,$(1))) endef diff --git a/solenv/gbuild/processdeps.awk b/solenv/gbuild/processdeps.awk new file mode 100644 index 000000000000..d08edf2a9e20 --- /dev/null +++ b/solenv/gbuild/processdeps.awk @@ -0,0 +1,65 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# this awk script mangles makedepend output for a single object file +# usage: +# awk -f .../processdeps.awk \ +# -v OUTDIR=outdir \ +# -v SRCDIR=srcdir \ +# -v wORKDIR=workdir \ +# -v OBJECTFILE=objectfile +# called like this the script will read from stdin +# and write to stdout. It will: +# - replace the objectfile with the one given on the commandline +# - normalize paths to mixed paths (replacing all \ with /) +# - replace the string given as WORKDIR with $(WORKDIR)/ +# - replace the string given as OUTDIR with $(OUTDIR)/ +# - replace the string given as SRCDIR with $(SRCDIR)/ +# - translates absolute mixed windows paths to cygwin paths by +# substituting a path starting with X:... to /cygdrive/X/... + +function mangle_path(path) { + gsub("\\\\", "/", path); + gsub(WORKDIR, "$(WORKDIR)/", path); + gsub(OUTDIR, "$(OUTDIR)/", path); + gsub(SRCDIR, "$(SRCDIR)/", path); + if( path ~ /^[a-zA-Z]:/ ) + path = "/cygdrive/" substr(path,0,1) "/" substr(path,3); + return path; +} + +BEGIN { + print mangle_path(OBJECTFILE) ": \\"; +} + +/^[^#]/ { + print "\t" mangle_path($2) " \\"; +} + +END { + print "\n"; +} diff --git a/soltools/mkdepend/def.h b/soltools/mkdepend/def.h index 4e362000e385..6a3086df7bf0 100644 --- a/soltools/mkdepend/def.h +++ b/soltools/mkdepend/def.h @@ -61,8 +61,8 @@ in this Software without prior written authorization from the X Consortium. #endif #define MAXDEFINES 512 -#define MAXFILES 2048 /* Increased from 512. -mcafee */ - /* Increased from 1024. -mh */ +#define MAXFILES 65536 + #define MAXDIRS 64 #define SYMHASHSEED 131 /* 131 1313 13131 ... */ #define SYMHASHMEMBERS 64 /* must be 2^x to work right */ |