Rename all global functions to start with __ and make old names weak aliases.
[kopensolaris-gnu/glibc.git] / posix / Makefile
1 # Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
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
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.
18
19 #
20 #       Sub-makefile for POSIX portion of the library.
21 #
22 subdir  := posix
23
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
31 distribute := confstr.h TESTS TESTS2C.sed testcases.h \
32               globtest.c globtest.sh wordexp-tst.sh
33
34 routines :=                                                                   \
35         uname                                                                 \
36         times                                                                 \
37         wait waitpid wait3 wait4 waitid                                       \
38         alarm sleep pause nanosleep                                           \
39         fork vfork _exit                                                      \
40         execve fexecve execv execle execl execvp execlp                       \
41         getpid getppid                                                        \
42         getuid geteuid getgid getegid getgroups setuid setgid group_member    \
43         getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid             \
44         getlogin getlogin_r setlogin                                          \
45         pathconf sysconf fpathconf                                            \
46         glob fnmatch regex                                                    \
47         confstr                                                               \
48         getopt getopt1 getopt_init                                            \
49         sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax  \
50         sched_primin sched_rr_gi                                              \
51         getaddrinfo gai_strerror wordexp                                      \
52         pread pwrite pread64 pwrite64
53
54 aux             := init-posix environ
55 tests           := tstgetopt testfnm runtests wordexp-test
56 test-srcs       := globtest
57 others          := getconf
58 install-bin     := getconf
59 install-lib     := libposix.a
60 gpl2lgpl := getopt.c getopt1.c getopt.h regex.c regex.h
61
62 before-compile  := testcases.h
63
64 include ../Rules
65
66 ifeq (no,$(cross-compiling))
67 .PHONY: do-globtest do-wordexp-test
68 tests: do-globtest do-wordexp-test
69 do-globtest: $(objpfx)globtest
70         $(SHELL) -e globtest.sh $(common-objpfx) $(elf-objpfx) \
71                  $(rtld-installed-name)
72 do-wordexp-test: $(objpfx)wordexp-test
73         $(SHELL) -e wordexp-tst.sh $(common-objpfx) $(elf-objpfx) \
74                  $(rtld-installed-name)
75 endif
76
77 CFLAGS-regex.c = -Wno-unused -Wno-strict-prototypes
78 CFLAGS-getaddrinfo.c = -DRESOLVER
79
80 $(objpfx)libposix.a: $(dep-dummy-lib); $(make-dummy-lib)
81 lib: $(objpfx)libposix.a
82
83 testcases.h: TESTS TESTS2C.sed
84         sed -f TESTS2C.sed < $< > $@T
85         mv -f $@T $@
86 ifeq ($(with-cvs),yes)
87         test ! -d CVS || cvs $(CVSOPTS) commit -mRegenerated $@
88 endif
89 \f
90 # Make the standalone glob/fnmatch package.
91
92 glob.tar: glob/ChangeLog glob/COPYING.LIB \
93           glob/Makefile.in glob/configure glob/configure.in glob/configure.bat\
94           glob/SCOPTIONS glob/SMakefile glob/Makefile.ami \
95           glob/fnmatch.h glob/glob.h glob/fnmatch.c glob/glob.c
96         tar cho$(verbose)f $@ $^
97 glob/%.c: %.c
98         rm -f $@
99         ln -s ../$< $@
100 glob/%.h: %.h
101         rm -f $@
102         ln -s ../$< $@
103
104 glob/configure: glob/configure.in
105         cd glob; autoconf $(ACFLAGS)
106 ifeq ($(with-cvs),yes)
107         test ! -d CVS || cvs $(CVSOPTS) commit -m'Regenerated: autoconf $(ACFLAGS) $<' $@
108 endif
109
110 glob/ChangeLog: ../ChangeLog
111         changelog-extract --regexp 'posix/(glob|fnmatch).*' < $< > $@.new
112         chmod a-w $@.new
113         mv -f $@.new $@
114 ifeq ($(with-cvs),yes)
115         test ! -d CVS || cvs $(CVSOPTS) commit -mRegenerated $@
116 endif
117
118 %.Z: %
119         compress -c $< > $@-tmp
120         mv $@-tmp $@
121 %.gz: %
122         gzip -9v -c $< > $@-tmp
123         mv $@-tmp $@