1 # Copyright (C) 1991-1999, 2000, 2001, 2002 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, write to the Free
16 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 # Sub-makefile for POSIX portion of the library.
24 headers
:= sys
/utsname.h sys
/times.h sys
/wait.h sys
/types.h unistd.h \
25 glob.h regex.h wordexp.h fnmatch.h getopt.h \
26 bits
/types.h bits
/typesizes.h \
27 bits
/posix1_lim.h bits
/posix2_lim.h bits
/posix_opt.h \
28 bits
/local_lim.h
tar.h bits
/utsname.h bits
/confname.h \
29 bits
/waitflags.h bits
/waitstatus.h sys
/unistd.h sched.h \
30 bits
/sched.h re_comp.h wait.h bits
/environments.h cpio.h \
31 sys
/sysmacros.h spawn.h
33 distribute
:= confstr.h TESTS TESTS2C.sed testcases.h \
34 PTESTS PTESTS2C.sed ptestcases.h \
35 globtest.c globtest.sh wordexp-tst.sh annexc.c fnmatch_loop.c \
36 spawn_int.h tst-getconf.sh regcomp.c regexec.c regex_internal.c \
37 regex_internal.h fork.h
42 wait waitpid wait3 wait4 waitid \
43 alarm sleep pause nanosleep \
45 execve fexecve execv execle execl execvp execlp \
47 getuid geteuid getgid getegid getgroups setuid setgid group_member \
48 getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid \
49 getresuid getresgid setresuid setresgid \
50 getlogin getlogin_r setlogin \
51 pathconf sysconf fpathconf \
52 glob glob64 fnmatch regex \
54 getopt getopt1 getopt_init \
55 sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax \
56 sched_primin sched_rr_gi sched_getaffinity sched_setaffinity \
57 getaddrinfo gai_strerror wordexp \
58 pread pwrite pread64 pwrite64 \
59 spawn_faction_init spawn_faction_destroy spawn_faction_addclose \
60 spawn_faction_addopen spawn_faction_adddup2 \
61 spawnattr_init spawnattr_destroy \
62 spawnattr_getdefault spawnattr_setdefault \
63 spawnattr_getflags spawnattr_setflags \
64 spawnattr_getpgroup spawnattr_setpgroup spawn spawnp spawni \
65 spawnattr_getsigmask spawnattr_getschedpolicy spawnattr_getschedparam \
66 spawnattr_setsigmask spawnattr_setschedpolicy spawnattr_setschedparam
70 aux
:= init-posix environ
71 tests
:= tstgetopt testfnm runtests runptests \
72 tst-preadwrite tst-preadwrite64 test-vfork regexbug1 \
73 tst-getlogin tst-mmap tst-getaddrinfo tst-truncate \
74 tst-truncate64 tst-fork tst-fnmatch tst-regexloc tst-dir \
75 tst-chmod bug-regex1 bug-regex2 bug-regex3 bug-regex4 \
76 tst-gnuglob tst-regex bug-regex5 bug-regex6 bug-regex7 \
77 bug-regex8 bug-regex9 bug-regex10 bug-regex11 bug-regex12 \
78 bug-regex13 bug-regex14
79 ifeq (yes
,$(build-shared
))
81 tests
+= wordexp-test tst-exec tst-spawn
84 install-bin
:= getconf
85 gpl2lgpl
:= getopt.c getopt1.c getopt.h regex.c regex.h
87 before-compile
:= testcases.h ptestcases.h
89 # So they get cleaned up.
90 generated
:= $(addprefix wordexp-test-result
, 1 2 3 4 5 6 7 8 9 10) \
91 annexc annexc.out wordexp-tst.out bug-regex2-mem \
92 bug-regex2.mtrace bug-regex14-mem bug-regex14.mtrace \
97 ifeq (yes
,$(build-static-nss
))
98 # We need it for "make check" only. We can skip them if they haven't
99 # been built yet during "make".
100 otherlibs
+= $(wildcard $(nssobjdir
)/libnss_files.a \
101 $(resolvobjdir
)/libnss_dns.a \
102 $(resolvobjdir
)/libresolv.a
)
105 ifeq (no
,$(cross-compiling
))
106 # globtest and wordexp-test currently only works with shared libraries
107 ifeq (yes
,$(build-shared
))
108 tests
: $(objpfx
)globtest.out
$(objpfx
)wordexp-tst.out
109 $(objpfx
)globtest.out
: globtest.sh
$(objpfx
)globtest
110 $(SHELL
) -e globtest.sh
$(common-objpfx
) $(elf-objpfx
) \
111 $(rtld-installed-name
)
112 $(objpfx
)wordexp-tst.out
: wordexp-tst.sh
$(objpfx
)wordexp-test
113 $(SHELL
) -e wordexp-tst.sh
$(common-objpfx
) $(elf-objpfx
) \
114 $(rtld-installed-name
)
118 CFLAGS-regex.c
= -Wno-strict-prototypes
-DRE_ENABLE_I18N
119 CFLAGS-getaddrinfo.c
= -DRESOLVER
120 tstgetopt-ARGS
= -a
-b
-cfoobar
--required foobar
--optional
=bazbug \
121 --none random
--col
--color
--colour
123 tst-exec-ARGS
= -- $(built-program-cmd
)
124 tst-spawn-ARGS
= -- $(built-program-cmd
)
125 tst-dir-ARGS
= `pwd` `cd $(common-objdir)/$(subdir); pwd` `cd $(common-objdir); pwd` $(objpfx
)tst-dir
126 tst-chmod-ARGS
= `pwd`
128 tst-fnmatch-ENV
= LOCPATH
=$(common-objpfx
)localedata
129 tst-regexloc-ENV
= LOCPATH
=$(common-objpfx
)localedata
130 bug-regex1-ENV
= LOCPATH
=$(common-objpfx
)localedata
131 tst-regex-ENV
= LOCPATH
=$(common-objpfx
)localedata
132 bug-regex5-ENV
= LOCPATH
=$(common-objpfx
)localedata
133 bug-regex6-ENV
= LOCPATH
=$(common-objpfx
)localedata
135 testcases.h
: TESTS TESTS2C.sed
136 sed
-f TESTS2C.sed
< $< > $@T
138 ifeq ($(with-cvs
),yes
)
139 test ! -d CVS || cvs
$(CVSOPTS
) commit
-mRegenerated
$@
142 ptestcases.h
: PTESTS PTESTS2C.sed
143 sed
-f PTESTS2C.sed
< $< > $@T
145 ifeq ($(with-cvs
),yes
)
146 test ! -d CVS || cvs
$(CVSOPTS
) commit
-mRegenerated
$@
149 # Run a test on the header files we use.
150 # XXX Please note that for now we ignore the result of this test.
151 tests
: $(objpfx
)annexc.out
152 ifeq (no
,$(cross-compiling
))
153 tests
:$(objpfx
)bug-regex2-mem
$(objpfx
)bug-regex14-mem
$(objpfx
)tst-getconf.out
156 $(objpfx
)annexc.out
: $(objpfx
)annexc
157 -$(dir $<)$(notdir $<) '$(CC)' \
158 '-I../include -I.. $(+sysdep-includes) $(sysincludes)' > $@
161 $(objpfx
)annexc
: annexc.c
164 bug-regex2-ENV
= MALLOC_TRACE
=$(objpfx
)bug-regex2.mtrace
166 $(objpfx
)bug-regex2-mem
: $(objpfx
)bug-regex2.out
167 $(common-objpfx
)malloc
/mtrace
$(objpfx
)bug-regex2.mtrace
> $@
169 bug-regex14-ENV
= MALLOC_TRACE
=$(objpfx
)bug-regex14.mtrace
171 $(objpfx
)bug-regex14-mem
: $(objpfx
)bug-regex14.out
172 $(common-objpfx
)malloc
/mtrace
$(objpfx
)bug-regex14.mtrace
> $@
174 $(objpfx
)tst-getconf.out
: tst-getconf.sh
$(objpfx
)getconf
175 $(SHELL
) -e
$< $(common-objpfx
) $(elf-objpfx
) $(rtld-installed-name
)
177 ifeq (yes
,$(build-shared
))
178 $(objpfx
)tst-regex
: $(common-objpfx
)rt
/librt.so
180 $(objpfx
)tst-regex
: $(common-objpfx
)rt
/librt.a