]>
Commit | Line | Data |
---|---|---|
5b2abdfb A |
1 | # $FreeBSD: src/lMakefile.inc,v 1.7 2001/04/04 18:17:25 tmm Exp $ |
2 | # | |
3 | # This file contains make rules that are shared by libc and libc_r. | |
4 | # | |
5 | # Define (empty) variables so that make doesn't give substitution | |
6 | # errors if the included makefiles don't change these: | |
7 | MDSRCS= | |
8 | MISRCS= | |
9 | MDASM= | |
10 | MIASM= | |
11 | NOASM= | |
12 | ||
9385eb3d A |
13 | # SUPPRESSSRCS is used to prevent machine-independent files from being |
14 | # built, when a machine-dependent file defines multiple symbols. | |
15 | # Use MDSRCS to block one file, and SUPPRESSSRCS to block the others. | |
16 | SUPPRESSSRCS= | |
17 | ||
59e0d9fe A |
18 | # Auto-patching variables |
19 | AUTOPATCHHDRS= | |
20 | AUTOPATCHMAN= | |
21 | AUTOPATCHSRCS= | |
22 | ||
23 | # Auto-patch into OBJROOT | |
24 | _AUTOPATCH: .USE | |
25 | @if [ -f ${.ALLSRC}.patch ]; then \ | |
26 | echo cp ${.ALLSRC} ${.TARGET}; \ | |
27 | cp ${.ALLSRC} ${.TARGET}; \ | |
28 | echo patch ${.TARGET} ${.ALLSRC}.patch; \ | |
29 | patch ${.TARGET} ${.ALLSRC}.patch; \ | |
30 | else \ | |
31 | echo ln -s ${.ALLSRC} ${.TARGET}; \ | |
32 | ln -s ${.ALLSRC} ${.TARGET}; \ | |
33 | fi | |
224c7076 A |
34 | # Auto-patch into current directory |
35 | _AUTOPATCHCUR: .USE | |
59e0d9fe A |
36 | @echo cp ${.ALLSRC} ${.TARGET}; \ |
37 | cp ${.ALLSRC} ${.TARGET}; \ | |
38 | if [ -f ${.ALLSRC}.patch ]; then \ | |
39 | echo patch ${.TARGET} ${.ALLSRC}.patch; \ | |
40 | patch ${.TARGET} ${.ALLSRC}.patch; \ | |
41 | fi | |
224c7076 A |
42 | # Standard compilation for the various forms |
43 | _STANDARD_STATIC: .USE | |
44 | ${CC} -static \ | |
45 | ${PRECFLAGS} ${PRECFLAGS-${.IMPSRC:T}} \ | |
46 | ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
47 | ${VARIANTCFLAGS} ${LIBCFLAGS} \ | |
48 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
49 | _STANDARD_PROFILE: .USE | |
50 | ${CC} -pg -DPROFILE \ | |
51 | ${PRECFLAGS} ${PRECFLAGS-${.IMPSRC:T}} \ | |
52 | ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
53 | ${VARIANTCFLAGS} ${LIBCFLAGS} \ | |
54 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
55 | _STANDARD_DYNAMIC: .USE | |
56 | ${CC} \ | |
57 | ${PRECFLAGS} ${PRECFLAGS-${.IMPSRC:T}} \ | |
58 | ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
59 | ${VARIANTCFLAGS} ${LIBCFLAGS} \ | |
60 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
61 | _STANDARD_DEBUG: .USE | |
62 | ${CC} -g -DDEBUG \ | |
63 | ${PRECFLAGS} ${PRECFLAGS-${.IMPSRC:T}} \ | |
64 | ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
65 | ${VARIANTCFLAGS} ${LIBCFLAGS} \ | |
66 | -c ${.IMPSRC} -o ${.TARGET} | |
9385eb3d | 67 | |
224c7076 A |
68 | # set object file suffix |
69 | .if make(lib${LIB}_static.a) | |
70 | OBJSUFFIX = o | |
71 | .endif | |
72 | .if make(lib${LIB}_profile.a) | |
73 | OBJSUFFIX = po | |
74 | .endif | |
75 | .if make(lib${LIB}_debug.a) | |
76 | OBJSUFFIX = do | |
77 | .endif | |
78 | .if make(lib${LIB}.a) | |
79 | OBJSUFFIX = So | |
80 | .endif | |
81 | ||
82 | .ifnmake autopatch | |
5b2abdfb A |
83 | # |
84 | # If there is a machine dependent makefile, use it: | |
85 | # | |
86 | .if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc) | |
87 | .include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc" | |
88 | .endif | |
89 | ||
3d9156a7 | 90 | .include "${.CURDIR}/darwin/Makefile.inc" |
5b2abdfb A |
91 | .include "${.CURDIR}/db/Makefile.inc" |
92 | .include "${.CURDIR}/compat-43/Makefile.inc" | |
59e0d9fe | 93 | .include "${.CURDIR}/emulated/Makefile.inc" |
9385eb3d | 94 | .include "${.CURDIR}/gdtoa/Makefile.inc" |
5b2abdfb A |
95 | .include "${.CURDIR}/gen/Makefile.inc" |
96 | .include "${.CURDIR}/gmon/Makefile.inc" | |
97 | .include "${.CURDIR}/include/Makefile.inc" | |
98 | .include "${.CURDIR}/internat/Makefile.inc" | |
99 | .include "${.CURDIR}/locale/Makefile.inc" | |
224c7076 | 100 | .include "${.CURDIR}/man/Makefile.inc" |
5b2abdfb | 101 | .include "${.CURDIR}/net/Makefile.inc" |
9385eb3d | 102 | .include "${.CURDIR}/nls/Makefile.inc" |
3d9156a7 | 103 | .include "${.CURDIR}/posix1e/Makefile.inc" |
5b2abdfb | 104 | .include "${.CURDIR}/pthreads/Makefile.inc" |
5b2abdfb | 105 | .include "${.CURDIR}/regex/Makefile.inc" |
224c7076 | 106 | .include "${.CURDIR}/secure/Makefile.inc" |
5b2abdfb A |
107 | .include "${.CURDIR}/stdio/Makefile.inc" |
108 | .include "${.CURDIR}/stdlib/Makefile.inc" | |
109 | .include "${.CURDIR}/stdtime/Makefile.inc" | |
110 | .include "${.CURDIR}/string/Makefile.inc" | |
111 | .include "${.CURDIR}/sys/Makefile.inc" | |
112 | .include "${.CURDIR}/threads/Makefile.inc" | |
113 | .include "${.CURDIR}/util/Makefile.inc" | |
59e0d9fe | 114 | .include "${.CURDIR}/uuid/Makefile.inc" |
5b2abdfb A |
115 | |
116 | # If there are no machine dependent sources, append all the | |
117 | # machine-independent sources: | |
118 | .if empty(MDSRCS) | |
119 | SRCS+= ${MISRCS} | |
120 | .else | |
121 | # Append machine-dependent sources, then append machine-independent sources | |
9385eb3d | 122 | # for which there is no machine-dependent variant, and not being suppressed. |
5b2abdfb | 123 | SRCS+= ${MDSRCS} |
9385eb3d | 124 | _SUPPRESS= ${MDSRCS} ${SUPPRESSSRCS} |
5b2abdfb | 125 | .for _src in ${MISRCS} |
9385eb3d | 126 | .if ${_SUPPRESS:R:M${_src:R}} == "" |
5b2abdfb A |
127 | SRCS+= ${_src} |
128 | .endif | |
129 | .endfor | |
130 | .endif | |
224c7076 | 131 | .endif # !autopatch |