don't bother resolving onbld python module deps
[unleashed.git] / share / mk / files.mk
blob8bb85c20f1f79b6043a1ca7a0e4a4272e91690c1
1 # $Id: files.mk,v 1.6 2017/05/07 02:21:02 sjg Exp $
3 # @(#) Copyright (c) 2017, Simon J. Gerraty
5 # This file is provided in the hope that it will
6 # be of use. There is absolutely NO WARRANTY.
7 # Permission to copy, redistribute or otherwise
8 # use this file is hereby granted provided that
9 # the above copyright notice and this notice are
10 # left intact.
12 # Please send copies of changes and bug-fixes to:
13 # sjg@crufty.net
16 .include <init.mk>
18 FILES_INSTALL_OWN ?= -o ${SHAREOWN} -g ${SHAREGRP}
19 FILESMODE ?= ${SHAREMODE}
20 FILES_COPY ?= -C
22 FILESGROUPS ?= FILES
23 FILESGROUPS := ${FILESGROUPS:O:u}
25 .if !target(buildfiles)
26 .for group in ${FILESGROUPS}
27 buildfiles: ${${group}}
28 .endfor
29 .endif
30 buildfiles:
31 realbuild: buildfiles
33 # there is no default FILESDIR so
34 # ignore group if ${group}DIR is not defined
35 .for group in ${FILESGROUPS}
36 .if !empty(${group}) && defined(${group}DIR)
37 .if ${group} != "FILES"
38 ${group}_INSTALL_OWN ?= ${FILES_INSTALL_OWN}
39 .endif
40 # incase we are staging
41 STAGE_DIR.${group} ?= ${STAGE_OBJTOP}${${group}DIR}
43 .for file in ${${group}:O:u}
44 ${group}_INSTALL_OWN.${file:T} ?= ${${group}_INSTALL_OWN}
45 ${group}DIR.${file:T} ?= ${${group}DIR}
46 file_mkdir_list += ${${group}DIR.${file:T}}
48 .if defined(${group}NAME.${file:T})
49 STAGE_AS_SETS += ${group}
50 STAGE_AS_${file} = ${${group}NAME.${file:T}}
51 stage_as.${group}: ${file}
53 installfiles: installfiles.${group}.${file:T}
54 installfiles.${group}.${file:T}: ${file} file_mkdirs
55 ${INSTALL} ${FILES_COPY} ${${group}_INSTALL_OWN.${file:T}} \
56 -m ${FILESMODE} ${.ALLSRC:Nfile_mkdirs} ${DESTDIR}${${group}DIR}/${${group}NAME.${file:T}}
58 .else
59 STAGE_SETS += ${group}
60 stage_files.${group}: ${file}
61 installfiles.${group}: ${file}
62 installfiles: installfiles.${group}
63 .endif
65 .endfor # file
67 installfiles.${group}: file_mkdirs
68 ${INSTALL} ${FILES_COPY} ${${group}_INSTALL_OWN} -m ${FILESMODE} \
69 ${.ALLSRC:Nfile_mkdirs:O:u} ${DESTDIR}${${group}DIR}
71 .endif # !empty
72 .endfor # group
74 file_mkdirs:
75 @for d in ${file_mkdir_list:O:u}; do \
76 test -d ${DESTDIR}$$d || \
77 ${INSTALL} -d ${FILES_INSTALL_OWN} -m 755 ${DESTDIR}$$d; \
78 done
80 beforeinstall:
81 installfiles:
82 realinstall: installfiles
83 .ORDER: beforeinstall installfiles