1 # Copyright (C) 1991-1999, 2000 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 Library General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # 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 # Library General Public License for more details.
14 # You should have received a copy of the GNU Library General Public
15 # License along with the GNU C Library; see the file COPYING.LIB. If not,
16 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 # Boston, MA 02111-1307, USA.
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 bits
/types.h getopt.h \
26 bits
/posix1_lim.h bits
/posix2_lim.h bits
/posix_opt.h \
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 \
29 bits
/sched.h re_comp.h wait.h bits
/environments.h cpio.h \
30 sys
/sysmacros.h spawn.h
32 distribute
:= confstr.h TESTS TESTS2C.sed testcases.h \
33 PTESTS PTESTS2C.sed ptestcases.h \
34 globtest.c globtest.sh wordexp-tst.sh annexc.c fnmatch_loop.c \
40 wait waitpid wait3 wait4 waitid \
41 alarm sleep pause nanosleep \
43 execve fexecve execv execle execl execvp execlp \
45 getuid geteuid getgid getegid getgroups setuid setgid group_member \
46 getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid \
47 getlogin getlogin_r setlogin \
48 pathconf sysconf fpathconf \
49 glob glob64 fnmatch regex \
51 getopt getopt1 getopt_init \
52 sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax \
53 sched_primin sched_rr_gi \
54 getaddrinfo gai_strerror wordexp \
55 pread pwrite pread64 pwrite64 \
56 spawn_faction_init spawn_faction_destroy spawn_faction_addclose \
57 spawn_faction_addopen spawn_faction_adddup2 \
58 spawnattr_init spawnattr_destroy \
59 spawnattr_getdefault spawnattr_setdefault \
60 spawnattr_getflags spawnattr_setflags \
61 spawnattr_getpgroup spawnattr_setpgroup spawn spawnp spawni
65 aux
:= init-posix environ
66 tests
:= tstgetopt testfnm runtests runptests \
67 tst-preadwrite test-vfork regexbug1 tst-getlogin tst-mmap \
69 ifeq (yes
,$(build-shared
))
74 install-bin
:= getconf
75 ifeq (yes
,$(build-static
))
76 install-lib
:= libposix.a
78 gpl2lgpl
:= getopt.c getopt1.c getopt.h regex.c regex.h
80 before-compile
:= testcases.h ptestcases.h
82 # So they get cleaned up.
83 generated
:= $(addprefix wordexp-test-result
, 1 2 3 4 5 6 7 8 9 10) \
88 ifeq (no
,$(cross-compiling
))
89 # globtest and wordexp-test currently only works with shared libraries
90 ifeq (yes
,$(build-shared
))
91 .PHONY
: do-globtest do-wordexp-test
92 tests
: do-globtest do-wordexp-test
93 do-globtest
: $(objpfx
)globtest
94 $(SHELL
) -e globtest.sh
$(common-objpfx
) $(elf-objpfx
) \
95 $(rtld-installed-name
)
96 do-wordexp-test
: $(objpfx
)wordexp-test
97 $(SHELL
) -e wordexp-tst.sh
$(common-objpfx
) $(elf-objpfx
) \
98 $(rtld-installed-name
)
102 CFLAGS-regex.c
= -Wno-strict-prototypes
103 CFLAGS-getaddrinfo.c
= -DRESOLVER
105 $(objpfx
)libposix.a
: $(dep-dummy-lib
); $(make-dummy-lib
)
106 lib
: $(objpfx
)libposix.a
108 testcases.h
: TESTS TESTS2C.sed
109 sed
-f TESTS2C.sed
< $< > $@T
111 ifeq ($(with-cvs
),yes
)
112 test ! -d CVS || cvs
$(CVSOPTS
) commit
-mRegenerated
$@
115 ptestcases.h
: PTESTS PTESTS2C.sed
116 sed
-f PTESTS2C.sed
< $< > $@T
118 ifeq ($(with-cvs
),yes
)
119 test ! -d CVS || cvs
$(CVSOPTS
) commit
-mRegenerated
$@
122 # Make the standalone glob/fnmatch package.
124 glob.
tar: glob
/ChangeLog glob
/COPYING.LIB \
125 glob
/Makefile.in glob
/configure glob
/configure.in glob
/configure.bat\
126 glob
/SCOPTIONS glob
/SMakefile glob
/Makefile.ami \
127 glob
/fnmatch.h glob
/glob.h glob
/fnmatch.c glob
/glob.c
128 tar cho
$(verbose
)f
$@
$^
136 glob
/configure
: glob
/configure.in
137 cd glob
&& autoconf
$(ACFLAGS
)
138 ifeq ($(with-cvs
),yes
)
139 test ! -d CVS || cvs
$(CVSOPTS
) commit
-m
'Regenerated: autoconf $(ACFLAGS) $<' $@
142 glob
/ChangeLog
: ..
/ChangeLog
143 changelog-extract
--regexp
'posix/(glob|fnmatch).*' < $< > $@.new
146 ifeq ($(with-cvs
),yes
)
147 test ! -d CVS || cvs
$(CVSOPTS
) commit
-mRegenerated
$@
151 compress
-c
$< > $@
-tmp
154 gzip
-9v
-c
$< > $@
-tmp
157 # Run a test on the header files we use.
158 # XXX Please note that for now we ignore the result of this test.
159 tests
: $(objpfx
)annexc
160 -$(dir $<)$(notdir $<) '$(CC)' \
161 '-I../include -I.. $(+sysdep-includes)' > $<.out
163 $(objpfx
)annexc
: annexc.c