OSDN Git Service

Generalise makefile references to subdirectories of lib.
[pf3gnuchains/pf3gnuchains4x.git] / winsup / Makefile.in
1 # Makefile.in for windows stuff
2 # Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006,
3 # 2007, 2008
4 # Red Hat, Inc.
5 #
6 # This file is part of Cygwin.
7 #
8 # This software is a copyrighted work licensed under the terms of the
9 # Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
10 # details.
11
12 # This makefile requires GNU make.
13
14 SHELL:=@SHELL@
15 VPATH:=@srcdir@
16 srcdir:=@srcdir@
17 objdir:=.
18
19 target_alias:=@target_alias@
20 build_alias:=@build_alias@
21 host_alias:=@host_alias@
22 prefix:=@prefix@
23
24 program_transform_name:=@program_transform_name@
25 exec_prefix:=@exec_prefix@
26 bindir:=@bindir@
27 libdir:=@libdir@
28 ifeq ($(target_alias),$(host_alias))
29 ifeq ($(build_alias),$(host_alias))
30 tooldir:=$(exec_prefix)
31 else
32 tooldir:=$(exec_prefix)/$(target_alias)
33 endif
34 else
35 tooldir:=$(exec_prefix)/$(target_alias)
36 endif
37 datadir:=@datadir@
38 infodir:=@infodir@
39 includedir:=@includedir@
40
41 INSTALL:=@INSTALL@
42 INSTALL_PROGRAM:=@INSTALL_PROGRAM@
43 INSTALL_DATA:=@INSTALL_DATA@
44
45 SUBDIRS=@subdirs@
46 INSTALL_SUBDIRS=${patsubst %,install_%,$(SUBDIRS)}
47 CLEAN_SUBDIRS=${patsubst %,clean_%,$(SUBDIRS)}
48 ZLIB=${findstring zlib,$(SUBDIRS)}
49
50 INSTALL_LICENSE:=@INSTALL_LICENSE@
51
52 .PHONY: all install clean all-info info install-info install-license check \
53         $(SUBDIRS) $(INSTALL_SUBDIRS) $(CLEAN_SUBDIRS)
54
55 .SUFFIXES:
56
57 MAKEOVERRIDES_WORKAROUND=${wordlist 2,1,a b c}
58
59 ifneq ($(MAKEOVERRIDES_WORKAROUND),)
60     override MAKE:=$(MAKE) $(MAKEOVERRIDES)
61     MAKEOVERRIDES:=
62     export MAKEOVERRIDES
63 endif
64
65 all: Makefile $(SUBDIRS)
66
67 install-license: CYGWIN_LICENSE COPYING
68         ${INSTALL} -d $(DESTDIR)$(prefix)/share/doc/Cygwin
69         for i in $^; do \
70           ${INSTALL} $$i $(DESTDIR)$(prefix)/share/doc/Cygwin ; \
71         done
72
73 install: Makefile $(INSTALL_LICENSE) $(INSTALL_SUBDIRS)
74
75 clean: $(CLEAN_SUBDIRS)
76
77 all-info:
78
79 install-info:
80
81 info:
82
83 $(SUBDIRS):
84         @if cd $@ 2>/dev/null; then \
85             test "$@" = "mingw" && export DISTCC_HOSTS=localhost;\
86             $(MAKE) all || exit 1; \
87         fi || exit 0
88
89 $(INSTALL_SUBDIRS):
90         @if cd ${patsubst install_%,%,$@} 2>/dev/null; then \
91             $(MAKE) install || exit 1; \
92         fi || exit 0
93
94 $(CLEAN_SUBDIRS):
95         @if cd ${patsubst clean_%,%,$@} 2>/dev/null; then \
96             $(MAKE) clean || exit 1; \
97         fi || exit 0
98
99 .PRECIOUS: Makefile
100
101 Makefile: Makefile.in $(srcdir)/configure.in config.status
102         $(SHELL) config.status
103
104 config.status: configure
105         $(SHELL) config.status --recheck
106
107 # The below rule is intended to run configure only when "make check" is
108 # actually specified, i.e., not in a cross-compilation environment.  The
109 # cygwin configuration is copied and modified to ensure that the same configuration
110 # parameters are passed when the testsuite is configured as when cygwin was configured.
111 check: cygwin
112         @if [ -f testsuite/config.status ]; then \
113             cd testsuite; \
114         else \
115             (mkdir testsuite 2>/dev/null || exit 0); \
116             cd testsuite; \
117             sed -e 's%winsup/cygwin\>%winsup/testsuite%g' ../cygwin/config.status > config.status; \
118             chmod a+x config.status; \
119             sh ./config.status --recheck; \
120             sh ./config.status; \
121         fi; \
122         $(MAKE) check
123
124 utils: cygwin mingw
125
126 mingw: w32api
127
128 cygwin: w32api
129
130 cygserver: cygwin
131
132 install_utils: cygwin mingw
133
134 install_mingw: w32api
135
136 install_cygwin: w32api
137
138 install_cygserver: cygwin
139
140 lsaauth: mingw cygwin