kernel - don't print info about scheduled process if pagefault happened in kernel.
[minix.git] / etc / mk / minix.lib.mk
blobebcf24c5d56b6ef275d289cd63c86fc256ea4895
1 # $NetBSD: bsd.lib.mk,v 1.299 2009/11/27 11:44:36 tsutsui Exp $
2 # @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
4 .include <minix.init.mk>
6 # Pull in <minix.sys.mk> here so we can override its .c.o rule
7 .include <minix.sys.mk>
9 LIBISPRIVATE?= no
11 ##### Basic targets
12 .PHONY: libinstall
13 realinstall: libinstall
14 clean: cleanlib
17 ##### LIB specific flags.
18 COPTS+= ${COPTS.lib${LIB}}
19 CPPFLAGS+= ${CPPFLAGS.lib${LIB}}
20 CXXFLAGS+= ${CXXFLAGS.lib${LIB}}
21 OBJCOPTS+= ${OBJCOPTS.lib${LIB}}
22 LDADD+= ${LDADD.lib${LIB}}
23 LDFLAGS+= ${LDFLAGS.lib${LIB}}
24 LDSTATIC+= ${LDSTATIC.lib${LIB}}
26 ##### Libraries that this may depend upon.
27 .if defined(LIBDPLIBS) && ${MKPIC} != "no" # {
28 .for _lib _dir in ${LIBDPLIBS}
29 .if !defined(LIBDO.${_lib})
30 LIBDO.${_lib}!= cd ${_dir} && ${PRINTOBJDIR}
31 .MAKEOVERRIDES+=LIBDO.${_lib}
32 .endif
33 LDADD+= -L${LIBDO.${_lib}} -l${_lib}
34 DPADD+= ${LIBDO.${_lib}}/lib${_lib}.so
35 .endfor
36 .endif # }
38 ##### Build and install rules
39 MKDEP_SUFFIXES?= .o .po .so .go .ln
41 # add additional suffixes not exported.
42 # .po is used for profiling object files.
43 # .so is used for PIC object files.
44 .SUFFIXES: .out .a .ln .so .po .go .o .s .S .c .cc .cpp .cxx .C .m .F .f .r .y .l .cl .p .h
46 CFLAGS+= ${COPTS}
47 OBJCFLAGS+= ${OBJCOPTS}
48 AFLAGS+= ${COPTS}
49 FFLAGS+= ${FOPTS}
51 .c.o:
52 ${_MKTARGET_COMPILE}
53 ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
54 # .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
55 # ${OBJCOPY} -x ${.TARGET}
56 # .endif
58 .cc.o .cpp.o .cxx.o .C.o:
59 ${_MKTARGET_COMPILE}
60 ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
61 # .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
62 # ${OBJCOPY} -x ${.TARGET}
63 # .endif
65 .s.o:
66 ${_MKTARGET_COMPILE}
67 ${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
68 # ${OBJCOPY} -x ${.TARGET}
70 .S.o:
71 ${_MKTARGET_COMPILE}
72 ${COMPILE.S} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
73 # ${OBJCOPY} -x ${.TARGET}
76 .if defined(LIB) # {
77 _LIBS=lib${LIB}.a
78 .endif
80 OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
82 STOBJS+=${OBJS}
84 LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
86 .if ${LIBISPRIVATE} != "no"
87 # No installation is required
88 libinstall::
89 .endif # ${LIBISPRIVATE} == "no" # {
91 ALLOBJS=
93 ALLOBJS+=${STOBJS}
95 _YLSRCS= ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
97 .NOPATH: ${ALLOBJS} ${_LIBS} ${_YLSRCS}
99 realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
101 MKARZERO?=no
103 #_ARFL=crs
104 _ARFL=cr
107 __archivebuild: .USE
108 ${_MKTARGET_BUILD}
109 rm -f ${.TARGET}
110 # ${AR} ${_ARFL} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
111 ${AR} ${_ARFL} ${.TARGET} ${.ALLSRC:M*o}
113 __archiveinstall: .USE
114 ${_MKTARGET_INSTALL}
115 ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
116 ${_INSTRANLIB} ${.ALLSRC} ${.TARGET}
118 DPSRCS+= ${_YLSRCS}
119 CLEANFILES+= ${_YLSRCS}
121 ${STOBJS} ${POBJS} ${GOBJS} ${SOBJS} ${LOBJS}: ${DPSRCS}
123 lib${LIB}.a:: ${STOBJS} __archivebuild
125 cleanlib: .PHONY
126 rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
127 rm -f lib${LIB}.a ${STOBJS}
129 .if !target(libinstall) # {
131 libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
132 .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
133 ${_MKTARGET_INSTALL}
134 ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
135 ${.ALLSRC} ${.TARGET}
137 .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
138 ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
139 .endif
140 ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
142 .endif # !target(libinstall) # }
144 ##### Pull in related .mk logic
145 LINKSOWN?= ${LIBOWN}
146 LINKSGRP?= ${LIBGRP}
147 LINKSMODE?= ${LIBMODE}
148 .include <minix.files.mk>
149 .include <minix.inc.mk>
150 .include <minix.links.mk>
151 .include <minix.dep.mk>
153 .if ${COMPILER_TYPE} == "ack"
154 .include <minix.ack.mk>
155 .elif ${COMPILER_TYPE} == "gnu"
156 .include <minix.gcc.mk>
157 .endif