1 # $NetBSD: Makefile,v 1.143 2010/09/04 12:17:58 ahoka Exp $
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.
21 .
include "minix-config.inc"
23 .
include "Makefile.inc"
26 CPPFLAGS
+= -I
${.CURDIR
}/include -I
${.CURDIR
}
30 .if exists
(${ARCHDIR}/Makefile.inc
)
32 .
include "${ARCHDIR}/Makefile.inc"
35 .if exists
(${ARCHDIR}/genassym.cf
)
37 CLEANFILES
+= assym.h assym.h.tmp
39 assym.h
: ${ARCHDIR}/genassym.cf
41 ${TOOL_GENASSYM} -- ${CC} ${CFLAGS} \
42 ${CPPFLAGS} ${CPPFLAGS.assym.h
} ${PROF} \
43 < ${ARCHDIR}/genassym.cf
> assym.h.tmp
&& \
44 mv
-f assym.h.tmp assym.h
47 # The following controls how to build compatibility code for old NetBSD
48 # binaries. If BUILDCOLD is yes, then we build a separate library; otherwise
49 # we include the code in libc.
51 .if
"${BUILDCOLD}" == "yes"
53 .
include <bsd.subdir.mk
>
55 COMPATDIR
= ${.CURDIR
}/compat-minix
56 .
include "${.CURDIR}/compat-minix/Makefile.inc"
59 .
include "${.CURDIR}/../../common/lib/libc/Makefile.inc"
60 .
include "${.CURDIR}/atomic/Makefile.inc"
61 .
include "${.CURDIR}/cdb/Makefile.inc"
62 .
include "${.CURDIR}/db/Makefile.inc"
63 .if
(${CITRUS} == "yes")
64 .
include "${.CURDIR}/citrus/Makefile.inc"
66 .
include "${.CURDIR}/compat-43/Makefile.inc"
67 .
include "${.CURDIR}/dlfcn/Makefile.inc"
68 .
include "${.CURDIR}/gdtoa/Makefile.inc"
69 .
include "${.CURDIR}/gen/Makefile.inc"
73 .
include "${.CURDIR}/gmon/Makefile.inc"
75 .
include "${.CURDIR}/hash/Makefile.inc"
76 .
include "${.CURDIR}/iconv/Makefile.inc"
77 .
include "${.CURDIR}/inet/Makefile.inc"
78 .
include "${.CURDIR}/isc/Makefile.inc"
79 .
include "${.CURDIR}/locale/Makefile.inc"
80 .
include "${.CURDIR}/md/Makefile.inc"
81 .
include "${.CURDIR}/misc/Makefile.inc"
82 .
include "${.CURDIR}/net/Makefile.inc"
83 .
include "${.CURDIR}/nameser/Makefile.inc"
84 .
include "${.CURDIR}/nls/Makefile.inc"
85 .if
(${MACHINE_ARCH} != "alpha") && (${MACHINE_ARCH} != "sparc64")
86 .
include "${.CURDIR}/quad/Makefile.inc"
88 .if
(${USE_LIBTRE} == "yes")
89 .
include "${NETBSDSRCDIR}/external/bsd/tre/Makefile.inc"
91 .
include "${.CURDIR}/regex/Makefile.inc"
93 .
include "${.CURDIR}/resolv/Makefile.inc"
95 # RPC needs pollts() and a reserved port allocator.
97 .
include "${.CURDIR}/rpc/Makefile.inc"
99 .
include "${.CURDIR}/ssp/Makefile.inc"
100 .
include "${.CURDIR}/stdio/Makefile.inc"
101 .
include "${.CURDIR}/stdlib/Makefile.inc"
102 .
include "${.CURDIR}/string/Makefile.inc"
103 .
include "${.CURDIR}/termios/Makefile.inc"
104 .
include "${.CURDIR}/thread-stub/Makefile.inc"
105 .
include "${.CURDIR}/time/Makefile.inc"
107 .
include "${.CURDIR}/sys-minix/Makefile.inc"
109 .
include "${.CURDIR}/sys/Makefile.inc"
111 .
include "${.CURDIR}/uuid/Makefile.inc"
112 .if
(${MKYP} != "no")
113 .
include "${.CURDIR}/yp/Makefile.inc"
116 # Remove from SRCS the .c files for any .S files added by the MD makefiles,
117 # also remove from SRCS the .c files for the .S and .c files in NO_SRCS.
118 # Add the .c file for .S files (in both variables) to LSRCS so that the
119 # 'normal' .c file for assembly files is used for the lint librray.
122 # Add .S files to NO_SRSC when another .S file provides the entry points.
123 # Add .c files to NO_SRSC when another .c file provides the entry points.
124 # (lint is run on all .c files in SRCS)
126 .for check_file in
${SRCS
:M
*.S
} ${NO_SRCS}
127 unwanted_file
:= ${SRCS
:M
${check_file
:.S
=.c
}}
128 .if
"${unwanted_file}" != ""
129 SRCS
:= ${SRCS
:N
${unwanted_file}}
130 .if
"${unwanted_file}" != "${check_file}"
131 LSRCS
:= ${LSRCS} ${unwanted_file}
136 NLS
= C.msg Pig.msg ca.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg \
137 no.msg pl.msg sk.msg sv.msg
144 tags: ${.OBJDIR
}/tags
145 ${.OBJDIR
}/tags: ${SRCS}
147 -${TOOL_CTAGS} -w
${.ALLSRC
:M
*.c
}
148 -egrep
"^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" /dev
/null
${.ALLSRC
:M
*.S
} | \
149 sed
"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
150 >> ${.TARGET
}; sort -o
${.TARGET
} ${.TARGET
}
152 .if
!defined
(__MINIX
)
153 FILES
= ${.OBJDIR
}/tags
159 # workaround for I18N stuffs: build singlebyte setlocale() for libc.a,
160 # multibyte for libc.so. the quirk should be removed when we support
161 # dlopen() from within statically linked binaries.
162 #.if (${CITRUS} == "yes")
163 #CSHLIBFLAGS+= -D_I18N_DYNAMIC
166 .
include <bsd.lib.mk
>
168 # force the dynamic linker to initialize libc first
169 SHLIB_SHFLAGS
+= -Wl
,-z
,initfirst
171 .
include <bsd.own.mk
>
173 .
include <bsd.subdir.mk
>