Changeset View
Changeset View
Standalone View
Standalone View
sysutils/mcelog/files/patch-Makefile
--- Makefile.orig 2016-10-18 22:32:19 UTC | --- Makefile.orig 2017-02-04 00:51:04 UTC | ||||
+++ Makefile | +++ Makefile | ||||
@@ -1,5 +1,4 @@ | @@ -1,5 +1,4 @@ | ||||
-CFLAGS := -g -Os | -CFLAGS := -g -Os | ||||
-prefix := /usr | -prefix := /usr | ||||
+prefix := /usr/local | +prefix := /usr/local | ||||
matthew: You shouldn't assume that `${PREFIX}` is `/usr/local` here.
The best practice here is to… | |||||
matUnsubmitted Done Inline ActionsBest would probably be to add prefix=${PREFIX} to MAKE_ARGS. mat: Best would probably be to add `prefix=${PREFIX}` to MAKE_ARGS. | |||||
etcprefix := | etcprefix := | ||||
MANDIR := ${prefix}/share/man | MANDIR := ${prefix}/share/man | ||||
# Define appropiately for your distribution | # Define appropiately for your distribution | ||||
@@ -27,14 +26,21 @@ all: mcelog | @@ -27,14 +26,21 @@ all: mcelog | ||||
.PHONY: install clean depend FORCE | .PHONY: install clean depend FORCE | ||||
+LIBS := | +LIBS := | ||||
Show All 21 Lines | |||||
SRC := $(OBJ:.o=.c) | SRC := $(OBJ:.o=.c) | ||||
-mcelog: ${OBJ} version.o | -mcelog: ${OBJ} version.o | ||||
+mcelog: ${OBJ} ${LIBS} version.o | +mcelog: ${OBJ} ${LIBS} version.o | ||||
# dbquery intentionally not installed by default | # dbquery intentionally not installed by default | ||||
install: mcelog mcelog.conf mcelog.conf.5 mcelog.triggers.5 | install: mcelog mcelog.conf mcelog.conf.5 mcelog.triggers.5 | ||||
@@ -82,7 +88,7 @@ depend: .depend | |||||
version.tmp: FORCE | |||||
( echo -n "char version[] = \"" ; \ | |||||
- if type -p git >/dev/null; then \ | |||||
+ if command -v git >/dev/null; then \ | |||||
if [ -d .git ] ; then \ | |||||
git describe --tags HEAD | tr -d '\n'; \ | |||||
else \ | |||||
@@ -98,8 +104,6 @@ version.c: version.tmp | @@ -98,8 +104,6 @@ version.c: version.tmp | ||||
.depend: ${SRC} | .depend: ${SRC} | ||||
${CC} -MM -I. ${SRC} > .depend.X && mv .depend.X .depend | ${CC} -MM -I. ${SRC} > .depend.X && mv .depend.X .depend | ||||
-include .depend | -include .depend | ||||
- | - | ||||
Makefile: .depend | Makefile: .depend | ||||
.PHONY: iccverify src test | .PHONY: iccverify src test |
You shouldn't assume that ${PREFIX} is /usr/local here.
The best practice here is to substitute in a placeholder eg %PREFIX% via
patch-Makefile and then use a ${REINPLACE_CMD} call in post-patch: to replace
that with the current value of ${PREFIX}.
This is easily broken and needs to be checked when preparing updates, because
make makepatch will regenerate patches based on the state of ${WRKDIR} after
the post-patch: target has run, which unfortunately results in blowing away the
placeholder from the patch files.