diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2012-09-13 23:53:04 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2012-09-13 23:53:04 +0400 |
commit | e45104d1c2e38e411a56a8083339eabc60bb3f44 (patch) | |
tree | bd7b9fed7bd4ef0b723f8bd5ef21f2e2778cd3d8 /rules/common.mk | |
download | cibs-e45104d1c2e38e411a56a8083339eabc60bb3f44.tar.gz |
Initial commit: can build c-ares
Diffstat (limited to 'rules/common.mk')
-rw-r--r-- | rules/common.mk | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/rules/common.mk b/rules/common.mk new file mode 100644 index 0000000..ebfd992 --- /dev/null +++ b/rules/common.mk @@ -0,0 +1,90 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license +# at http://www.opensource.org/licenses/CDDL-1.0 +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each file. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright (C) 2012, Nexenta Systems, Inc. All rights reserved. +# + +# include guard: +ifeq (,$(__common_mk)) + +mach := $(shell uname -p) +mach32 := +mach64 := amd64 + +workdir := $(CURDIR)/work +sourcedir := $(workdir)/source +destdir := $(workdir)/proto +builddir.32 := $(workdir)/build/32 +builddir.64 := $(workdir)/build/64 + +CC.32 = gcc -m32 +CC.64 = gcc -m64 +CXX.32 = g++ -m32 +CXX.64 = g++ -m64 + +export PATH := \ + /usr/gcc/4.4/bin:/usr/gcc/4.3/bin:/usr/gnu/bin:/usr/sbin:/usr/bin:/sbin + +# Define LOCAL_MIRROR in environment, e. g. in ~/.bash_profile: +mirrors := $(LOCAL_MIRROR) \ + http://mirror.yandex.ru/gentoo-distfiles/distfiles \ + http://mirror.ovh.net/gentoo-distfiles/distfiles + +prefix = /usr +libdir.32 = $(prefix)/lib/$(mach32) +libdir.64 = $(prefix)/lib/$(mach64) +bindir.32 = $(prefix)/bin/$(mach32) +bindir.64 = $(prefix)/bin/$(mach64) +includedir.32 = /usr/include +includedir.64 = /usr/include + +PKG_CONFIG_PATH.32 = /usr/gnu/lib/$(mach32)/pkg-config:/usr/lib/$(mach32)/pkg-config +PKG_CONFIG_PATH.64 = /usr/gnu/lib/$(mach64)/pkg-config:/usr/lib/$(mach.64)/pkg-config +export PKG_CONFIG_PATH = PKG_CONFIG_PATH.$(bits) + +# $(bits) are target-specific and defined in 32.mk or 64.mk +bindir = $(bindir.$(bits)) +libdir = $(libdir.$(bits)) +includedir = $(includedir.$(bits)) +CC = $(CC.$(bits)) +CXX = $(CXX.$(bits)) +builddir = $(builddir.$(bits)) + + + +# Common targets for internal usage. +# Some modules (e. g. 32.mk, autotools.mk) add dependencies +# to this, for example configure with autotools +unpack-stamp patch-stamp configure-stamp build-stamp install-stamp: + touch $@ + +# Common target to use from command line +# or in component top-level Makefile: +unpack :: unpack-stamp +patch :: patch-stamp +configure :: configure-stamp +build :: build-stamp +install :: install-stamp +clean :: + rm -f *-stamp + rm -rf $(workdir) + +__common_mk := included +endif |