[BACK]Return to bsd.subdir.mk CVS log [TXT][DIR] Up to [local] / src / share / mk

Annotation of src/share/mk/bsd.subdir.mk, Revision 1.5

1.5     ! mickey      1: #      $OpenBSD$
        !             2: #      $NetBSD: bsd.subdir.mk,v 1.10 1995/07/24 04:22:29 cgd Exp $
1.1       deraadt     3: #      @(#)bsd.subdir.mk       5.9 (Berkeley) 2/1/91
                      4:
                      5: .if !target(.MAIN)
                      6: .MAIN: all
                      7: .endif
                      8:
                      9: _SUBDIRUSE: .USE
                     10: .if defined(SUBDIR)
                     11:        @for entry in ${SUBDIR}; do \
                     12:                (set -e; if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
                     13:                        _newdir_="$${entry}.${MACHINE}"; \
                     14:                else \
                     15:                        _newdir_="$${entry}"; \
                     16:                fi; \
                     17:                if test X"${_THISDIR_}" = X""; then \
                     18:                        _nextdir_="$${_newdir_}"; \
                     19:                else \
                     20:                        _nextdir_="$${_THISDIR_}/$${_newdir_}"; \
                     21:                fi; \
1.3       deraadt    22:                _makefile_spec_=""; \
                     23:                if [ -e $${_newdir_}/Makefile.bsd-wrapper ]; then \
                     24:                        _makefile_spec_="-f Makefile.bsd-wrapper"; \
                     25:                fi; \
                     26:                echo "===> $${_nextdir_}"; \
1.1       deraadt    27:                cd ${.CURDIR}/$${_newdir_}; \
1.2       niklas     28:                ${MAKE} $${_makefile_spec_} _THISDIR_="$${_nextdir_}" \
1.1       deraadt    29:                    ${.TARGET:S/realinstall/install/:S/.depend/depend/}); \
                     30:        done
                     31:
                     32: ${SUBDIR}::
                     33:        @set -e; if test -d ${.CURDIR}/${.TARGET}.${MACHINE}; then \
                     34:                _newdir_=${.TARGET}.${MACHINE}; \
                     35:        else \
                     36:                _newdir_=${.TARGET}; \
                     37:        fi; \
1.3       deraadt    38:        _makefile_spec_=""; \
                     39:        if [ -f $${_newdir_}/Makefile.bsd-wrapper ]; then \
                     40:                _makefile_spec_="-f Makefile.bsd-wrapper"; \
                     41:        fi; \
1.1       deraadt    42:        echo "===> $${_newdir_}"; \
                     43:        cd ${.CURDIR}/$${_newdir_}; \
1.2       niklas     44:        ${MAKE} $${_makefile_spec_} _THISDIR_="$${_newdir_}" all
1.1       deraadt    45: .endif
                     46:
                     47: .if !target(install)
                     48: .if !target(beforeinstall)
                     49: beforeinstall:
                     50: .endif
                     51: .if !target(afterinstall)
                     52: afterinstall:
                     53: .endif
                     54: install: maninstall
                     55: maninstall: afterinstall
                     56: afterinstall: realinstall
                     57: realinstall: beforeinstall _SUBDIRUSE
                     58: .endif
                     59:
                     60: .if !target(all)
                     61: all: _SUBDIRUSE
                     62: .endif
                     63:
                     64: .if !target(clean)
                     65: clean: _SUBDIRUSE
                     66: .endif
                     67:
                     68: .if !target(cleandir)
                     69: cleandir: _SUBDIRUSE
                     70: .endif
                     71:
                     72: .if !target(depend)
                     73: depend: _SUBDIRUSE
                     74: .endif
                     75:
                     76: .if !target(lint)
                     77: lint: _SUBDIRUSE
                     78: .endif
                     79:
                     80: .if !target(obj)
                     81: obj: _SUBDIRUSE
                     82: .endif
                     83:
                     84: .if !target(tags)
                     85: tags: _SUBDIRUSE
                     86: .endif
                     87:
                     88: .include <bsd.own.mk>