diff options
Diffstat (limited to 'winsup/Makefile.common')
-rw-r--r-- | winsup/Makefile.common | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/winsup/Makefile.common b/winsup/Makefile.common new file mode 100644 index 0000000..c614342 --- /dev/null +++ b/winsup/Makefile.common @@ -0,0 +1,127 @@ +# Makefile.common - common definitions for the winsup directory +# +# Copyright 2000 Cygnus Solutions. +# +# 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. + +# This makefile requires GNU make. + +CFLAGS_COMMON:=-Wall -Wwrite-strings # -finline-functions +MALLOC_DEBUG:=#-DMALLOC_DEBUG -I/gotham/src/comp-tools/winsup/dlmalloc +MALLOC_OBJ:=#/gotham/src/comp-tools/winsup/dlmalloc/malloc.o + +ifeq (,${findstring /,$(srcdir)}) + updir:=$(srcdir)/.. + updir1:=$(updir)/.. +else + updir:=${patsubst %:::,%,${patsubst %/:::,%,$(dir $(srcdir)):::}} +ifneq (,${findstring /,$(updir)}) + updir1:=${patsubst %:::,%,${patsubst %/:::,%,$(dir $(updir)):::}} +else + updir1:=$(updir)/.. +endif +endif + + +pwd:=${shell pwd} +ifeq (,${findstring /,$(pwd)}) + bupdir:=.. + bupdir1:=../.. +else + bupdir:=${patsubst %:::,%,${patsubst %/:::,%,$(dir $(pwd)):::}} +ifneq (,${findstring /,$(bupdir)}) + bupdir1:=${patsubst %:::,%,${patsubst %/:::,%,$(dir $(bupdir)):::}} +else + bupdir1:=$(bupdir)/.. +endif +endif + +w32api_source:=$(updir)/w32api +w32api_build:=$(bupdir)/w32api +w32api_include:=$(w32api_source)/include +w32api_lib:=$(w32api_build)/lib +newlib_source:=$(updir1)/newlib +newlib_build:=$(bupdir1)/newlib +cygwin_build:=$(bupdir)/cygwin +cygwin_source:=$(updir)/cygwin +mingw_build:=$(bupdir)/mingw +mingw_source:=$(updir)/mingw +utils_build:=$(bupdir)/utils +utils_source:=$(updir)/utils + +INCLUDES:=-I. -I$(cygwin_source)/include -I$(cygwin_source) -I$(newlib_source)/libc/sys/cygwin -I$(newlib_source)/libc/include -I$(w32api_include) +ifdef CONFIG_DIR +INCLUDES+=-I$(CONFIG_DIR) +endif + +MINGW_INCLUDES:=-I$(updir)/mingw/include $(INCLUDES) + +GCC_DEFAULT_OPTIONS:=$(CFLAGS_COMMON) $(CFLAGS_CONFIG) $(INCLUDES) + +# Link in libc and libm from newlib + +LIBC:=$(newlib_build)/libc/libc.a +LIBM:=$(newlib_build)/libm/libm.a +CRT0:=$(newlib_build)/libc/crt0.o + +ALL_CFLAGS:=$(DEFS) $(MALLOC_DEBUG) $(CFLAGS) $(GCC_DEFAULT_OPTIONS) +ALL_CXXFLAGS:=$(DEFS) $(MALLOC_DEBUG) $(CXXFLAGS) $(GCC_DEFAULT_OPTIONS) + +ifndef PREPROCESS +c=-c +o=.o +else +c=-E +o=.E +endif + +LIBGCC:=${subst \,/,${shell $(CC_FOR_TARGET) -print-libgcc-file-name}} +GCC_INCLUDE:=${dir $(LIBGCC)}/include + +COMPILE_CXX:=$(CC) $c -nostdinc++ $(ALL_CXXFLAGS) -I$(GCC_INCLUDE) \ + -fno-rtti -fno-exceptions +COMPILE_CC:=$(CC) $c -nostdinc $(ALL_CFLAGS) -I$(GCC_INCLUDE) + +vpath %.a $(cygwin_build):$(w32api_lib):$(newlib_build)/libc:$(newlib_build)/libm + +unexport MAKEOVERRIDES + +.PRECIOUS: %.o + +%.o: %.cc +ifdef VERBOSE + $(COMPILE_CXX) -o $(@D)/$(*F)$o $< +else + @echo $(CC) $c $(CXXFLAGS) -o $(@D)/$(*F)$o ${subst $(srcdir)/,,$<}; \ + $(COMPILE_CXX) -o $(@D)/$(*F)$o $< +endif + +%.o: %.c +ifdef VERBOSE + $(COMPILE_CC) -o $(@D)/$(*F)$o $< +else + @echo $(CC) $c $(CFLAGS) -o $(@D)/$(*F)$o ${subst $(srcdir)/,,$<}; \ + $(COMPILE_CC) -o $(@D)/$(*F)$o $< +endif + +$(bupdir1)/libiberty/%.o: $(updir1)/libiberty/%.c + @$(MAKE) -C $(@D) $(MAKEOVERRIDES) $(@F) + +$(w32api_lib)/%.a: $(w32api_lib)/Makefile + @$(MAKE) --no-print-dir -C $(@D) $(MAKEOVERRIDES) $(@F) + +all: + +# For auto-rebuilding the Makefile + +.PRECIOUS: Makefile + +Makefile: Makefile.in $(srcdir)/configure.in config.status + $(SHELL) config.status + +config.status: configure + $(SHELL) config.status --recheck |