]>
Commit | Line | Data |
---|---|---|
d0ab7780 | 1 | # Copyright (C) 1991,92,93,94,95,96,97,98,99 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 | |
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. | |
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 | |
12 | # Library General Public License for more details. | |
13 | ||
14 | # You should have received a copy of the GNU Library General Public | |
d38cd08c UD |
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. | |
28f540f4 RM |
18 | |
19 | # | |
20 | # Sub-makefile for POSIX portion of the library. | |
21 | # | |
22 | subdir := posix | |
23 | ||
7b3547eb | 24 | headers := sys/utsname.h sys/times.h sys/wait.h sys/types.h unistd.h \ |
5107cf1d UD |
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 \ | |
d64fae6a | 29 | bits/sched.h re_comp.h wait.h bits/environments.h cpio.h |
28f540f4 | 30 | |
61eb22d3 | 31 | distribute := confstr.h TESTS TESTS2C.sed testcases.h \ |
92040cbc | 32 | PTESTS PTESTS2C.sed ptestcases.h \ |
ba9234d9 | 33 | globtest.c globtest.sh wordexp-tst.sh annexc.c |
28f540f4 RM |
34 | |
35 | routines := \ | |
36 | uname \ | |
37 | times \ | |
bd355af0 | 38 | wait waitpid wait3 wait4 waitid \ |
7b3547eb | 39 | alarm sleep pause nanosleep \ |
28f540f4 RM |
40 | fork vfork _exit \ |
41 | execve fexecve execv execle execl execvp execlp \ | |
42 | getpid getppid \ | |
3bbceb12 | 43 | getuid geteuid getgid getegid getgroups setuid setgid group_member \ |
0d8733c4 | 44 | getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid \ |
ee188d55 | 45 | getlogin getlogin_r setlogin \ |
28f540f4 | 46 | pathconf sysconf fpathconf \ |
a5f4e34a | 47 | glob glob64 fnmatch regex \ |
28f540f4 | 48 | confstr \ |
7cc27f44 | 49 | getopt getopt1 getopt_init \ |
7b3547eb | 50 | sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax \ |
46ec036d | 51 | sched_primin sched_rr_gi \ |
a5a0310d | 52 | getaddrinfo gai_strerror wordexp \ |
dfd2257a | 53 | pread pwrite pread64 pwrite64 |
7b3547eb | 54 | |
7cabd57c UD |
55 | include ../Makeconfig |
56 | ||
5f9e57ba | 57 | aux := init-posix environ |
a9b171ef | 58 | tests := tstgetopt testfnm runtests wordexp-test runptests \ |
d0ab7780 | 59 | tst-preadwrite test-vfork |
2604afb1 | 60 | test-srcs := globtest |
28f540f4 RM |
61 | others := getconf |
62 | install-bin := getconf | |
ec986e23 | 63 | ifeq (yes,$(build-static)) |
28f540f4 | 64 | install-lib := libposix.a |
ec986e23 | 65 | endif |
2b83a2a4 | 66 | gpl2lgpl := getopt.c getopt1.c getopt.h regex.c regex.h |
28f540f4 | 67 | |
92040cbc | 68 | before-compile := testcases.h ptestcases.h |
4cca6b86 | 69 | |
414fd335 | 70 | # So they get cleaned up. |
ba9234d9 | 71 | generated := $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \ |
8eaaffde | 72 | annexc annexc.out |
414fd335 | 73 | |
28f540f4 RM |
74 | include ../Rules |
75 | ||
61eb22d3 | 76 | ifeq (no,$(cross-compiling)) |
9c1a1da9 | 77 | .PHONY: do-globtest do-wordexp-test |
31161268 UD |
78 | tests: do-globtest do-wordexp-test |
79 | do-globtest: $(objpfx)globtest | |
80 | $(SHELL) -e globtest.sh $(common-objpfx) $(elf-objpfx) \ | |
81 | $(rtld-installed-name) | |
82 | do-wordexp-test: $(objpfx)wordexp-test | |
83 | $(SHELL) -e wordexp-tst.sh $(common-objpfx) $(elf-objpfx) \ | |
84 | $(rtld-installed-name) | |
61eb22d3 UD |
85 | endif |
86 | ||
707ac6cb | 87 | CFLAGS-regex.c = -Wno-unused -Wno-strict-prototypes |
46ec036d | 88 | CFLAGS-getaddrinfo.c = -DRESOLVER |
0793d348 | 89 | |
28f540f4 RM |
90 | $(objpfx)libposix.a: $(dep-dummy-lib); $(make-dummy-lib) |
91 | lib: $(objpfx)libposix.a | |
4cca6b86 UD |
92 | |
93 | testcases.h: TESTS TESTS2C.sed | |
94 | sed -f TESTS2C.sed < $< > $@T | |
95 | mv -f $@T $@ | |
880f421f | 96 | ifeq ($(with-cvs),yes) |
4eb36693 | 97 | test ! -d CVS || cvs $(CVSOPTS) commit -mRegenerated $@ |
880f421f | 98 | endif |
92040cbc UD |
99 | |
100 | ptestcases.h: PTESTS PTESTS2C.sed | |
101 | sed -f PTESTS2C.sed < $< > $@T | |
102 | mv -f $@T $@ | |
103 | ifeq ($(with-cvs),yes) | |
104 | test ! -d CVS || cvs $(CVSOPTS) commit -mRegenerated $@ | |
105 | endif | |
28f540f4 RM |
106 | \f |
107 | # Make the standalone glob/fnmatch package. | |
108 | ||
109 | glob.tar: glob/ChangeLog glob/COPYING.LIB \ | |
110 | glob/Makefile.in glob/configure glob/configure.in glob/configure.bat\ | |
3e2632b6 | 111 | glob/SCOPTIONS glob/SMakefile glob/Makefile.ami \ |
b7843ea9 | 112 | glob/fnmatch.h glob/glob.h glob/fnmatch.c glob/glob.c |
28f540f4 RM |
113 | tar cho$(verbose)f $@ $^ |
114 | glob/%.c: %.c | |
115 | rm -f $@ | |
116 | ln -s ../$< $@ | |
117 | glob/%.h: %.h | |
118 | rm -f $@ | |
119 | ln -s ../$< $@ | |
120 | ||
121 | glob/configure: glob/configure.in | |
9b26f5c4 | 122 | cd glob && autoconf $(ACFLAGS) |
880f421f | 123 | ifeq ($(with-cvs),yes) |
4eb36693 | 124 | test ! -d CVS || cvs $(CVSOPTS) commit -m'Regenerated: autoconf $(ACFLAGS) $<' $@ |
880f421f | 125 | endif |
28f540f4 RM |
126 | |
127 | glob/ChangeLog: ../ChangeLog | |
128 | changelog-extract --regexp 'posix/(glob|fnmatch).*' < $< > $@.new | |
129 | chmod a-w $@.new | |
130 | mv -f $@.new $@ | |
880f421f | 131 | ifeq ($(with-cvs),yes) |
4eb36693 | 132 | test ! -d CVS || cvs $(CVSOPTS) commit -mRegenerated $@ |
880f421f | 133 | endif |
28f540f4 RM |
134 | |
135 | %.Z: % | |
136 | compress -c $< > $@-tmp | |
137 | mv $@-tmp $@ | |
138 | %.gz: % | |
139 | gzip -9v -c $< > $@-tmp | |
140 | mv $@-tmp $@ | |
4959e310 UD |
141 | |
142 | # Run a test on the header files we use. | |
143 | # XXX Please note that for now we ignore the result of this test. | |
144 | tests: $(objpfx)annexc | |
8eaaffde UD |
145 | -$(dir $<)$(notdir $<) '$(CC)' \ |
146 | '-I../include -I.. $(+sysdep-includes)' > $<.out | |
4959e310 UD |
147 | |
148 | $(objpfx)annexc: annexc.c | |
149 | $(native-compile) |