]>
Commit | Line | Data |
---|---|---|
2d21ac55 A |
1 | BSDMAKE = bsdmake -f Makefile |
2 | ||
3 | .PATH: . | |
4 | .MAIN: all | |
5 | all: lib${LIB}.a lib${LIB}_static.a lib${LIB}_debug.a lib${LIB}_profile.a | |
6 | install: installhdrs install_lib${LIB}.a install_lib${LIB}_static.a \ | |
7 | install_lib${LIB}_profile.a install_lib${LIB}_debug.a maninstall | |
8 | ||
9 | .SUFFIXES: | |
10 | .SUFFIXES: .o .po .So .do | |
11 | .SUFFIXES: .S .s .c .cc .cpp .cxx .m .C | |
12 | .SUFFIXES: .defs .h | |
13 | .SUFFIXES: User.c User.o User.po User.So User.do | |
14 | .SUFFIXES: Server.c Server.o Server.po Server.So Server.do | |
15 | ||
16 | OBJS+= ${SRCS:N*.h:R:S/$/.o/g} | |
17 | DOBJS+= ${OBJS:.o=.do} | |
18 | POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po} | |
19 | SOBJS+= ${OBJS:.o=.So} | |
20 | ||
21 | #### Standard C Rules ################################################# | |
22 | .c.o User.cUser.o Server.cServer.o: | |
23 | ${CC} -static ${PRECFLAGS-${.IMPSRC:T}} ${CFLAGS} \ | |
24 | ${CFLAGS-${.IMPSRC:T}} -Os ${OPTIMIZE-${.IMPSRC:T}} \ | |
25 | -c ${.IMPSRC} -o ${.TARGET} | |
26 | .c.po User.cUser.po Server.cServer.po: | |
27 | ${CC} -pg ${PRECFLAGS-${.IMPSRC:T}} -DPROFILE ${CFLAGS} \ | |
28 | ${CFLAGS-${.IMPSRC:T}} -Os ${OPTIMIZE-${.IMPSRC:T}} \ | |
29 | -c ${.IMPSRC} -o ${.TARGET} | |
30 | .c.So User.cUser.So Server.cServer.So: | |
31 | ${CC} ${PRECFLAGS-${.IMPSRC:T}} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
32 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
33 | .c.do User.cUser.do Server.cServer.do: | |
34 | ${CC} -g ${PRECFLAGS-${.IMPSRC:T}} -DDEBUG ${CFLAGS} \ | |
35 | ${CFLAGS-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
36 | ||
37 | #### Standard Assembler Rules ######################################### | |
38 | .s.o .S.o: | |
39 | ${CC} -static -x assembler-with-cpp ${PRECFLAGS-${.IMPSRC:T}} \ | |
40 | ${AINC} ${CFLAGS:M-[BIDFU]*} ${CFLAGS-${.IMPSRC:T}:M-[BIDFU]*} \ | |
41 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
42 | .s.po .S.po: | |
43 | ${CC} -pg -x assembler-with-cpp ${PRECFLAGS-${.IMPSRC:T}} -DPROFILE \ | |
44 | ${AINC} ${CFLAGS:M-[BIDFU]*} ${CFLAGS-${.IMPSRC:T}:M-[BIDFU]*} \ | |
45 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
46 | .s.So .S.So: | |
47 | ${CC} -x assembler-with-cpp ${PRECFLAGS-${.IMPSRC:T}} \ | |
48 | ${AINC} ${CFLAGS:M-[BIDFU]*} ${CFLAGS-${.IMPSRC:T}:M-[BIDFU]*} \ | |
49 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
50 | .s.do .S.do: | |
51 | ${CC} -g -x assembler-with-cpp ${PRECFLAGS-${.IMPSRC:T}} -DDEBUG \ | |
52 | ${AINC} ${CFLAGS:M-[BIDFU]*} ${CFLAGS-${.IMPSRC:T}:M-[BIDFU]*} \ | |
53 | -c ${.IMPSRC} -o ${.TARGET} | |
54 | ||
55 | #### mig Rules ######################################################## | |
56 | .defs.h .defsUser.c .defsServer.c: | |
57 | mig -arch ${MACHINE_ARCH} -cc ${CC} -user ${.PREFIX}User.c -server ${.PREFIX}Server.c -header ${.PREFIX}.h ${.IMPSRC} | |
58 | ||
59 | gen_mig_defs: ${SRVMIGHDRS} ${MIGHDRS} | |
60 | gen_md_mig_defs: ${MD_MIGHDRS} | |
61 | ||
62 | #### Library Rules #################################################### | |
63 | lib${LIB}_static.a:: ${OBJS} ${STATICOBJS} | |
64 | @${ECHO} building static ${LIB} library | |
65 | @rm -f lib${LIB}_static.a | |
66 | @${AR} cq lib${LIB}_static.a `lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} | |
67 | ${RANLIB} lib${LIB}_static.a | |
68 | ||
69 | lib${LIB}_profile.a:: ${POBJS} ${POBJS2} | |
70 | @${ECHO} building profiled ${LIB} library | |
71 | @rm -f lib${LIB}_profile.a | |
72 | @${AR} cq lib${LIB}_profile.a `lorder ${POBJS} | tsort -q` ${ARADD} | |
73 | ${RANLIB} lib${LIB}_profile.a | |
74 | ||
75 | lib${LIB}_debug.a:: ${DOBJS} ${DOBJS2} | |
76 | @${ECHO} building debug ${LIB} library | |
77 | @rm -f lib${LIB}_debug.a | |
78 | @${AR} cq lib${LIB}_debug.a `lorder ${DOBJS} | tsort -q` ${ARADD} | |
79 | ${RANLIB} lib${LIB}_debug.a | |
80 | ||
81 | lib${LIB}.a:: ${SOBJS} ${SOBJS2} | |
82 | @${ECHO} building standard ${LIB} library | |
83 | @rm -f lib${LIB}.a | |
84 | @${AR} cq lib${LIB}.a `lorder ${SOBJS} | tsort -q` ${ARADD} | |
85 | ${RANLIB} lib${LIB}.a | |
86 | ||
87 | CLEANFILES += ${DOBJS} lib${LIB}_static.a lib${LIB}_profile.a lib${LIB}_debug.a | |
88 | ||
89 | INCDIR = ${DESTDIR}/usr/include | |
90 | LOCINCDIR = ${DESTDIR}/usr/local/include | |
91 | SYSTEMFRAMEWORK = ${DESTDIR}/System/Library/Frameworks/System.framework | |
92 | PRIVHDRS = ${SYSTEMFRAMEWORK}/Versions/B/PrivateHeaders | |
93 | PRIVHDRSPPC = ${PRIVHDRS}/architecture/ppc | |
94 | KERNELFRAMEWORK = ${DESTDIR}/System/Library/Frameworks/Kernel.framework | |
95 | PRIVKERNELHDRS = ${KERNELFRAMEWORK}/Versions/A/PrivateHeaders | |
96 | ||
4a3eedf9 A |
97 | .if ${MACHINE_ARCH} == armv6 |
98 | ARCHDIR = arm | |
99 | .else | |
100 | ARCHDIR = ${MACHINE_ARCH} | |
101 | .endif | |
102 | ||
2d21ac55 | 103 | installhdrs-md: gen_md_mig_defs |
4a3eedf9 A |
104 | mkdir -p ${INCDIR}/mach/${ARCHDIR} |
105 | ${INSTALL} -o 0 -c -m 444 ${MD_MIGHDRS} ${INCDIR}/mach/${ARCHDIR} | |
2d21ac55 A |
106 | mkdir -p ${PRIVHDRSPPC} |
107 | ${INSTALL} -c -m 444 ${PRIVHDRSPPCHDRS} ${PRIVHDRSPPC} | |
108 | ||
109 | installhdrs: gen_mig_defs | |
110 | mkdir -p ${INCDIR}/mach | |
111 | mkdir -p ${INCDIR}/servers | |
112 | ${INSTALL} -o 0 -c -m 444 ${MACH_INSTHDRS} ${INCDIR}/mach | |
113 | ${INSTALL} -o 0 -c -m 444 ${SRVHDRS} ${INCDIR}/servers | |
114 | @for i in `find ${DESTDIR}/usr/include/mach ${DESTDIR}/usr/include/servers -name \*.h`; do \ | |
115 | x=`fgrep '<mach/mig.h>' $$i | uniq -d`; \ | |
116 | if [ -n "$$x" ]; then \ | |
117 | echo patching $$i; \ | |
118 | ed - $$i < ${SRCROOT}/libsyscall/fixdups.ed; \ | |
119 | fi; \ | |
120 | done | |
121 | ||
122 | install_lib${LIB}_static.a: | |
123 | ${INSTALL} -c -m 444 lib${LIB}_static.a ${DESTDIR}/usr/local/lib/system/ | |
124 | install_lib${LIB}_profile.a: | |
125 | ${INSTALL} -c -m 444 lib${LIB}_profile.a ${DESTDIR}/usr/local/lib/system | |
126 | install_lib${LIB}_debug.a: | |
127 | ${INSTALL} -c -m 444 lib${LIB}_debug.a ${DESTDIR}/usr/local/lib/system/ | |
128 | install_lib${LIB}.a: | |
129 | ${INSTALL} -c -m 444 lib${LIB}.a ${DESTDIR}/usr/local/lib/system/ | |
130 | ||
131 | clean: | |
132 | rm -f ${OBJS} ${POBJS} ${DOBJS} ${SOBJS} ${CLEANFILES} | |
133 | rm -f lib${LIB}.a lib${LIB}_static.a lib${LIB}_profile.a \ | |
134 | lib${LIB}_debug.a |