[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.3

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