Kaydet (Commit) 036e0e6d authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

new gbuild system

üst 03c2a4a7
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2009 by Sun Microsystems, Inc.
#
# 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.
#
#*************************************************************************
include ./solenv/inc/gbuild.mk
include $(foreach module,\
framework \
sfx2 \
svl \
svtools \
xmloff \
sw \
toolkit \
tools \
,$(SRCDIR)/$(module)/prj/target_module_$(module).mk)
all : $(foreach module,$(gb_Module_ALLMODULES),$(call gb_Module_get_target,$(module)))
$(call gb_Helper_announce,Completed all modules.)
clean : $(foreach module,$(gb_Module_ALLMODULES),$(call gb_Module_get_clean_target,$(module)))
$(call gb_Helper_announce,all modules cleaned.)
.DEFAULT_GOAL := all
# vim: set noet sw=4 ts=4:
#!/bin/sh
cd tools
../solenv/bin/build.pl -P4 -- -P4
../solenv/bin/deliver.pl
cd -
cd framework
../solenv/bin/build.pl -P4 -- -P4
../solenv/bin/deliver.pl
cd -
cd toolkit
../solenv/bin/build.pl -P4 -- -P4
../solenv/bin/deliver.pl
cd -
cd sw
../solenv/bin/build.pl -P4 -- -P4
../solenv/bin/deliver.pl
cd -
......@@ -19,8 +19,8 @@ sub fix_whitespace($$) {
# usually we have nothing to do ;-)
return if ( keys( %{$lines} ) == 0 ||
$file eq "" ||
!( $file =~ /\.(c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|mk|MK|pl|pm|pmk|py|sdi|sh|src|tab)/ ) );
$file eq "" || $file eq "GNUmakefile" ||
!( $file =~ /\.(c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|MK|pl|pm|pmk|py|sdi|sh|src|tab)/ ) );
open( IN, "$file" ) || die "Cannot open $file for reading";
my ( $out, $tmpfile ) = mkstemp( "/tmp/whitespace-fixing-XXXXXX" );
......@@ -126,7 +126,8 @@ my $err_ext = "";
open( FILES, "git diff-index --cached --name-only $against |" ) || die "Cannot run git diff-index.";
while ( my $file = <FILES> ) {
chomp( $file );
if ( $file =~ /\.(c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|mk|MK|pmk|pl|pm|sdi|sh|src|tab|xcu|xml)$/) {
if ( $file ne "GNUmakefile" &&
$file =~ /\.(c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|MK|pmk|pl|pm|sdi|sh|src|tab|xcu|xml)$/) {
open( F, "git diff-index -p --cached $against -- '$file' |" );
while ( my $line = <F> ) {
if ( $line =~ /^\+ *\t/ ) {
......
#!/usr/bin/env python
import sys
import os
class CxxTarget:
def __init__(self, line):
self.directory = ''
self.outputfile = ''
self.includeflags = []
self.cxxflags = []
self.inputfiles = []
self.nolink = False
options = line[:-1].split(' ')
self.directory = options.pop(0)
parsing_outputfile = False
for option in options:
if parsing_outputfile:
self.outputfile = option
parsing_outputfile = False
elif option == '-o':
parsing_outputfile = True
elif option == '-c':
self.nolink = True
elif option.startswith('-I'):
self.includeflags.append(CxxFlag(option))
elif option.startswith('-'):
self.cxxflags.append(CxxFlag(option))
else:
self.inputfiles.append(option)
self.cxxflags.sort()
self.includeflags.sort()
cxxflags_tmp = dict()
for flag in self.cxxflags:
cxxflags_tmp[flag.name] = flag
self.cxxflags = cxxflags_tmp.values()
includeflags_tmp = dict()
for flag in self.includeflags:
includeflags_tmp[flag.name] = flag
self.includeflags = includeflags_tmp.values()
CxxTargets.by_name[self.getFullOutputname()] = self
def __str__(self):
return '%s' % (self.getFullOutputname())
def getFullOutputname(self):
return self.directory + '/' + self.outputfile
def __cmp__(self, other):
return cmp(self.getFullOutputname(), other.getFullOutputname())
class CxxFlag:
def __init__(self, name):
self.name = name
CxxFlags.by_name[self.name] = self
def __str__(self):
return 'Flag %s' % (self.name)
def __cmp__(self, other):
return cmp(self.name, other.name)
class CxxFlags:
by_name = dict()
class CxxTargets:
by_name = dict()
if __name__ == '__main__':
[CxxTarget(line) for line in sys.stdin.readlines()]
compile_targets = [target for target in CxxTargets.by_name.values() if target.nolink]
link_targets = [target for target in CxxTargets.by_name.values() if not target.nolink]
common_compile_flags = []
for flag in CxxFlags.by_name.values():
if sum((flag in target.cxxflags for target in compile_targets)) == len(compile_targets):
common_compile_flags.append(flag)
common_link_flags = []
for flag in CxxFlags.by_name.values():
if sum((flag in target.cxxflags for target in compile_targets)) == len(compile_targets):
common_link_flags.append(flag)
for target in compile_targets:
target.cxxflags = [flag for flag in target.cxxflags if flag not in common_compile_flags]
target.cxxflags.sort()
for target in link_targets:
target.cxxflags = [flag for flag in target.cxxflags if flag not in common_link_flags]
target.cxxflags.sort()
common_compile_flags.sort()
common_link_flags.sort()
print 'common compile flags: %s' % (' '.join(flag.name for flag in common_compile_flags))
print 'common link flags: %s' % (' '.join(flag.name for flag in common_link_flags))
by_flagset = dict()
for target in CxxTargets.by_name.values():
flagset = ' '.join((flag.name for flag in target.cxxflags))
if flagset not in by_flagset:
by_flagset[flagset] = list()
by_flagset[flagset].append(target)
for targetlist in by_flagset.values():
targetlist.sort()
flagsets = by_flagset.keys()
flagsets.sort()
print '%d compilerflag groups:' % (len(flagsets))
for flagset in flagsets:
print flagset
for target in by_flagset[flagset]:
print '%s' % (target)
print
by_flagset = dict()
for target in CxxTargets.by_name.values():
flagset = ' '.join((flag.name for flag in target.includeflags))
if flagset not in by_flagset:
by_flagset[flagset] = list()
by_flagset[flagset].append(target)
for targetlist in by_flagset.values():
targetlist.sort()
flagsets = by_flagset.keys()
flagsets.sort()
print '%d include flag groups:' % (len(flagsets))
for flagset in flagsets:
print flagset
for target in by_flagset[flagset]:
print '%s' % (target)
print
print 'sources:'
by_name = dict()
for target in CxxTargets.by_name.values():
by_name[os.path.basename(target.outputfile)] = target
names = by_name.keys()
names.sort()
for target in CxxTargets.by_name.values():
if len(target.inputfiles) > 1:
objects = [os.path.basename(object) for object in target.inputfiles]
sources = list()
for object in objects:
if object in by_name:
sources.append(by_name[object].inputfiles[0])
else:
sources.append('!!!!' + object)
sources.sort()
print '%s %s' % (target.getFullOutputname(), ' '.join(sources))
This diff is collapsed.
namespace types
{
/// A plain old string.
class String {};
/// A partial, relative or absolute filesystem path.
class Path {};
/// A target represented by an absolute filesystem path.
class Target {};
/// A partial or complete shell-command.
class Command {};
/// A library name as used on in the linking step.
class Linkname {};
/// A integer number.
class Integer {};
/// A boolean value.
/// There are const boolean values true and false for
/// comparisons (written as $(true) and $(false) in makefiles.
class Bool {};
/// A language (for localisation)
/// A language represented by its ISO 639-1:2002 code.
class Language {};
/// A List of objects.
/// A List of objects represented by a whitespace separated list
/// in makefiles.
template <typename T>
class List<T> {};
};
using namespace types;
namespace gb
{
class Library;
class OOoLibrary;
class RtLibrary;
class Executable;
class Module;
class AllLangResTarget;
class SystemLibrary {};
class Helper
{
public:
static Command announce(Target target);
static Command abbreviate_dirs(Command command);
};
class StaticLibrary
{
public:
StaticLibrary(String name);
Target get_target();
};
class Objectfile
{
public:
Objectfile(String name);
Target get_target();
Target get_dep_filename();
Target get_cxx_source_filename();
};
enum LinkTargetType {
LIB,
EXE
};
class LinkTarget
{
private:
friend class Library;
friend class Executable;
LinkTarget(LinkTargetType type, String name, Target target);
Target get_target();
Target get_headers_target();
Target get_dep_filename();
void set_cxxflags(String cxxflags);
void set_visibility_hidden(Bool visibility_hidden);
void set_include(String include);
void set_ldflags(String ldflags);
void set_library_path_flags(String library_path_flags);
void add_linked_libs(List<Library> linked_libraries);
void add_object(Objectfile objectfile);
void add_noexception_object(Objectfile objectfile);
void add_exception_object(Objectfile objectfile);
void add_noexception_objects(List<Objectfile> objectfiles);
void add_exception_objects(List<Objectfile> objectfiles);
List<String> DEFS;
List<String> CXXFLAGS;
List<String> INCLUDE;
String VISIBILITY;
List<String> LDFLAGS;
List<String> LIBRARY_PATH_FLAGS;
List<Linkname> LINKED_LIBS;
List<Linkname> LINKED_SYS_LIBS;
List<Objectfile> OBJECTS;
List<String> TARGETTYPE_LINK_FLAGS;
};
class Library
{
protected:
Library(String name, Target target);
public:
Target get_target();
Target get_headers_target();
Target get_dep_filename();
void set_cxxflags(String cxxflags);
void set_visibility_hidden(Bool visibility_hidden);
void set_include(String include);
void set_ldflags(String ldflags);
void set_library_path_flags(String library_path_flags);
void add_linked_libs(List<Library> linked_libraries);
void add_linked_system_libs(List<SystemLibrary> linked_system_libraries);
void add_object(Objectfile objectfile);
void add_noexception_object(Objectfile objectfile);
void add_exception_object(Objectfile objectfile);
void add_noexception_objects(List<Objectfile> objectfiles);
void add_exception_objects(List<Objectfile> objectfiles);
};
class OOoLibrary : public Library
{
public:
OOoLibrary(String name);
Target get_target();
Target get_headers_target();
Target get_dep_filename();
Linkname get_linkname();
static List<Linkname> get_linknames(List<OOoLibrary> ooolibraries);
};
class RtLibrary : public Library
{
public:
RtLibrary(String name);
Target get_target();
Target get_headers_target();
Target get_dep_filename();
Linkname get_linkname();
static List<Linkname> get_linknames(List<RtLibrary> ooolibraries);
};
class Executable
{
public:
Executable(String name);
Target get_target();
void set_cxxflags(List<String> cxxflags);
void set_visibility_hidden(Bool visibility_hidden);
void set_include(List<String> include);
void set_ldflags(List<String> ldflags);
void set_library_path_flags(List<String> library_path_flags);
void add_linked_libs(List<Library> linked_libraries);
void add_linked_system_libs(List<SystemLibrary> linked_system_libraries);
void add_object(Objectfile objectfile);
void add_noexception_object(Objectfile objectfile);
void add_exception_object(Objectfile objectfile);
void add_noexception_objects(List<Objectfile> objectfiles);
void add_exception_objects(List<Objectfile> objectfiles);
};
class SdiTarget
{
private:
List<String> INCLUDE;
public:
SdiTarget(String name);
Target get_target();
void set_include(List<String> include);
};
class SrsTarget
{
private:
List<String> DEFS;
List<String> INCLUDE;
public:
SrsTarget(String name);
Target get_target();
void set_defs(List<String> defs);
void set_include(List<String> include);
};
class ResTarget
{
private:
friend class AllLangResTarget;
ResTarget(String name, Language language);
public:
Target get_target();
void add_file(SrsTarget srstarget);
void add_files(List<SrsTarget> srstargets);
};
class AllLangResTarget
{
public:
AllLangResTarget(String name);
void add_file(SrsTarget srstarget);
void add_files(List<SrsTarget> srstargets);
};
class Package
{
public:
Package(String name, Path sourcedir);
void add_file(Target destination, Path source);
Path SOURCEDIR;
};
class Module
{
public:
Module(String name);
Target get_target();
void make_global_targets();
void read_includes(List<String> includes);
};
};
static String GUI;
static String COM;
static Path INPATH;
static Path SRCDIR;
static Path OUTDIR;
static Path WORKDIR;
static bool FULL_DEPENDENCIES;
static List<gb::Module> ALL_MODULES;
static Command SHELL;
static Path CXX;
static Path GCCP;
static Target SVIDLTARGET;
static Command SVIDLCOMMAND;
static Target RSCTARGET;
static Command RSCCOMMAND;
static List<String> GLOBALDEFS;
static List<String> CFLAGSCXX;
static List<String> EXCEPTIONFLAGS;
static List<String> NOEXCEPTIONFLAGS;
static List<String> LDFLAGS;
static Integer OSL_DEBUG_LEVEL;
/* vim: set filetype=cpp : */
# -*- Mode: GNUmakefile; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2009 by Sun Microsystems, Inc.
#
# 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.
#
#*************************************************************************
define NEWLINE
endef
COMMA :=,
gb_Helper_NULLFILE := /dev/null
gb_Helper_MISC := $(WORKDIR)/Misc
gb_Helper_PHONY := $(gb_Helper_MISC)/PHONY
gb_Helper_MISCDUMMY := $(gb_Helper_MISC)/DUMMY
.PHONY : $(WORKDIR)/Misc/PHONY
$(gb_Helper_MISCDUMMY) :
@mkdir -p $(dir $@) && touch $@
define gb_Helper_announce
$(info $(1))
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))))
endef
define gb_Helper_make_clean_target
gb_$(1)_get_clean_target = $(WORKDIR)/Clean/$(1)/$$(1)
endef
define gb_Helper_make_outdir_clean_target
gb_$(1)_get_clean_target = $$(subst $(OUTDIR)/,$(WORKDIR)/Clean/OutDir/,$$(call gb_$(1)_get_target,$$(1)))
endef
define gb_Helper_make_dep_target
gb_$(1)_get_dep_target = $(WORKDIR)/Dep/$(1)/$$(1).d
endef
define gb_Helper_make_clean_targets
$(foreach targettype,$(1),\
$(call gb_Helper_make_clean_target,$(targettype)))
endef
define gb_Helper_make_outdir_clean_targets
$(foreach targettype,$(1),\
$(call gb_Helper_make_outdir_clean_target,$(targettype)))
endef
define gb_Helper_make_dep_targets
$(foreach targettype,$(1),\
$(call gb_Helper_make_dep_target,$(targettype)))
endef
define gb_Helper_get_outdir_clean_target
$$(subst $(OUTDIR)/,$(WORKDIR)/Clean/OutDir/,$(1))
endef
# vim: set noet sw=4 ts=4:
This diff is collapsed.
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2009 by Sun Microsystems, Inc.
#
# 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.
#
#*************************************************************************
gb_Library_NAMESCHEMES := OOO PLAIN RT RTVER STL UNO UNOVER
gb_Library_OOOLIBS :=\
avmedia \
basegfx \
cui \
drawinglayer \
fwe \
fwi \
fwk \
fwl \
fwm \
go \
lng \
msfilter \
msword \
sax \
sb \
sfx \
sot \
svl \
svt \
svx \
svxcore \
sw \
swd \
swui \
textconversiondlgs \
tk \
tl \
utl \
vbahelper \
vcl \
xo \
xof \
gb_Library_PLAINLIBS :=\
icuuc \
xml2 \
gb_Library_RTLIBS :=\
comphelper \
i18nisolang1 \
i18nutil \
ucbhelper \
gb_Library_RTVERLIBS :=\
cppuhelper \
salhelper \
gb_Library_STLLIBS :=\
stl \
gb_Library_UNOLIBS :=\
fsstorage \
hatchwindowfactory \
passwordcontainer \
productregistration \
vbaswobj \
gb_Library_UNOVERLIBS :=\
jvmfwk \
cppu \
sal \
gb_StaticLibrary_NAMESCHEMES := PLAIN
gb_StaticLibrary_PLAINLIBS :=\
salcpprt \
jpeglib \
zlib \
# vim: set noet sw=4 ts=4:
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2009 by Sun Microsystems, Inc.
#
# 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.
#
#*************************************************************************
GUI := unx
COM := gcc
gb_CC := gcc
gb_CXX := g++
gb_GCCP := gcc
gb_OSDEFS := \
-DLINUX \
-D_PTHREADS \
-DUNIX \
-DUNX \
$(PTHREAD_CFLAGS) \
gb_COMPILERDEFS := \
-DGCC \
-D$(CVER) \
-DCVER=$(CVER) \
-DGLIBC=2 \
-DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
-DHAVE_GCC_VISIBILITY_FEATURE \
-DCPPU_ENV=gcc3 \
ifeq ($(CPUNAME),X86_64)
gb_CPUDEFS := -D$(CPUNAME)
else
gb_CPUDEFS := -DX86
endif
gb_CFLAGS := \