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

gbuild: target platform is identified by the triplet OS/CPU/COMPILER

That simplify the dispatching in gbuild.mk and gbuild_simple.mk
and it will be use as a base to factorize common stuff based
on OS and Compiler.
üst 16a1b831
......@@ -155,33 +155,8 @@ $(eval $(call gb_Helper_collect_libtargets))
gb_Library_DLLPOSTFIX := lo
ifeq ($(OS),LINUX)
include $(GBUILDDIR)/platform/linux-$(CPUNAME).mk
else ifeq ($(OS),MACOSX)
include $(GBUILDDIR)/platform/macosx.mk
else ifeq ($(OS),WNT)
ifeq ($(COM),GCC)
include $(GBUILDDIR)/platform/winmingw.mk
else
include $(GBUILDDIR)/platform/windows.mk
endif
else ifeq ($(OS),OPENBSD)
include $(GBUILDDIR)/platform/openbsd.mk
else ifeq ($(OS),FREEBSD)
include $(GBUILDDIR)/platform/freebsd.mk
else ifeq ($(OS),NETBSD)
include $(GBUILDDIR)/platform/netbsd.mk
else ifeq ($(OS),DRAGONFLY)
include $(GBUILDDIR)/platform/dragonfly.mk
else ifeq ($(OS),SOLARIS)
include $(GBUILDDIR)/platform/solaris.mk
else ifeq ($(OS),IOS)
include $(GBUILDDIR)/platform/ios.mk
else ifeq ($(OS),ANDROID)
include $(GBUILDDIR)/platform/android.mk
else
$(eval $(call gb_Output_error,Unsupported OS: $(OS)))
endif
# Include platform/cpu/compiler specific config/definitions
include $(GBUILDDIR)/platform/$(OS)_$(CPUNAME)_$(COM).mk
ifeq ($(CROSS_COMPILING),YES)
# We can safely Assume all cross-compilation is from Unix systems.
......
......@@ -82,32 +82,7 @@ endif
include $(GBUILDDIR)/Helper.mk
ifeq ($(OS),LINUX)
include $(GBUILDDIR)/platform/linux-$(CPUNAME).mk
else ifeq ($(OS),WNT)
ifeq ($(COM),GCC)
include $(GBUILDDIR)/platform/winmingw.mk
else
include $(GBUILDDIR)/platform/windows.mk
endif
else ifeq ($(OS),SOLARIS)
include $(GBUILDDIR)/platform/solaris.mk
else ifeq ($(OS),MACOSX)
include $(GBUILDDIR)/platform/macosx.mk
else ifeq ($(OS),OPENBSD)
include $(GBUILDDIR)/platform/openbsd.mk
else ifeq ($(OS),FREEBSD)
include $(GBUILDDIR)/platform/freebsd.mk
else ifeq ($(OS),NETBSD)
include $(GBUILDDIR)/platform/netbsd.mk
else ifeq ($(OS),DRAGONFLY)
include $(GBUILDDIR)/platform/dragonfly.mk
else ifeq ($(OS),IOS)
include $(GBUILDDIR)/platform/ios.mk
else ifeq ($(OS),ANDROID)
include $(GBUILDDIR)/platform/android.mk
else
$(eval $(call gb_Output_error,Unsupported OS: $(OS)))
endif
# Include platform/cpu/compiler specific config/definitions
include $(GBUILDDIR)/platform/$(OS)_$(CPUNAME)_$(COM).mk
# vim: set noet sw=4 ts=4:
......@@ -30,10 +30,7 @@
#please make generic modifications to unxgcc.mk
ifeq ($(CPUNAME),INTEL)
gb_CPUDEFS := -DX86
endif
gb_COMPILERDEFAULTOPTFLAGS := -O -g
include $(GBUILDDIR)/platform/unxgcc.mk
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
# Portions created by the Initial Developer are Copyright (C) 2010 the
# Initial Developer. All Rights Reserved.
#
# Contributor(s): Caolán McNamara <caolanm@redhat.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
#*************************************************************************
#please make generic modifications to unxgcc.mk
gb_COMPILERDEFAULTOPTFLAGS := -O -g
include $(GBUILDDIR)/platform/unxgcc.mk
gb_CppunitTest_CPPTESTPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib:/usr/pkg/lib
# vim: set noet sw=4:
......@@ -30,10 +30,7 @@
#please make generic modifications to unxgcc.mk
ifeq ($(CPUNAME),INTEL)
gb_CPUDEFS := -DX86
endif
gb_COMPILERDEFAULTOPTFLAGS := -O2
include $(GBUILDDIR)/platform/unxgcc.mk
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
# Portions created by the Initial Developer are Copyright (C) 2010 the
# Initial Developer. All Rights Reserved.
#
# Contributor(s): Caolán McNamara <caolanm@redhat.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
#*************************************************************************
#please make generic modifications to unxgcc.mk
gb_COMPILERDEFAULTOPTFLAGS := -O2
include $(GBUILDDIR)/platform/unxgcc.mk
# vim: set noet sw=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Norbert Thiébaud <nthiebaud@gmail.com>
# Portions created by the Initial Developer are Copyright (C) 2010 the
# Initial Developer. All Rights Reserved.
#
# Contributor(s): Norbert Thiébaud <nthiebaud@gmail.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
#*************************************************************************
gb_CPUDEFS := -DX86
gb_COMPILERDEFAULTOPTFLAGS := -O2
include $(GBUILDDIR)/platform/macosx.mk
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Norbert Thiébaud <nthiebaud@gmail.com>
# Portions created by the Initial Developer are Copyright (C) 2010 the
# Initial Developer. All Rights Reserved.
#
# Contributor(s): Norbert Thiébaud <nthiebaud@gmail.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
#*************************************************************************
gb_CPUDEFS := -DPPC
gb_COMPILERDEFAULTOPTFLAGS := -O2
include $(GBUILDDIR)/platform/macosx.mk
# vim: set noet sw=4 ts=4:
......@@ -30,10 +30,7 @@
#please make generic modifications to unxgcc.mk
ifeq ($(CPUNAME),INTEL)
gb_CPUDEFS := -DX86
endif
gb_COMPILERDEFAULTOPTFLAGS := -O2
include $(GBUILDDIR)/platform/unxgcc.mk
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
# Portions created by the Initial Developer are Copyright (C) 2010 the
# Initial Developer. All Rights Reserved.
#
# Contributor(s): Caolán McNamara <caolanm@redhat.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
#*************************************************************************
#please make generic modifications to unxgcc.mk
gb_COMPILERDEFAULTOPTFLAGS := -O2
include $(GBUILDDIR)/platform/unxgcc.mk
NB_ADD_LIBPATH := /usr/pkg/lib:/usr/X11R7/lib
gb_Helper_set_ld_path := LD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib:$(NB_ADD_LIBPATH)
gb_CppunitTest_CPPTESTPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib:$(NB_ADD_LIBPATH)
# vim: set noet sw=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
# Portions created by the Initial Developer are Copyright (C) 2010 the
# Initial Developer. All Rights Reserved.
#
# Contributor(s): Caolán McNamara <caolanm@redhat.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
#*************************************************************************
#please make generic modifications to unxgcc.mk
gb_COMPILERDEFAULTOPTFLAGS := -O2
include $(GBUILDDIR)/platform/unxgcc.mk
NB_ADD_LIBPATH := /usr/pkg/lib:/usr/X11R7/lib
gb_Helper_set_ld_path := LD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib:$(NB_ADD_LIBPATH)
gb_CppunitTest_CPPTESTPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib:$(NB_ADD_LIBPATH)
# vim: set noet sw=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
# Portions created by the Initial Developer are Copyright (C) 2010 the
# Initial Developer. All Rights Reserved.
#
# Contributor(s): Caolán McNamara <caolanm@redhat.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
#*************************************************************************
#please make generic modifications to unxgcc.mk
gb_COMPILERDEFAULTOPTFLAGS := -O2
include $(GBUILDDIR)/platform/unxgcc.mk
NB_ADD_LIBPATH := /usr/pkg/lib:/usr/X11R7/lib
gb_Helper_set_ld_path := LD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib:$(NB_ADD_LIBPATH)
gb_CppunitTest_CPPTESTPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib:$(NB_ADD_LIBPATH)
# vim: set noet sw=4:
......@@ -30,10 +30,7 @@
#please make generic modifications to unxgcc.mk
ifeq ($(CPUNAME),INTEL)
gb_CPUDEFS := -DX86
endif
gb_COMPILERDEFAULTOPTFLAGS := -O2
gb_STDLIBS := pthread
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
# Portions created by the Initial Developer are Copyright (C) 2010 the
# Initial Developer. All Rights Reserved.
#
# Contributor(s): Caolán McNamara <caolanm@redhat.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
#*************************************************************************
#please make generic modifications to unxgcc.mk
gb_COMPILERDEFAULTOPTFLAGS := -O2
gb_STDLIBS := pthread
include $(GBUILDDIR)/platform/unxgcc.mk
gb_LinkTarget_NOEXCEPTIONFLAGS += -DBOOST_NO_EXCEPTIONS
define gb_LinkTarget__command_dynamiclink
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
$(gb_CXX) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(subst \d,$$,$(RPATH)) \
$(T_LDFLAGS) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
$(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \
$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \
-Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \
$(LIBS) \
$(subst -lpthread,$(PTHREAD_LIBS),$(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))))) \
-o $(1))
endef
# vim: set noet sw=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Norbert Thiébaud <nthiebaud@gmail.com>
# Portions created by the Initial Developer are Copyright (C) 2010 the
# Initial Developer. All Rights Reserved.
#
# Contributor(s): Norbert Thiébaud <nthiebaud@gmail.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
#*************************************************************************
include $(GBUILDDIR)/platform/solaris.mk
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Norbert Thiébaud <nthiebaud@gmail.com>
# Portions created by the Initial Developer are Copyright (C) 2010 the
# Initial Developer. All Rights Reserved.
#
# Contributor(s): Norbert Thiébaud <nthiebaud@gmail.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
#*************************************************************************
include $(GBUILDDIR)/platform/solaris.mk
# vim: set noet sw=4 ts=4:
......@@ -27,7 +27,6 @@
#*************************************************************************
GUI := WNT
COM := GCC
gb_COMPILERDEFAULTOPTFLAGS := -Os
gb_CPUDEFS := -D_M_IX86
......
......@@ -27,7 +27,6 @@
#*************************************************************************
GUI := WNT
COM := MSC
# set tmpdir to some mixed case path, suitable for native tools
gb_TMPDIR:=$(if $(TMPDIR),$(shell cygpath -m $(TMPDIR)),$(shell cygpath -m /tmp))
......
......@@ -26,22 +26,10 @@
#
#*************************************************************************
GUI := UNX
COM := GCC
gb_SDKDIR := $(MACOSX_SDK_PATH)
ifeq ($(CPUNAME),POWERPC)
gb_CPUDEFS := -DPPC
else
gb_CPUDEFS := -DX86
endif
gb_COMPILERDEFAULTOPTFLAGS := -O2
include $(GBUILDDIR)/platform/com_GCC_defs.mk
# Darwin mktemp -t expects a prefix, not a pattern
gb_MKTEMP ?= /usr/bin/mktemp -t gbuild.
......
......@@ -27,7 +27,6 @@
#*************************************************************************
GUI := UNX
COM := GCC
gb_Executable_EXT:=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment