mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-20 13:29:24 +08:00
b55e3f1916
ccwrap massages the compiler's standard include directories to remove '/usr/include/w32api', with the intent of allowing it to be overriden by '--with-windows-headers' (See 4c36016b). I'm not 100% convinced that this is always working as desired, since in some places w32api includes are done using <w32api/something.h>, which will find them via the path /usr/include. If this does turn out to be needed, this could also be implemented by constructing the appropriate compiler flags once, rather than on every compiler invocation.
54 lines
1.3 KiB
Makefile
54 lines
1.3 KiB
Makefile
# Makefile.common - common definitions for the winsup directory
|
|
#
|
|
# 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=${CXX} ${INCLUDES} ${CXXFLAGS} -fno-rtti -fno-exceptions -fno-use-cxa-atexit ${cflags_common}
|
|
COMPILE.c=${CC} ${INCLUDES} ${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 $@ $<)
|