newlib/winsup/Makefile.common

53 lines
1.3 KiB
Makefile

# 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 .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 $@ $<)