Annotation of src/Makefile, Revision 1.25
1.25 ! mickey 1: # $OpenBSD: Makefile,v 1.24 1998/02/15 20:56:40 niklas Exp $
1.1 deraadt 2:
1.16 deraadt 3: #
4: # For more information on building in tricky environments, please see
5: # the list of possible environment variables described in
6: # /usr/share/mk/bsd.README.
7: #
8: # Building recommendations:
9: #
10: # 1) If at all possible, put this source tree in /usr/src. If /usr/src
11: # must be a symbolic link, setenv BSDSRCDIR to point to the real location.
12: #
13: # 2) It is also recommended that you compile with objects outside the
14: # source tree. To do this, ensure /usr/obj exists or points to some
15: # area of disk of sufficient size. Then do "cd /usr/src; make obj".
16: # This will make a symbolic link called "obj" in each directory, as
17: # well as populate the /usr/obj properly with directories for the
18: # objects.
19: #
20: # 3) If you are reasonably sure that things will compile OK, use the
21: # "make build" target supplied here. Good luck.
22:
1.6 mickey 23: .include <bsd.own.mk> # for NOMAN, if it's there.
1.1 deraadt 24:
25: SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share games
26: SUBDIR+= gnu
27:
1.5 tholo 28: SUBDIR+= sys lkm
1.1 deraadt 29:
1.17 millert 30: .if (${KERBEROS} == "yes")
1.2 tholo 31: SUBDIR+= kerberosIV
1.21 deraadt 32: .endif
33:
34: .if make(clean) || make(cleandir) || make(obj)
35: SUBDIR+= distrib
1.4 tholo 36: .endif
1.2 tholo 37:
1.1 deraadt 38: .if exists(regress)
39: .ifmake !(install)
40: SUBDIR+= regress
41: .endif
42:
43: regression-tests:
44: @echo Running regression tests...
45: @(cd ${.CURDIR}/regress && ${MAKE} regress)
46: .endif
1.10 deraadt 47:
48: includes:
49: (cd ${.CURDIR}/include; ${MAKE} includes)
1.1 deraadt 50:
1.7 deraadt 51: beforeinstall:
52: .ifndef DESTDIR
53: (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
54: .else
55: (cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
56: .endif
1.9 deraadt 57: (cd ${.CURDIR}/include; ${MAKE} includes)
1.1 deraadt 58:
59: afterinstall:
60: .ifndef NOMAN
61: (cd ${.CURDIR}/share/man && ${MAKE} makedb)
62: .endif
63:
64: build:
1.19 kstailey 65: .ifdef GLOBAL_AUTOCONF_CACHE
1.20 kstailey 66: rm -f ${GLOBAL_AUTOCONF_CACHE}
1.18 kstailey 67: .endif
1.6 mickey 68: (cd ${.CURDIR}/share/mk && ${MAKE} install)
1.8 deraadt 69: (cd ${.CURDIR}/include; ${MAKE} includes)
1.1 deraadt 70: ${MAKE} cleandir
71: (cd ${.CURDIR}/lib && ${MAKE} depend && ${MAKE} && ${MAKE} install)
72: (cd ${.CURDIR}/gnu/lib && ${MAKE} depend && ${MAKE} && ${MAKE} install)
1.13 deraadt 73: .if (${MACHINE_ARCH} == "mips")
1.14 briggs 74: ldconfig
1.13 deraadt 75: .endif
1.17 millert 76: .if (${KERBEROS} == "yes")
1.2 tholo 77: (cd ${.CURDIR}/kerberosIV && ${MAKE} build)
1.23 niklas 78: .endif
79: .if (${MACHINE_ARCH} == "mips")
80: ldconfig
1.4 tholo 81: .endif
1.1 deraadt 82: ${MAKE} depend && ${MAKE} && ${MAKE} install
1.15 niklas 83:
84: .if !defined(TARGET)
85: cross-tools:
86: echo "TARGET must be set"; exit 1
87: .else
88: cross-tools: cross-helpers cross-includes cross-binutils cross-gcc
89:
90: CROSSDIR= ${DESTDIR}/usr/cross/${TARGET}
91:
92: cross-helpers:
93: -mkdir -p ${CROSSDIR}/usr/include
94: echo _MACHINE_ARCH | \
95: cat ${.CURDIR}/sys/arch/${TARGET}/include/param.h - | \
1.25 ! mickey 96: ${CPP} -E -I${.CURDIR}/sys/arch | \
! 97: sed -n '$$p' >${CROSSDIR}/TARGET_ARCH
1.15 niklas 98: eval `grep '^osr=' sys/conf/newvers.sh`; \
99: sed "s/\$$/-unknown-openbsd$$osr/" ${CROSSDIR}/TARGET_ARCH > \
100: ${CROSSDIR}/TARGET_CANON
101:
102: cross-includes:
103: ${MAKE} MACHINE=${TARGET} MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
104: DESTDIR=${CROSSDIR} includes
105:
106: cross-binutils:
107: -mkdir -p ${CROSSDIR}/usr/obj
108: export BSDSRCDIR=`pwd`; \
109: (cd ${.CURDIR}/gnu/usr.bin/binutils; \
110: BSDOBJDIR=${CROSSDIR}/usr/obj \
111: MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
112: ${MAKE} -f Makefile.bsd-wrapper obj); \
113: (cd ${CROSSDIR}/usr/obj/gnu/usr.bin/binutils; \
1.25 ! mickey 114: /bin/sh ${BSDSRCDIR}/gnu/usr.bin/binutils/configure \
1.15 niklas 115: --prefix ${CROSSDIR}/usr \
116: --target `cat ${CROSSDIR}/TARGET_CANON` && \
117: ${MAKE} && ${MAKE} install)
118: ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 755 \
119: ${.CURDIR}/usr.bin/lorder/lorder.sh.gnm \
120: ${CROSSDIR}/usr/bin/`cat ${CROSSDIR}/TARGET_CANON`-lorder
1.24 niklas 121:
122: cross-gas:
123: -mkdir -p ${CROSSDIR}/usr/obj
124: -mkdir -p ${CROSSDIR}/usr/bin
125: (cd gnu/usr.bin/gas; \
126: BSDOBJDIR=${CROSSDIR}/usr/obj \
127: BSDSRCDIR=${.CURDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
128: ${MAKE} obj)
129: (cd gnu/usr.bin/gas; \
130: TARGET_MACHINE_ARCH=${TARGET} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
131: ${MAKE})
132: (cd gnu/usr.bin/gas; \
133: DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
134: ${MAKE} NOMAN= install)
1.15 niklas 135:
136: cross-gcc:
137: -mkdir -p ${CROSSDIR}/usr/obj
138: (cd gnu/usr.bin/gcc; \
139: BSDOBJDIR=${CROSSDIR}/usr/obj BSDSRCDIR=${.CURDIR} \
140: MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
141: ${MAKE} -f Makefile.bsd-wrapper obj)
142: (cd ${CROSSDIR}/usr/obj/gnu/usr.bin/gcc; \
1.25 ! mickey 143: /bin/sh ${.CURDIR}/gnu/usr.bin/gcc/configure \
1.15 niklas 144: --prefix ${CROSSDIR}/usr \
145: --target `cat ${CROSSDIR}/TARGET_CANON` && \
146: ${MAKE} BISON=yacc LANGUAGES=c \
147: GCC_FOR_TARGET="./xgcc -B./ -I${CROSSDIR}/usr/include" && \
148: ${MAKE} LANGUAGES=c install)
149: .endif
1.1 deraadt 150:
151: .include <bsd.subdir.mk>