Check-in [e71c4b0c63]
Logged in as anonymous
Overview
Comment:attempt to add more service targets
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e71c4b0c6359e125a6df557a8f6e1638d1e98c4ac36d13090f690941188561c5
User & Date: arcade on 2020-05-26 07:02:38.915
Other Links: manifest | tags
Context
2022-05-29
11:32
enable parallel exec check-in: f8700c9031 user: arcade tags: trunk
2020-05-26
07:02
attempt to add more service targets check-in: e71c4b0c63 user: arcade tags: trunk
07:02
clean up check-in: 8f163fdf5e user: arcade tags: trunk
Changes
Modified Makefile from [4642b9f184] to [e41ea1fc6e].
48
49
50
51
52
53
54






55
56
57
58
59
60
61
TARGETS:=${SCRIPTS:S/.service.mk//}

.for file in ${SCRIPTS}
#.info ${file}
.include "${file}"
.if !target(${file:S/.service.mk//})
${file:S/.service.mk//}: _service






.endif
.endfor

.MAIN: ${TARGETS}

.PHONY: ${TARGETS} ${OTHER_TARGETS}








>
>
>
>
>
>







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
TARGETS:=${SCRIPTS:S/.service.mk//}

.for file in ${SCRIPTS}
#.info ${file}
.include "${file}"
.if !target(${file:S/.service.mk//})
${file:S/.service.mk//}: _service
.endif
.if !target(${file:S/.service.mk/_status/})
${file:S/.service.mk/_status/}: _status
.endif
.if !target(${file:S/.service.mk/_restart/})
${file:S/.service.mk/_restart/}: _restart
.endif
.endfor

.MAIN: ${TARGETS}

.PHONY: ${TARGETS} ${OTHER_TARGETS}

1


2
3
4


5
6
7
8
9
10
11
12
13
14
15










16


LOCAL_TARGETS:=_service_svc _earlyservice_svc


OTHER_TARGETS+=_service_svc _earlyservice_svc
.if ${STARTER} == "svc"
LOCAL_TARGETS+=_service _earlyservice


.endif

.for target in ${LOCAL_TARGETS}
${target}: ${target:C/_service.*/DAEMON/:C/_earlyservice/SERVICE/} .USE
	test -z "$${DAEMON_$@_ENABLE}" || { \
	  echo "MRC:$@> Starting service."; \
	  test -n "${DAEMON_$@_MODULES}" && kldload -n ${DAEMON_$@_MODULES} || true; \
	  svc -u ${DAEMON_$@_USER:Uroot} -g ${DAEMON_$@_GROUP:Uwheel} init $@ ${DAEMON_$@_COMMAND} ${DAEMON_$@_FLAGS} ${DAEMON_$@_FOREGROUND}; \
	}
.endfor











.undef LOCAL_TARGETS



>
>
|


>
>







|



>
>
>
>
>
>
>
>
>
>

>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
LOCAL_TARGETS:=_service_svc _earlyservice_svc
STATUS_TARGETS:=_status_svc
RESTART_TARGETS:=_restart_svc
OTHER_TARGETS+=${LOCAL_TARGETS} ${STATUS_TARGETS} ${RESTART_TARGETS}
.if ${STARTER} == "svc"
LOCAL_TARGETS+=_service _earlyservice
STATUS_TARGETS+=_status
RESTART_TARGETS+=_restart
.endif

.for target in ${LOCAL_TARGETS}
${target}: ${target:C/_service.*/DAEMON/:C/_earlyservice/SERVICE/} .USE
	test -z "$${DAEMON_$@_ENABLE}" || { \
	  echo "MRC:$@> Starting service."; \
	  test -n "${DAEMON_$@_MODULES}" && kldload -n ${DAEMON_$@_MODULES} || true; \
	  svc -u ${DAEMON_$@_USER:Uroot} -g ${DAEMON_$@_GROUP:Uwheel} ${DAEMON_$@_RESTART:D-r} ${DAEMON_$@_RESTART} init $@ ${DAEMON_$@_COMMAND} ${DAEMON_$@_FLAGS} ${DAEMON_$@_FOREGROUND}; \
	}
.endfor

.for target in ${RESTART_TARGETS}
${target}: .USE
	svc restart $@
.endfor

.for target in ${STATUS_TARGETS}
${target}: .USE
	svc status $@
.endfor

.undef LOCAL_TARGETS
.undef RESTART_TARGETS
.undef STATUS_TARGETS