root/trunk/freewrt/BSDmakefile

Revision 3880, 1.0 kB (checked in by tg, 1 year ago)

ensure people don't try to build this as superuser

Line 
1 # $FreeWRT$
2 #-
3 # This file is part of the FreeWRT project. FreeWRT is copyrighted
4 # material, please see the LICENCE file in the top-level directory
5 # or at http://www.freewrt.org/licence for details.
6
7 TOPDIR=         ${.CURDIR}
8 PWD=            ${.CURDIR}
9 USER_ID!=       id -u
10
11 .if defined(package) && !empty(package)
12 subdir:=        package/${package}
13 .  if !make(clean)
14 _subdir_dep:=   ${TOPDIR}/.cfg/FWRT_HAVE_DOT_CONFIG
15 .  endif
16 .endif
17
18 .if ${USER_ID} == 0
19 ${.TARGETS}: _nixda
20
21 _nixda:
22         @echo Do not build as root! It causes problems.
23         @exit 1
24 .elif defined(subdir) && !empty(subdir)
25 _subdir:=       ${.TARGETS}
26 ${.TARGETS}: _subdir
27
28 _subdir: ${_subdir_dep}
29         @if test x"$$(umask 2>/dev/null | sed 's/00*22/OK/')" != x"OK"; then \
30                 echo >&2 Error: you must build with “umask 022”, sorry.; \
31                 exit 1; \
32         fi
33         cd ${.CURDIR}/${subdir} && TOPDIR=${.CURDIR} DEVELOPER=1 \
34             ${.CURDIR}/lbin/gmake V=99 ${.MFLAGS} ${_subdir}
35
36 .  include "${.CURDIR}/lbin/prereq.mk"
37 .  include "${.CURDIR}/mk/split-cfg.mk"
38 .else
39 .  include "${.CURDIR}/Makefile"
40 .endif
Note: See TracBrowser for help on using the browser.