]> sourceware.org Git - newlib-cygwin.git/blob - winsup/testsuite/Makefile.in
Cygiwn: Detect and use MinGW compilers for testsuite wrappers
[newlib-cygwin.git] / winsup / testsuite / Makefile.in
1 # Makefile.in for Cygwin's testsuite.
2 #
3 # This file is part of Cygwin.
4 #
5 # This software is a copyrighted work licensed under the terms of the
6 # Cygwin license. Please consult the file "CYGWIN_LICENSE" for
7 # details.
8
9 # This makefile requires GNU make.
10
11 SHELL:=@SHELL@
12 srcdir:=@srcdir@
13 objdir:=.
14 libltp_srcdir=$(srcdir)/libltp
15 target_builddir:=@target_builddir@
16
17 target_alias:=@target_alias@
18 build_alias:=@build_alias@
19 host_alias:=@host_alias@
20
21 DESTDIR=
22 prefix:=${DESTDIR}@prefix@
23
24 program_transform_name:=@program_transform_name@
25 exec_prefix:=${DESTDIR}@exec_prefix@
26 bindir:=${DESTDIR}@bindir@
27 libdir:=${DESTDIR}@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 datarootdir:=@datarootdir@
38 datadir:=${DESTDIR}@datadir@
39 infodir:=${DESTDIR}@infodir@
40 includedir:=${DESTDIR}@includedir@
41
42 TESTSUP_INCLUDES:=-I$(libltp_srcdir)/include
43
44 #
45 # --enable options from configure
46 #
47
48 CC:=@CC@
49 # FIXME: Which is it, CC or CC_FOR_TARGET?
50 CC_FOR_TARGET:=$(CC)
51 ifneq (,$(CFLAGS))
52 override CFLAGS+= -MD $(TESTSUP_INCLUDES)
53 else
54 CFLAGS:=@CFLAGS@ -MD $(TESTSUP_INCLUDES)
55 endif
56
57 AR:=@AR@
58 AR_FLAGS:=qv
59 MINGW_CC:= @MINGW_CC@
60 MINGW_CXX:= @MINGW_CXX@
61
62 #
63 # Include common definitions for winsup directory
64 #
65 include $(srcdir)/../Makefile.common
66
67 VPATH+=$(libltp_srcdir)/lib
68
69 override CC:=$(CC) $(GCC_INCLUDE)
70 export CC
71
72 RUNTESTFLAGS =
73
74 ifdef VERBOSE
75 RUNTESTFLAGS = -v
76 endif
77
78 RUNTIME=$(cygwin_build)/cygwin0.dll $(cygwin_build)/libcygwin0.a
79
80 TESTSUP_LIB_NAME:=libltp.a
81 TESTSUP_OFILES:=${sort ${addsuffix .o,${basename ${notdir ${wildcard $(libltp_srcdir)/lib/*.c}}}}}
82
83 override ALL_CFLAGS:=${filter-out -O%,$(ALL_CFLAGS)}
84 override COMPILE_CC:=${filter-out -O%,$(COMPILE_CC)}
85 override CFLAGS:=${filter-out -O%,$(CFLAGS)}
86 export CFLAGS
87
88 .PHONY: all force dll_ofiles install all_target
89
90 .SUFFIXES:
91 .SUFFIXES: .c .cc .def .a .o .d
92
93 all: $(TESTSUP_LIB_NAME)
94
95 force:
96
97 install:
98
99 clean:
100 -rm -f *.o *.dll *.a *.exp junk *.bak *.base *.exe testsuite/* *.d *.dat
101
102 maintainer-clean realclean: clean
103 @echo "This command is intended for maintainers to use;"
104 @echo "it deletes files that may require special tools to rebuild."
105 -rm -fr configure
106
107 # Rule to build libltp.a
108
109 $(TESTSUP_LIB_NAME): $(TESTSUP_OFILES)
110 $(AR) rcv temp.a $(TESTSUP_OFILES)
111 mv temp.a $(TESTSUP_LIB_NAME)
112
113 $(RUNTIME) : $(cygwin_build)/Makefile
114 @$(MAKE) --no-print-dir -C $(@D) $(@F)
115
116 # Rule to make stub library used by "make check"
117
118 #\f
119
120 # These targets are for the dejagnu testsuites. The file site.exp
121 # contains global variables that all the testsuites will use.
122
123 # Set to $(target_alias)/ for cross.
124 target_subdir = @target_subdir@
125
126 site.exp: ./config.status Makefile
127 @echo "Making a new config file..."
128 -@rm -f ./tmp?
129 @touch site.exp
130 -@mv site.exp site.bak
131 @echo "## these variables are automatically generated by make ##" > ./tmp0
132 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
133 @echo "# add them to the last section" >> ./tmp0
134 @echo "set rootme \"`pwd`\"" >> ./tmp0
135 @echo "set runtime_root \"\$$rootme/../cygwin\"" >> ./tmp0
136 @echo "set srcdir \"`cd ${srcdir}; pwd`\"" >> ./tmp0
137 @echo "set host_triplet $(host_canonical)" >> ./tmp0
138 @echo "set build_triplet $(build_canonical)" >> ./tmp0
139 @echo "set target_triplet $(target)" >> ./tmp0
140 @echo "set target_alias $(target_alias)" >> ./tmp0
141 @echo "set CC \"$(CC)\"" >> ./tmp0
142 # CFLAGS is set even though it's empty to show we reserve the right to set it.
143 @echo "set CFLAGS \"$(ALL_CFLAGS)\"" >> ./tmp0
144 @echo "set MINGW_CXX \"$(MINGW_CXX)\"" >> ./tmp0
145 echo "set tmpdir $(objdir)/testsuite" >> ./tmp0
146 @echo "set ltp_includes \"$(libltp_srcdir)/include\"" >> ./tmp0
147 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
148 @cat ./tmp0 > site.exp
149 @cat site.bak | sed \
150 -e '1,/^## All variables above are.*##/ d' >> site.exp
151 -@rm -f ./tmp?
152
153 testsuite/site.exp: site.exp
154 if [ -d testsuite ]; then \
155 true; \
156 else \
157 mkdir testsuite; \
158 fi
159 rm -rf testsuite/site.exp
160 cp site.exp testsuite/site.exp
161
162 # Note: we set the PATH so that we can pick up cygwin0.dll
163
164 check: $(TESTSUP_LIB_NAME) $(RUNTIME) cygrun.exe testsuite/site.exp
165 cd testsuite; runtest --tool winsup $(RUNTESTFLAGS)
166
167 cygrun.o: cygrun.c
168 $(MINGW_CC) $(MINGW_CFLAGS) -o $@ -c $<
169
170 cygrun.exe : cygrun.o
171 $(MINGW_CC) $(MINGW_LDFLAGS) -o $@ $<
172
173 Makefile: Makefile.in $(srcdir)/configure config.status
174 $(SHELL) config.status
This page took 0.037462 seconds and 5 git commands to generate.