2 # @(#)Makefile 8.2 (Berkeley) 2/3/94
4 # All library objects contain sccsid strings by default; they may be
5 # excluded as a space-saving measure. To produce a library that does
6 # not contain these strings, delete -DLIBC_SCCS and -DSYSLIBC_SCCS
7 # from CPPFLAGS below. To remove these strings from just the system call
8 # stubs, remove just -DSYSLIBC_SCCS from CPPFLAGS.
10 # The NLS (message catalog) functions are always in libc. To choose that
11 # strerror(), perror(), strsignal(), psignal(), etc. actually call the NLS
12 # functions, put -DNLS on the CPPFLAGS line below.
14 # The YP functions are always in libc. To choose that getpwent() and friends
15 # actually call the YP functions, put -DYP on the CPPFLAGS line below.
17 # The Hesiod functions are always in libc. To choose that getpwent() and friends
18 # actually call the Hesiod functions, put -DHESIOD on the CPPFLAGS line below.
20 .
include "Makefile.inc"
23 CPPFLAGS
+= -I
${.CURDIR
}/include -I
${.CURDIR
}
27 .if exists
(${ARCHDIR}/Makefile.inc
)
29 .
include "${ARCHDIR}/Makefile.inc"
32 .if exists
(${ARCHDIR}/genassym.cf
)
34 CLEANFILES
+= assym.h assym.h.tmp
36 assym.h
: ${ARCHDIR}/genassym.cf
38 ${TOOL_GENASSYM} -- ${CC} ${CFLAGS} \
39 ${CPPFLAGS} ${CPPFLAGS.assym.h
} ${PROF} \
40 < ${ARCHDIR}/genassym.cf
> assym.h.tmp
&& \
41 mv
-f assym.h.tmp assym.h
44 # The following controls how to build compatibility code for old NetBSD
45 # binaries. If BUILDCOLD is yes, then we build a separate library; otherwise
46 # we include the code in libc.
48 .if
"${BUILDCOLD}" == "yes"
50 .
include <bsd.subdir.mk
>
52 COMPATDIR
=${.CURDIR
}/compat
53 .
include "${.CURDIR}/compat/Makefile.inc"
56 .
include "${.CURDIR}/../../common/lib/libc/Makefile.inc"
57 .
include "${.CURDIR}/atomic/Makefile.inc"
58 .
include "${.CURDIR}/db/Makefile.inc"
59 .
include "${.CURDIR}/citrus/Makefile.inc"
60 .
include "${.CURDIR}/compat-43/Makefile.inc"
61 .
include "${.CURDIR}/dlfcn/Makefile.inc"
62 .
include "${.CURDIR}/gdtoa/Makefile.inc"
63 .
include "${.CURDIR}/gen/Makefile.inc"
64 .
include "${.CURDIR}/gmon/Makefile.inc"
65 .
include "${.CURDIR}/hash/Makefile.inc"
66 .
include "${.CURDIR}/iconv/Makefile.inc"
67 .
include "${.CURDIR}/inet/Makefile.inc"
68 .
include "${.CURDIR}/isc/Makefile.inc"
69 .
include "${.CURDIR}/locale/Makefile.inc"
70 .
include "${.CURDIR}/md/Makefile.inc"
71 .
include "${.CURDIR}/misc/Makefile.inc"
72 .
include "${.CURDIR}/net/Makefile.inc"
73 .
include "${.CURDIR}/nameser/Makefile.inc"
74 .
include "${.CURDIR}/nls/Makefile.inc"
75 .if
(${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
76 .
include "${.CURDIR}/quad/Makefile.inc"
78 .
include "${.CURDIR}/regex/Makefile.inc"
79 .
include "${.CURDIR}/resolv/Makefile.inc"
80 .
include "${.CURDIR}/rpc/Makefile.inc"
81 .
include "${.CURDIR}/ssp/Makefile.inc"
82 .
include "${.CURDIR}/stdio/Makefile.inc"
83 .
include "${.CURDIR}/stdlib/Makefile.inc"
84 .
include "${.CURDIR}/string/Makefile.inc"
85 .
include "${.CURDIR}/termios/Makefile.inc"
86 .
include "${.CURDIR}/thread-stub/Makefile.inc"
87 .
include "${.CURDIR}/time/Makefile.inc"
88 .
include "${.CURDIR}/sys/Makefile.inc"
89 .
include "${.CURDIR}/uuid/Makefile.inc"
91 .
include "${.CURDIR}/yp/Makefile.inc"
94 # Remove from SRCS the .c files for any .S files added by the MD makefiles,
95 # also remove from SRCS the .c files for the .S and .c files in NO_SRCS.
96 # Add the .c file for .S files (in both variables) to LSRCS so that the
97 # 'normal' .c file for assembly files is used for the lint librray.
100 # Add .S files to NO_SRSC when another .S file provides the entry points.
101 # Add .c files to NO_SRSC when another .c file provides the entry points.
102 # (lint is run on all .c files in SRCS)
104 .for check_file in
${SRCS
:M
*.S
} ${NO_SRCS}
105 unwanted_file
:= ${SRCS
:M
${check_file
:.S
=.c
}}
106 .if
"${unwanted_file}" != ""
107 SRCS
:= ${SRCS
:N
${unwanted_file}}
108 .if
"${unwanted_file}" != "${check_file}"
109 LSRCS
:= ${LSRCS} ${unwanted_file}
114 NLS
= C.msg Pig.msg ca.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg \
115 no.msg pl.msg sk.msg sv.msg
118 tags: ${.OBJDIR
}/tags
119 ${.OBJDIR
}/tags: ${SRCS}
121 -${TOOL_CTAGS} -w
${.ALLSRC
:M
*.c
}
122 -egrep
"^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" /dev
/null
${.ALLSRC
:M
*.S
} | \
123 sed
"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
124 >> ${.TARGET
}; sort -o
${.TARGET
} ${.TARGET
}
126 FILES
= ${.OBJDIR
}/tags
131 # workaround for I18N stuffs: build singlebyte setlocale() for libc.a,
132 # multibyte for libc.so. the quirk should be removed when we support
133 # dlopen() from within statically linked binaries.
134 CSHLIBFLAGS
+= -D_I18N_DYNAMIC
136 .
include <bsd.lib.mk
>
138 # force the dynamic linker to initialize libc first
139 SHLIB_SHFLAGS
+= -Wl
,-z
,initfirst