Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Makefile.common « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c71845c474e315d2f322cf077d882ede9e9c019f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Makefile.common - common definitions for the winsup directory
#
# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2009, 2012 Red Hat, Inc.
#
# This file is part of Cygwin.
#
# This software is a copyrighted work licensed under the terms of the
# Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
# details.

define justdir
$(patsubst %/,%,$(dir $1))
endef

define libname
$(realpath $(shell ${CC} --print-file-name=$1 $2))
endef

export PATH:=${winsup_srcdir}:${PATH}

# Allow CFLAGS=-O,-g to control CXXFLAGS too
opt=$(filter -O%,${CFLAGS}) $(filter -g,${CFLAGS})
override CXXFLAGS:=${filter-out -g,$(filter-out -O%,${CXXFLAGS})} ${opt}

cflags_common:=-Wall -Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0
COMPILE.cc=c++wrap ${CXXFLAGS} -fno-rtti -fno-exceptions ${cflags_common}
COMPILE.c=ccwrap ${CFLAGS} ${cflags_common}

top_srcdir:=$(call justdir,${winsup_srcdir})
top_builddir:=$(call justdir,${target_builddir})

cygwin_build:=${target_builddir}/winsup/cygwin
newlib_build:=${target_builddir}/newlib

nostdlib:=-nostdlib

VPATH:=${srcdir}

.SUFFIXES:
.SUFFIXES: .c .cc .def .S .a .o .d .s .E

%.o: %.cc
	$(strip ${COMPILE.cc} -c -o $@ $<)

%.o: %.c
	$(strip ${COMPILE.c} -c -o $@ $<)

%.E: %.cc
	$(strip ${COMPILE.cc} -E -dD -o $@ $<)

%.E: %.c
	$(strip ${COMPILE.c} -E -dD -o $@ $<)

%.o: %.S
	$(strip ${COMPILE.S} -c -o $@ $<)