[BACK]Return to Makefile CVS log [TXT][DIR] Up to [local] / xenocara

Annotation of xenocara/Makefile, Revision 1.76

1.76    ! tb          1: # $OpenBSD: Makefile,v 1.75 2016/10/14 10:14:00 natano Exp $
1.1       matthieu    2: .include <bsd.own.mk>
1.45      matthieu    3: .include <bsd.xconf.mk>
1.1       matthieu    4:
1.11      matthieu    5: LOCALAPPD=/usr/local/lib/X11/app-defaults
                      6: LOCALAPPX=/usr/local/lib/X11
                      7: REALAPPD=/etc/X11/app-defaults
1.15      todd        8: RM?=rm
1.11      matthieu    9:
1.23      matthieu   10: XSERVER= xserver
                     11:
1.41      matthieu   12: SUBDIR= proto font/util data/bitmaps lib app data \
1.33      matthieu   13:        ${XSERVER} driver util doc
1.1       matthieu   14: .ifndef NOFONTS
                     15: SUBDIR+= font
                     16: .endif
1.18      todd       17: SUBDIR+= distrib/notes
1.1       matthieu   18:
1.10      matthieu   19: NOOBJ=
1.1       matthieu   20:
1.66      matthieu   21: .if defined(DESTDIR)
                     22: build:
                     23:        @echo "Cannot run ${MAKE} build with DESTDIR set"
                     24:        @exit 2
                     25: .else
1.47      espie      26: build:
1.75      natano     27:        @if [[ `id -u` -ne 0 ]]; then \
                     28:                echo $@ must be called by root >&2; \
                     29:                false; \
                     30:        fi
                     31:        exec ${MAKE} bootstrap-root
                     32:        cd util/macros && \
                     33:            exec su ${BUILDUSER} -c 'exec ${MAKE} -f Makefile.bsd-wrapper'
                     34:        exec ${MAKE} beforebuild
1.47      espie      35:        exec ${MAKE} realbuild
1.75      natano     36:        exec ${MAKE} afterbuild
1.66      matthieu   37: .endif
1.47      espie      38:
                     39: realbuild: _SUBDIRUSE
                     40:        # that's all folks
1.1       matthieu   41:
                     42: bootstrap:
1.75      natano     43:        @if [[ `id -u` -ne 0 ]]; then \
                     44:                echo $@ must be called by root >&2; \
                     45:                false; \
                     46:        fi
                     47:        exec ${MAKE} bootstrap-root
1.47      espie      48:
                     49: bootstrap-root:
                     50:        exec ${MAKE} distrib-dirs
                     51:        exec ${MAKE} install-mk
                     52:
                     53: beforeinstall beforebuild:
                     54:        cd util/macros && exec ${MAKE} -f Makefile.bsd-wrapper install
                     55:
                     56: afterinstall afterbuild:
                     57:        exec ${MAKE} fix-appd
1.57      schwarze   58:        /usr/sbin/makewhatis -Qv ${DESTDIR}/usr/X11R6/man
1.73      tb         59:        chown root:wheel ${DESTDIR}/usr/X11R6/man/mandoc.db
1.76    ! tb         60:        chmod 644 ${DESTDIR}/usr/X11R6/man/mandoc.db
1.68      ajacouto   61:        touch ${DESTDIR}/var/sysmerge/xetcsum
1.63      ajacouto   62:        cd ${DESTDIR}/ && \
                     63:                sort ${.CURDIR}/distrib/sets/lists/xetc/{mi,md.${MACHINE}} | \
1.68      ajacouto   64:                xargs sha256 -h ${DESTDIR}/var/sysmerge/xetcsum || true
1.73      tb         65:        chown root:wheel ${DESTDIR}/var/sysmerge/xetcsum
1.76    ! tb         66:        chmod 644 ${DESTDIR}/var/sysmerge/xetcsum
1.58      espie      67:        cd distrib/sets && exec ${MAKE}
1.3       matthieu   68:
1.14      matthieu   69: install-mk:
1.47      espie      70:        cd share/mk && exec ${MAKE} X11BASE=${X11BASE} install
1.10      matthieu   71:
1.11      matthieu   72: fix-appd:
                     73:        # Make sure /usr/local/lib/X11/app-defaults is a link
                     74:        if [ ! -L $(DESTDIR)${LOCALAPPD} ]; then \
                     75:            if [ -d $(DESTDIR)${LOCALAPPD} ]; then \
