2000-02-18 03:38:33 +08:00
|
|
|
# Makefile.common - common definitions for the winsup directory
|
|
|
|
#
|
2012-07-30 12:43:22 +08:00
|
|
|
# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2009, 2012 Red Hat, Inc.
|
2000-02-18 03:38:33 +08:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
define justdir
|
|
|
|
$(patsubst %/,%,$(dir $1))
|
|
|
|
endef
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
define libname
|
|
|
|
$(realpath $(shell ${CC} --print-file-name=$1 $2))
|
|
|
|
endef
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
export PATH:=${winsup_srcdir}:${PATH}
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
# 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}
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
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}
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
top_srcdir:=$(call justdir,${winsup_srcdir})
|
|
|
|
top_builddir:=$(call justdir,${target_builddir})
|
2003-04-19 09:02:51 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
cygwin_build:=${target_builddir}/winsup/cygwin
|
|
|
|
newlib_build:=${target_builddir}/newlib
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
nostdlib:=-nostdlib
|
2000-10-01 12:32:36 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
VPATH:=${srcdir}
|
2000-10-02 10:05:23 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
.SUFFIXES:
|
2013-06-18 17:45:16 +08:00
|
|
|
.SUFFIXES: .c .cc .def .S .a .o .d .s .E
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
%.o: %.cc
|
2012-11-23 21:22:47 +08:00
|
|
|
$(strip ${COMPILE.cc} -c -o $@ $<)
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
%.o: %.c
|
2012-11-23 21:22:47 +08:00
|
|
|
$(strip ${COMPILE.c} -c -o $@ $<)
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
%.E: %.cc
|
|
|
|
$(strip ${COMPILE.cc} -E -dD -o $@ $<)
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
%.E: %.c
|
|
|
|
$(strip ${COMPILE.c} -E -dD -o $@ $<)
|
2013-06-18 17:45:16 +08:00
|
|
|
|
|
|
|
%.o: %.S
|
|
|
|
$(strip ${COMPILE.S} -c -o $@ $<)
|