aboutsummaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2011-10-28 11:14:44 -0500
committerWilliam Hubbs <williamh@gentoo.org>2011-10-29 09:43:24 -0500
commit5066d40ac83fc9036843d670dbf816955b9f40a3 (patch)
tree9ca229a9816900f0c2864cf0a319a174c4cd36c4 /mk
parentf94e8836333f6dea142d9a7b29610fcc8d6b12a3 (diff)
Use pattern rules instead of suffix rules
Rework the makefiles to use pattern rules instead of suffix rules. This is the preferred way to write implicit rules according to the gnu make manual.
Diffstat (limited to 'mk')
-rw-r--r--mk/lib.mk6
-rw-r--r--mk/os.mk3
-rw-r--r--mk/prog.mk2
-rw-r--r--mk/scripts.mk5
4 files changed, 5 insertions, 11 deletions
diff --git a/mk/lib.mk b/mk/lib.mk
index 0b79a465..c7bd1aae 100644
--- a/mk/lib.mk
+++ b/mk/lib.mk
@@ -14,12 +14,10 @@ _LIBS= lib${LIB}.a ${SHLIB_NAME}
CLEANFILES+= ${OBJS} ${SOBJS} ${_LIBS} ${SHLIB_LINK}
-.SUFFIXES: .So
-
-.c.o:
+%.o: %.c
${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
-.c.So:
+%.So: %.c
${CC} ${PICFLAG} -DPIC ${CPPFLAGS} ${CFLAGS} -c $< -o $@
all: depend ${_LIBS}
diff --git a/mk/os.mk b/mk/os.mk
index 4f5a954e..c306f05f 100644
--- a/mk/os.mk
+++ b/mk/os.mk
@@ -9,6 +9,3 @@ OS?= ${_OS}
include ${MK}/os-${OS}.mk
RC_LIB= /$(LIBNAME)/rc
-
-SFX:= ${SFX_PFX}${SFX}
-.SUFFIXES: ${SFX}
diff --git a/mk/prog.mk b/mk/prog.mk
index 17b21274..d4c32520 100644
--- a/mk/prog.mk
+++ b/mk/prog.mk
@@ -24,7 +24,7 @@ CLEANFILES+= ${OBJS} ${PROG}
all: depend ${PROG}
-.c.o:
+%.o: %.c
${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
${PROG}: ${SCRIPTS} ${OBJS}
diff --git a/mk/scripts.mk b/mk/scripts.mk
index ce37a617..c0b44db0 100644
--- a/mk/scripts.mk
+++ b/mk/scripts.mk
@@ -15,11 +15,10 @@ _LCL_SED:= $(shell ${_LCL_SED_SH})
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}
# Tweak our shell scripts
-.SUFFIXES: .sh.in .in
-.sh.in.sh:
+%.sh: %.sh.in
${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
-.in:
+%: %.in
${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
all: ${OBJS} ${TARGETS}