Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: src/librc/, net/, init.d/, sh/, mk/, doc/
Date: Sat, 29 Oct 2011 15:07:26
Message-Id: 5066d40ac83fc9036843d670dbf816955b9f40a3.WilliamH@gentoo
1 commit: 5066d40ac83fc9036843d670dbf816955b9f40a3
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 28 16:14:44 2011 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 29 14:43:24 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=5066d40a
7
8 Use pattern rules instead of suffix rules
9
10 Rework the makefiles to use pattern rules instead of suffix rules.
11 This is the preferred way to write implicit rules according to the gnu
12 make manual.
13
14 ---
15 doc/Makefile | 2 +-
16 init.d/Makefile | 2 +-
17 mk/lib.mk | 6 ++----
18 mk/os.mk | 3 ---
19 mk/prog.mk | 2 +-
20 mk/scripts.mk | 5 ++---
21 net/Makefile | 2 +-
22 sh/Makefile | 3 +--
23 src/librc/Makefile | 3 +--
24 9 files changed, 10 insertions(+), 18 deletions(-)
25
26 diff --git a/doc/Makefile b/doc/Makefile
27 index 81e621b..8fbf3e8 100644
28 --- a/doc/Makefile
29 +++ b/doc/Makefile
30 @@ -5,7 +5,7 @@ INC= net.example
31 MK= ../mk
32 include ${MK}/os.mk
33
34 -${SFX}:
35 +%.example.in: %.example${SFX}
36 ${CP} $< $@
37
38 include ${MK}/scripts.mk
39
40 diff --git a/init.d/Makefile b/init.d/Makefile
41 index db68154..de8428a 100644
42 --- a/init.d/Makefile
43 +++ b/init.d/Makefile
44 @@ -37,7 +37,7 @@ SRCS-NetBSD= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
45 # These are NetBSD specific
46 SRCS-NetBSD+= devdb.in swap-blk.in ttys.in wscons.in
47
48 -${SFX}:
49 +%.in: %${SFX}
50 sed ${SED_REPLACE} ${SED_EXTRA} $< > $@
51
52 include ${MK}/scripts.mk
53
54 diff --git a/mk/lib.mk b/mk/lib.mk
55 index 0b79a46..c7bd1aa 100644
56 --- a/mk/lib.mk
57 +++ b/mk/lib.mk
58 @@ -14,12 +14,10 @@ _LIBS= lib${LIB}.a ${SHLIB_NAME}
59
60 CLEANFILES+= ${OBJS} ${SOBJS} ${_LIBS} ${SHLIB_LINK}
61
62 -.SUFFIXES: .So
63 -
64 -.c.o:
65 +%.o: %.c
66 ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
67
68 -.c.So:
69 +%.So: %.c
70 ${CC} ${PICFLAG} -DPIC ${CPPFLAGS} ${CFLAGS} -c $< -o $@
71
72 all: depend ${_LIBS}
73
74 diff --git a/mk/os.mk b/mk/os.mk
75 index 4f5a954..c306f05 100644
76 --- a/mk/os.mk
77 +++ b/mk/os.mk
78 @@ -9,6 +9,3 @@ OS?= ${_OS}
79 include ${MK}/os-${OS}.mk
80
81 RC_LIB= /$(LIBNAME)/rc
82 -
83 -SFX:= ${SFX_PFX}${SFX}
84 -.SUFFIXES: ${SFX}
85
86 diff --git a/mk/prog.mk b/mk/prog.mk
87 index 17b2127..d4c3252 100644
88 --- a/mk/prog.mk
89 +++ b/mk/prog.mk
90 @@ -24,7 +24,7 @@ CLEANFILES+= ${OBJS} ${PROG}
91
92 all: depend ${PROG}
93
94 -.c.o:
95 +%.o: %.c
96 ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
97
98 ${PROG}: ${SCRIPTS} ${OBJS}
99
100 diff --git a/mk/scripts.mk b/mk/scripts.mk
101 index ce37a61..c0b44db 100644
102 --- a/mk/scripts.mk
103 +++ b/mk/scripts.mk
104 @@ -15,11 +15,10 @@ _LCL_SED:= $(shell ${_LCL_SED_SH})
105 SED_REPLACE= -e 's:@SHELL@:${SH}:g' -e 's:@LIB@:${LIBNAME}:g' -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' -e 's:@PREFIX@:${PREFIX}:g' -e 's:@RC_SYS_DEFAULT@:${MKRCSYS}:g' ${_PKG_SED} ${_LCL_SED}
106
107 # Tweak our shell scripts
108 -.SUFFIXES: .sh.in .in
109 -.sh.in.sh:
110 +%.sh: %.sh.in
111 ${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
112
113 -.in:
114 +%: %.in
115 ${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
116
117 all: ${OBJS} ${TARGETS}
118
119 diff --git a/net/Makefile b/net/Makefile
120 index e87d3dd..c2f3747 100644
121 --- a/net/Makefile
122 +++ b/net/Makefile
123 @@ -18,7 +18,7 @@ INC-Linux= adsl.sh apipa.sh arping.sh bonding.sh br2684ctl.sh bridge.sh \
124 SRCS-NetBSD=
125 INC-NetBSD= ifwatchd.sh
126
127 -${SFX}.sh:
128 +%.sh: %.sh${SFX}
129 ${CP} $< $@
130
131 include ${MK}/scripts.mk
132
133 diff --git a/sh/Makefile b/sh/Makefile
134 index c15c79e..f714780 100644
135 --- a/sh/Makefile
136 +++ b/sh/Makefile
137 @@ -6,7 +6,6 @@ BIN= gendepends.sh init.sh runscript.sh ${BIN-${OS}}
138
139 INSTALLAFTER= _installafter
140
141 -SFX_PFX= .sh
142 MK= ../mk
143 include ${MK}/os.mk
144
145 @@ -21,7 +20,7 @@ BIN-NetBSD= ifwatchd-carrier.sh ifwatchd-nocarrier.sh
146
147 include ${MK}/scripts.mk
148
149 -${SFX}.sh:
150 +%.sh: %.sh${SFX}
151 ${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
152
153 _installafter:
154
155 diff --git a/src/librc/Makefile b/src/librc/Makefile
156 index 963fb41..0b4beb2 100644
157 --- a/src/librc/Makefile
158 +++ b/src/librc/Makefile
159 @@ -39,8 +39,7 @@ endif
160 endif
161 SED_CMD+= ${_LCL_PREFIX}
162
163 -.SUFFIXES: .h.in .h
164 -.h.in.h:
165 +%.h: %.h.in
166 ${SED} ${SED_CMD} $< > $@
167 ${SRCS}: rc.h