]> git.ipfire.org Git - thirdparty/glibc.git/blame - posix/Makefile
Pretty printing.
[thirdparty/glibc.git] / posix / Makefile
CommitLineData
3b0bdc72 1# Copyright (C) 1991-1999, 2000, 2001, 2002 Free Software Foundation, Inc.
28f540f4
RM
2# This file is part of the GNU C Library.
3
4# The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
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.
28f540f4
RM
8
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
41bdb6e2 12# Lesser General Public License for more details.
28f540f4 13
41bdb6e2
AJ
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
17# 02111-1307 USA.
28f540f4
RM
18
19#
20# Sub-makefile for POSIX portion of the library.
21#
22subdir := posix
23
7b3547eb 24headers := sys/utsname.h sys/times.h sys/wait.h sys/types.h unistd.h \
5107cf1d 25 glob.h regex.h wordexp.h fnmatch.h bits/types.h getopt.h \
9c83a5ec 26 bits/posix1_lim.h bits/posix2_lim.h bits/posix_opt.h \
5107cf1d
UD
27 bits/local_lim.h tar.h bits/utsname.h bits/confname.h \
28 bits/waitflags.h bits/waitstatus.h sys/unistd.h sched.h \
d1462d2e 29 bits/sched.h re_comp.h wait.h bits/environments.h cpio.h \
a5a6f926 30 sys/sysmacros.h spawn.h
28f540f4 31
61eb22d3 32distribute := confstr.h TESTS TESTS2C.sed testcases.h \
92040cbc 33 PTESTS PTESTS2C.sed ptestcases.h \
a5a6f926 34 globtest.c globtest.sh wordexp-tst.sh annexc.c fnmatch_loop.c \
3b0bdc72 35 spawn_int.h tst-getconf.sh regcomp.c regexec.c regex_internal.c \
d1f69fed 36 regex_internal.h fork.h
28f540f4
RM
37
38routines := \
39 uname \
40 times \
bd355af0 41 wait waitpid wait3 wait4 waitid \
7b3547eb 42 alarm sleep pause nanosleep \
e8c6a442 43 fork vfork _exit \
28f540f4
RM
44 execve fexecve execv execle execl execvp execlp \
45 getpid getppid \
3bbceb12 46 getuid geteuid getgid getegid getgroups setuid setgid group_member \
0d8733c4 47 getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid \
747bf98e 48 getresuid getresgid setresuid setresgid \
ee188d55 49 getlogin getlogin_r setlogin \
28f540f4 50 pathconf sysconf fpathconf \
a5f4e34a 51 glob glob64 fnmatch regex \
28f540f4 52 confstr \
7cc27f44 53 getopt getopt1 getopt_init \
7b3547eb 54 sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax \
972e719e 55 sched_primin sched_rr_gi sched_getaffinity sched_setaffinity \
a5a0310d 56 getaddrinfo gai_strerror wordexp \
a5a6f926
UD
57 pread pwrite pread64 pwrite64 \
58 spawn_faction_init spawn_faction_destroy spawn_faction_addclose \
59 spawn_faction_addopen spawn_faction_adddup2 \
60 spawnattr_init spawnattr_destroy \
61 spawnattr_getdefault spawnattr_setdefault \
62 spawnattr_getflags spawnattr_setflags \
afa0569f
UD
63 spawnattr_getpgroup spawnattr_setpgroup spawn spawnp spawni \
64 spawnattr_getsigmask spawnattr_getschedpolicy spawnattr_getschedparam \
65 spawnattr_setsigmask spawnattr_setschedpolicy spawnattr_setschedparam
7b3547eb 66
7cabd57c
UD
67include ../Makeconfig
68
5f9e57ba 69aux := init-posix environ
df455ccb 70tests := tstgetopt testfnm runtests runptests \
bd9df4cd 71 tst-preadwrite tst-preadwrite64 test-vfork regexbug1 \
ad92208d 72 tst-getlogin tst-mmap tst-getaddrinfo tst-truncate \
726b7b0f 73 tst-truncate64 tst-fork tst-fnmatch tst-regexloc tst-dir \
3eab00bd 74 tst-chmod bug-regex1 bug-regex2 bug-regex3 bug-regex4 \
d683fe11 75 tst-gnuglob tst-regex bug-regex5 bug-regex6 bug-regex7 \
ab635ab2 76 bug-regex8 bug-regex9 bug-regex10 bug-regex11 bug-regex12
df455ccb 77ifeq (yes,$(build-shared))
2604afb1 78test-srcs := globtest
e8c6a442 79tests += wordexp-test tst-exec tst-spawn
df455ccb 80endif
28f540f4
RM
81others := getconf
82install-bin := getconf
2b83a2a4 83gpl2lgpl := getopt.c getopt1.c getopt.h regex.c regex.h
28f540f4 84
92040cbc 85before-compile := testcases.h ptestcases.h
4cca6b86 86
414fd335 87# So they get cleaned up.
ba9234d9 88generated := $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \
cb207240 89 annexc annexc.out wordexp-tst.out bug-regex2-mem \
a3bbce5b 90 bug-regex2.mtrace tst-getconf.out
414fd335 91
28f540f4
RM
92include ../Rules
93
e1e3ba54 94ifeq (yes,$(build-static-nss))
8f3f1e09
UD
95# We need it for "make check" only. We can skip them if they haven't
96# been built yet during "make".
97otherlibs += $(wildcard $(nssobjdir)/libnss_files.a \
98 $(resolvobjdir)/libnss_dns.a \
99 $(resolvobjdir)/libresolv.a)
100endif
101
61eb22d3 102ifeq (no,$(cross-compiling))
df455ccb
AS
103# globtest and wordexp-test currently only works with shared libraries
104ifeq (yes,$(build-shared))
3f36c563
UD
105tests: $(objpfx)globtest.out $(objpfx)wordexp-tst.out
106$(objpfx)globtest.out: globtest.sh $(objpfx)globtest
31161268
UD
107 $(SHELL) -e globtest.sh $(common-objpfx) $(elf-objpfx) \
108 $(rtld-installed-name)
3f36c563 109$(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test
31161268
UD
110 $(SHELL) -e wordexp-tst.sh $(common-objpfx) $(elf-objpfx) \
111 $(rtld-installed-name)
61eb22d3 112endif
df455ccb 113endif
61eb22d3 114
3b0bdc72 115CFLAGS-regex.c = -Wno-strict-prototypes -DRE_ENABLE_I18N
46ec036d 116CFLAGS-getaddrinfo.c = -DRESOLVER
e25054c4 117tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
b64cd08a 118 --none random --col --color --colour
0793d348 119
079199de 120tst-exec-ARGS = -- $(built-program-cmd)
08c7f6b0 121tst-spawn-ARGS = -- $(built-program-cmd)
53e5cdd8 122tst-dir-ARGS = `pwd` `cd $(common-objdir)/$(subdir); pwd` `cd $(common-objdir); pwd` $(objpfx)tst-dir
55f462ed 123tst-chmod-ARGS = `pwd`
079199de 124
0d6af3a8 125tst-fnmatch-ENV = LOCPATH=$(common-objpfx)localedata
47b853e8 126tst-regexloc-ENV = LOCPATH=$(common-objpfx)localedata
5c0111e9 127bug-regex1-ENV = LOCPATH=$(common-objpfx)localedata
64333c66 128tst-regex-ENV = LOCPATH=$(common-objpfx)localedata
2f76d88d 129bug-regex5-ENV = LOCPATH=$(common-objpfx)localedata
81c64d40 130bug-regex6-ENV = LOCPATH=$(common-objpfx)localedata
0d6af3a8 131
4cca6b86
UD
132testcases.h: TESTS TESTS2C.sed
133 sed -f TESTS2C.sed < $< > $@T
134 mv -f $@T $@
880f421f 135ifeq ($(with-cvs),yes)
4eb36693 136 test ! -d CVS || cvs $(CVSOPTS) commit -mRegenerated $@
880f421f 137endif
92040cbc
UD
138
139ptestcases.h: PTESTS PTESTS2C.sed
140 sed -f PTESTS2C.sed < $< > $@T
141 mv -f $@T $@
142ifeq ($(with-cvs),yes)
143 test ! -d CVS || cvs $(CVSOPTS) commit -mRegenerated $@
144endif
4959e310
UD
145
146# Run a test on the header files we use.
147# XXX Please note that for now we ignore the result of this test.
b647f210
AJ
148tests: $(objpfx)annexc.out
149ifeq (no,$(cross-compiling))
a3bbce5b 150tests:$(objpfx)bug-regex2-mem $(objpfx)tst-getconf.out
b647f210
AJ
151endif
152
3f36c563 153$(objpfx)annexc.out: $(objpfx)annexc
8eaaffde 154 -$(dir $<)$(notdir $<) '$(CC)' \
3c26cf28 155 '-I../include -I.. $(+sysdep-includes) $(sysincludes)' > $@
4959e310 156
e69924e3 157annexc-CFLAGS = -O
4959e310
UD
158$(objpfx)annexc: annexc.c
159 $(native-compile)
770d454d
UD
160
161bug-regex2-ENV = MALLOC_TRACE=$(objpfx)bug-regex2.mtrace
162
163$(objpfx)bug-regex2-mem: $(objpfx)bug-regex2.out
164 $(common-objpfx)malloc/mtrace $(objpfx)bug-regex2.mtrace > $@
a3bbce5b
UD
165
166$(objpfx)tst-getconf.out: tst-getconf.sh $(objpfx)getconf
167 $(SHELL) -e $< $(common-objpfx) $(elf-objpfx) $(rtld-installed-name)
64333c66
UD
168
169ifeq (yes,$(build-shared))
170$(objpfx)tst-regex: $(common-objpfx)rt/librt.so
171else
172$(objpfx)tst-regex: $(common-objpfx)rt/librt.a
173endif