| 1 | # @(#)Makefile 5.1.1.2 (Berkeley) 5/9/91 |
| 2 | # |
| 3 | # $Id: Makefile,v 1.32 1994/01/11 08:06:49 rgrimes Exp $ |
| 4 | # |
| 5 | |
| 6 | SUBDIR= |
| 7 | .if exists(bin) |
| 8 | SUBDIR+= bin |
| 9 | .endif |
| 10 | .if exists(contrib) |
| 11 | SUBDIR+= contrib |
| 12 | .endif |
| 13 | .if exists(games) |
| 14 | SUBDIR+= games |
| 15 | .endif |
| 16 | .if exists(gnu) |
| 17 | SUBDIR+= gnu |
| 18 | .endif |
| 19 | .if exists(include) |
| 20 | SUBDIR+= include |
| 21 | .endif |
| 22 | .if exists(lib) |
| 23 | SUBDIR+= lib |
| 24 | .endif |
| 25 | .if exists(libexec) |
| 26 | SUBDIR+= libexec |
| 27 | .endif |
| 28 | .if exists(sbin) |
| 29 | SUBDIR+= sbin |
| 30 | .endif |
| 31 | .if exists(share) |
| 32 | SUBDIR+= share |
| 33 | .endif |
| 34 | .if exists(usr.bin) |
| 35 | SUBDIR+= usr.bin |
| 36 | .endif |
| 37 | .if exists(usr.sbin) |
| 38 | SUBDIR+= usr.sbin |
| 39 | .endif |
| 40 | |
| 41 | # This is for people who want to have src/ports, src/local built |
| 42 | # automatically. |
| 43 | .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) |
| 44 | SUBDIR+= local |
| 45 | .endif |
| 46 | .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) |
| 47 | SUBDIR+= ports |
| 48 | .endif |
| 49 | |
| 50 | |
| 51 | # Special cases: etc sys |
| 52 | # Not ported: kerberosIV |
| 53 | |
| 54 | # |
| 55 | # setenv NOCLEANDIR will prevent make cleandirs from being run |
| 56 | # |
| 57 | .if defined(NOCLEANDIR) |
| 58 | CLEANDIR= |
| 59 | .else |
| 60 | CLEANDIR= cleandir |
| 61 | .endif |
| 62 | |
| 63 | world: directories cleandist mk includes libraries tools mdec |
| 64 | @echo "--------------------------------------------------------------" |
| 65 | @echo " Rebuilding ${DESTDIR} The whole thing" |
| 66 | @echo "--------------------------------------------------------------" |
| 67 | @echo |
| 68 | make depend all install |
| 69 | cd ${.CURDIR}/usr.sbin/sendmail/src; make install |
| 70 | cd ${.CURDIR}/share/man; make makedb |
| 71 | |
| 72 | directories: |
| 73 | cd ${.CURDIR}/etc; make distrib-dirs |
| 74 | |
| 75 | cleandist: |
| 76 | .if !defined(NOCLEANDIR) |
| 77 | @echo "--------------------------------------------------------------" |
| 78 | @echo " Cleaning up the source tree, and rebuilding the obj tree" |
| 79 | @echo "--------------------------------------------------------------" |
| 80 | @echo |
| 81 | here=`pwd`; dest=/usr/obj/`echo $$here | sed 's,/usr/src,,'`; \ |
| 82 | cd $$dest; rm -rf ${SUBDIR} |
| 83 | find . -name obj | xargs -n30 rm -rf |
| 84 | .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) |
| 85 | # The cd is done as local may well be a symbolic link |
| 86 | -cd local ; find . -name obj | xargs -n30 rm -rf |
| 87 | .endif |
| 88 | .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) |
| 89 | # The cd is done as local may well be a symbolic link |
| 90 | -cd ports ; find . -name obj | xargs -n30 rm -rf |
| 91 | .endif |
| 92 | make cleandir |
| 93 | make obj |
| 94 | .endif |
| 95 | |
| 96 | mk: |
| 97 | @echo "--------------------------------------------------------------" |
| 98 | @echo " Rebuilding ${DESTDIR}/usr/share/mk" |
| 99 | @echo "--------------------------------------------------------------" |
| 100 | .if defined(CLOBBER) |
| 101 | # DONT DO THIS!! rm -rf ${DESTDIR}/usr/share/mk |
| 102 | # DONT DO THIS!! mkdir ${DESTDIR}/usr/share/mk |
| 103 | # DONT DO THIS!! chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/share/mk |
| 104 | # DONT DO THIS!! chmod 755 ${DESTDIR}/usr/share/mk |
| 105 | .endif |
| 106 | cd ${.CURDIR}/share/mk; make install; |
| 107 | |
| 108 | includes: |
| 109 | @echo "--------------------------------------------------------------" |
| 110 | @echo " Rebuilding ${DESTDIR}/usr/include" |
| 111 | @echo "--------------------------------------------------------------" |
| 112 | @echo |
| 113 | .if defined(CLOBBER) |
| 114 | rm -rf ${DESTDIR}/usr/include |
| 115 | mkdir ${DESTDIR}/usr/include |
| 116 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include |
| 117 | chmod 755 ${DESTDIR}/usr/include |
| 118 | .endif |
| 119 | cd ${.CURDIR}/include; make install |
| 120 | cd ${.CURDIR}/gnu/gcc2/libobjc; make beforeinstall |
| 121 | cd ${.CURDIR}/gnu/libg++; make beforeinstall |
| 122 | cd ${.CURDIR}/gnu/libregex; make beforeinstall |
| 123 | cd ${.CURDIR}/lib/libcurses; make beforeinstall |
| 124 | cd ${.CURDIR}/lib/libc; make beforeinstall |
| 125 | |
| 126 | # You MUST run this the first time you get the new sources to boot strap |
| 127 | # the shared library tools onto you system. This target should only |
| 128 | # need to be run once on a system. |
| 129 | |
| 130 | bootstrapld: directories cleandist mk includes |
| 131 | @echo "--------------------------------------------------------------" |
| 132 | @echo " Building new shlib compiler tools" |
| 133 | @echo "--------------------------------------------------------------" |
| 134 | # These tools need to be built very early due to a.out.h changes: |
| 135 | # It is possible that ar is needed |
| 136 | cd ${.CURDIR}/usr.bin/mkdep; make -DNOPIC depend all install ${CLEANDIR} obj |
| 137 | cd ${.CURDIR}/usr.bin/nm; make -DNOPIC depend all install ${CLEANDIR} obj |
| 138 | cd ${.CURDIR}/usr.bin/ranlib; make -DNOPIC depend all install ${CLEANDIR} obj |
| 139 | cd ${.CURDIR}/usr.bin/strip; make -DNOPIC depend all install ${CLEANDIR} obj |
| 140 | cd ${.CURDIR}/gnu/ld; make -DNOPIC depend all install ${CLEANDIR} obj |
| 141 | cd ${.CURDIR}/gnu/gas; make depend all install ${CLEANDIR} obj |
| 142 | cd ${.CURDIR}/gnu/gcc2; make -DNOPIC depend all install ${CLEANDIR} obj |
| 143 | cd ${.CURDIR}/gnu/gcc2/libgcc; make all install ${CLEANDIR} obj |
| 144 | cd ${.CURDIR}/lib/csu.i386; make depend all install ${CLEANDIR} obj |
| 145 | cd ${.CURDIR}/lib/libc; make depend all install ${CLEANDIR} obj |
| 146 | cd ${.CURDIR}/gnu/ld/rtld; make depend all install ${CLEANDIR} obj |
| 147 | |
| 148 | libraries: |
| 149 | # setenv NOPROFILE if you do not want profiled libraries |
| 150 | @echo "--------------------------------------------------------------" |
| 151 | @echo " Rebuilding ${DESTDIR}/usr/lib" |
| 152 | @echo "--------------------------------------------------------------" |
| 153 | @echo |
| 154 | .if defined(CLOBBER) |
| 155 | find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | xargs -n30 rm -rf |
| 156 | .endif |
| 157 | cd ${.CURDIR}/lib; make depend all install ${CLEANDIR} obj |
| 158 | cd ${.CURDIR}/gnu/gcc2/libgcc; make depend all install ${CLEANDIR} obj |
| 159 | cd ${.CURDIR}/gnu/libg++; make depend all install ${CLEANDIR} obj |
| 160 | cd ${.CURDIR}/gnu/libregex; make depend all install ${CLEANDIR} obj |
| 161 | cd ${.CURDIR}/gnu/libmalloc; make depend all install ${CLEANDIR} obj |
| 162 | cd ${.CURDIR}/usr.bin/lex; make depend all install ${CLEANDIR} obj |
| 163 | |
| 164 | tools: |
| 165 | @echo "--------------------------------------------------------------" |
| 166 | @echo " Rebuilding ${DESTDIR} Compiler and Make" |
| 167 | @echo "--------------------------------------------------------------" |
| 168 | @echo |
| 169 | cd ${.CURDIR}/gnu/gcc2; make depend all install ${CLEANDIR} obj |
| 170 | cd ${.CURDIR}/usr.bin/make; make depend all install ${CLEANDIR} obj |
| 171 | |
| 172 | mdec: |
| 173 | @echo "--------------------------------------------------------------" |
| 174 | @echo " Rebuilding ${DESTDIR}/usr/mdec" |
| 175 | @echo "--------------------------------------------------------------" |
| 176 | @echo |
| 177 | .if ${MACHINE} == "i386" |
| 178 | cd ${.CURDIR}/sys/i386/boot; make depend all install ${CLEANDIR} |
| 179 | .if defined (DESTDIR) |
| 180 | cd /usr/mdec; find . | cpio -pdamuv ${DESTDIR}/usr/mdec |
| 181 | .endif |
| 182 | .endif |
| 183 | |
| 184 | .include <bsd.subdir.mk> |