]> CyberLeo.Net >> Repos - FreeBSD/releng/10.1.git/blob - share/mk/bsd.progs.mk
Document r273399, OpenSSL updated to version 1.0.1j.
[FreeBSD/releng/10.1.git] / share / mk / bsd.progs.mk
1 # $FreeBSD$
2 # $Id: progs.mk,v 1.11 2012/11/06 17:18:54 sjg Exp $
3 #
4 #       @(#) Copyright (c) 2006, Simon J. Gerraty
5 #
6 #       This file is provided in the hope that it will
7 #       be of use.  There is absolutely NO WARRANTY.
8 #       Permission to copy, redistribute or otherwise
9 #       use this file is hereby granted provided that 
10 #       the above copyright notice and this notice are
11 #       left intact. 
12 #      
13 #       Please send copies of changes and bug-fixes to:
14 #       sjg@crufty.net
15 #
16
17 .MAIN: all
18
19 .if defined(PROGS) || defined(PROGS_CXX)
20 # we really only use PROGS below...
21 PROGS += ${PROGS_CXX}
22
23 # In meta mode, we can capture dependenices for _one_ of the progs.
24 # if makefile doesn't nominate one, we use the first.
25 .if defined(.PARSEDIR)
26 .ifndef UPDATE_DEPENDFILE_PROG
27 UPDATE_DEPENDFILE_PROG = ${PROGS:[1]}
28 .export UPDATE_DEPENDFILE_PROG
29 .endif
30 .else
31 UPDATE_DEPENDFILE_PROG?= no
32 .endif
33
34 .ifndef PROG
35 # They may have asked us to build just one
36 .for t in ${PROGS}
37 .if make($t)
38 PROG ?= $t
39 .endif
40 .endfor
41 .endif
42
43 .if defined(PROG)
44 # just one of many
45 PROG_VARS += BINDIR CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS
46 .for v in ${PROG_VARS:O:u}
47 .if defined(${v}.${PROG}) || defined(${v}_${PROG})
48 $v += ${${v}_${PROG}:U${${v}.${PROG}}}
49 .else
50 $v ?=
51 .endif
52 .endfor
53
54 # for meta mode, there can be only one!
55 .if ${PROG} == ${UPDATE_DEPENDFILE_PROG}
56 UPDATE_DEPENDFILE ?= yes
57 .endif
58 UPDATE_DEPENDFILE ?= NO
59
60 # ensure that we don't clobber each other's dependencies
61 DEPENDFILE?= .depend.${PROG}
62 # prog.mk will do the rest
63 .else
64 all: ${PROGS}
65
66 # We cannot capture dependencies for meta mode here
67 UPDATE_DEPENDFILE = NO
68 # nor can we safely run in parallel.
69 .NOTPARALLEL:
70 .endif
71 .endif
72
73 # handle being called [bsd.]progs.mk
74 .include <bsd.prog.mk>
75
76 .ifndef _RECURSING_PROGS
77 # tell progs.mk we might want to install things
78 PROGS_TARGETS+= cleandepend cleandir cleanobj depend install
79
80 .for p in ${PROGS}
81 .if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p)
82 # bsd.prog.mk may need to know this
83 x.$p= PROG_CXX=$p
84 .endif
85
86 $p ${p}_p: .PHONY .MAKE
87         (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
88             SUBDIR= PROG=$p ${x.$p})
89
90 .for t in ${PROGS_TARGETS:O:u}
91 $p.$t: .PHONY .MAKE
92         (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
93             SUBDIR= PROG=$p ${x.$p} ${@:E})
94 .endfor
95 .endfor
96
97 .for t in ${PROGS_TARGETS:O:u}
98 $t: ${PROGS:%=%.$t}
99 .endfor
100
101 SCRIPTS_TARGETS+= cleandepend cleandir cleanobj depend install
102
103 .for p in ${SCRIPTS}
104 .for t in ${SCRIPTS_TARGETS:O:u}
105 $p.$t: .PHONY .MAKE
106         (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
107             SUBDIR= SCRIPT=$p ${x.$p} ${@:E})
108 .endfor
109 .endfor
110
111 .for t in ${SCRIPTS_TARGETS:O:u}
112 $t: ${SCRIPTS:%=%.$t}
113 .endfor
114
115 .endif