1.48      espie      76:                mv $(DESTDIR)${LOCALAPPD}/* $(DESTDIR)${REALAPPD} || true; \
1.11      matthieu   77:                rmdir $(DESTDIR)${LOCALAPPD}; \
                     78:            fi; \
                     79:            mkdir -p ${DESTDIR}${LOCALAPPX}; \
                     80:            ln -s ${REALAPPD} ${DESTDIR}${LOCALAPPD}; \
1.73      tb         81:            chown -h root:wheel ${DESTDIR}${LOCALAPPD}; \
1.11      matthieu   82:        fi
1.3       matthieu   83:
1.47      espie      84: font-cache:
                     85:        cd font/alias && exec ${MAKE} -f Makefile.bsd-wrapper afterinstall
                     86:
1.53      espie      87: .if ! ( defined(DESTDIR) && defined(RELEASEDIR) )
                     88: release:
                     89:        @echo You must set DESTDIR and RELEASEDIR for a release.; exit 255
                     90: .else
1.55      todd       91: release: sha
                     92:
                     93: sha: release-clean release-install dist hash
                     94:
                     95: hash: dist
                     96:        -cd ${RELEASEDIR}; \
1.56      sthen      97:                cksum -a sha256 x*tgz > SHA256
1.55      todd       98:
                     99: .ORDER: release-clean release-install dist hash
1.53      espie     100: .endif
1.3       matthieu  101:
                    102: release-clean:
                    103:        ${RM} -rf ${DESTDIR}/usr/X11R6/* ${DESTDIR}/usr/X11R6/.[a-zA-Z0-9]*
                    104:        ${RM} -rf ${DESTDIR}/var/cache/*
                    105:        ${RM} -rf ${DESTDIR}/etc/X11/*
                    106:        ${RM} -rf ${DESTDIR}/etc/fonts/*
                    107:        @if [ -d ${DESTDIR}/usr/X11R6 ] && [ "`cd ${DESTDIR}/usr/X11R6;ls`" ]; then \
                    108:                echo "Files found in ${DESTDIR}/usr/X11R6:"; \
                    109:                (cd ${DESTDIR}/usr/X11R6;/bin/pwd;ls -a); \
                    110:                echo "Cleanup before proceeding."; \
                    111:                exit 255; \
                    112:        fi
                    113:
                    114: release-install:
1.59      matthieu  115:        @exec ${MAKE} bootstrap-root
1.61      matthieu  116:        @exec ${MAKE} install
1.3       matthieu  117:
                    118: dist-rel:
                    119:        ${MAKE} RELEASEDIR=`pwd`/rel DESTDIR=`pwd`/dest dist 2>&1 | tee distlog
                    120:
                    121: dist:
                    122:        cd distrib/sets && \
1.67      deraadt   123:                env MACHINE=${MACHINE} ksh ./maketars ${OSrev} ${OSREV}
1.3       matthieu  124:
1.64      deraadt   125: checkdist:
1.65      deraadt   126:        @cd distrib/sets && \
1.64      deraadt   127:                { env MACHINE=${MACHINE} ksh ./checkflist ${OSREV} || true ; }
1.1       matthieu  128:
                    129: distrib-dirs:
1.25      matthieu  130: .if defined(DESTDIR) && ${DESTDIR} != ""
1.47      espie     131:        # running mtree under ${DESTDIR}
1.31      matthieu  132:        mtree -qdef /etc/mtree/BSD.x11.dist -p ${DESTDIR} -U
1.25      matthieu  133: .else
1.47      espie     134:        # running mtree
1.31      matthieu  135:        mtree -qdef /etc/mtree/BSD.x11.dist -p / -U
1.25      matthieu  136: .endif
                    137:
1.1       matthieu  138:
1.9       matthieu  139: .PHONY: all build beforeinstall install afterinstall release clean cleandir \
1.47      espie     140:        dist distrib-dirs fix-appd beforebuild bootstrap afterbuild realbuild \
                    141:        install-mk bootstrap-root
1.1       matthieu  142:
1.11      matthieu  143: .include <bsd.subdir.mk>
1.1       matthieu  144: .include <bsd.xorg.mk>