2000-02-17 20:38:33 +01:00
|
|
|
# Makefile.common - common definitions for the winsup directory
|
|
|
|
#
|
2012-07-30 06:43:22 +02:00
|
|
|
# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2009, 2012 Red Hat, Inc.
|
2000-02-17 20:38:33 +01: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 14:22:47 +01:00
|
|
|
define justdir
|
|
|
|
$(patsubst %/,%,$(dir $1))
|
|
|
|
endef
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2012-11-23 14:22:47 +01:00
|
|
|
define libname
|
|
|
|
$(realpath $(shell ${CC} --print-file-name=$1 $2))
|
|
|
|
endef
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2012-11-23 14:22:47 +01:00
|
|
|
export PATH:=${winsup_srcdir}:${PATH}
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2012-11-23 14:22:47 +01:00
|
|
|
# Allow CFLAGS=-O,-g to control CXXFLAGS too
|
2014-01-22 19:00:24 +01:00
|
|
|
opt=$(filter -O%,${CFLAGS}) $(filter -g%,${CFLAGS})
|
|
|
|
override CXXFLAGS:=${filter-out -g%,$(filter-out -O%,${CXXFLAGS})} ${opt}
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2012-11-23 14:22:47 +01:00
|
|
|
cflags_common:=-Wall -Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0
|
2014-08-07 18:19:09 +02:00
|
|
|
COMPILE.cc=c++wrap ${CXXFLAGS} -fno-rtti -fno-exceptions -fno-use-cxa-atexit ${cflags_common}
|
2012-11-23 14:22:47 +01:00
|
|
|
COMPILE.c=ccwrap ${CFLAGS} ${cflags_common}
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2012-11-23 14:22:47 +01:00
|
|
|
top_srcdir:=$(call justdir,${winsup_srcdir})
|
|
|
|
top_builddir:=$(call justdir,${target_builddir})
|
2003-04-19 03:02:51 +02:00
|
|
|
|
2012-11-23 14:22:47 +01:00
|
|
|
cygwin_build:=${target_builddir}/winsup/cygwin
|
|
|
|
newlib_build:=${target_builddir}/newlib
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2012-11-23 14:22:47 +01:00
|
|
|
nostdlib:=-nostdlib
|
2000-10-01 06:32:36 +02:00
|
|
|
|
2012-11-23 14:22:47 +01:00
|
|
|
VPATH:=${srcdir}
|
2000-10-02 04:05:23 +02:00
|
|
|
|
2012-11-23 14:22:47 +01:00
|
|
|
.SUFFIXES:
|
2013-06-18 11:45:16 +02:00
|
|
|
.SUFFIXES: .c .cc .def .S .a .o .d .s .E
|
2000-02-17 20:38:33 +01:00
|
|
|
|
|
|
|
%.o: %.cc
|
2012-11-23 14:22:47 +01:00
|
|
|
$(strip ${COMPILE.cc} -c -o $@ $<)
|
2000-02-17 20:38:33 +01:00
|
|
|
|
|
|
|
%.o: %.c
|
2012-11-23 14:22:47 +01:00
|
|
|
$(strip ${COMPILE.c} -c -o $@ $<)
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2012-11-23 14:22:47 +01:00
|
|
|
%.E: %.cc
|
|
|
|
$(strip ${COMPILE.cc} -E -dD -o $@ $<)
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2012-11-23 14:22:47 +01:00
|
|
|
%.E: %.c
|
|
|
|
$(strip ${COMPILE.c} -E -dD -o $@ $<)
|
2013-06-18 11:45:16 +02:00
|
|
|
|
|
|
|
%.o: %.S
|
|
|
|
$(strip ${COMPILE.S} -c -o $@ $<)
|