user-cr: Makefile cleanups
cover user-cr: Makefile cleanups
Some minor fixes to the Makefile:
[PATCH 1/4] user-cr: Add install prefix
[PATCH 2/4] user-cr: Make directories during install [PATCH 3/4] user-cr: Fix install rule dependencies
[PATCH 4/4] user-cr: Remove pointless echo lines and @-prefixed lines
Cheers,
-Matt Helsley
A message that is not in the archive (sent off-list or not yet received): 1267210602-11444-1-git-send-email-matthltc-r/[email protected]
PATCH 1/4 user-cr: Add install prefix
Add an install prefix rather than require setting both BIN_INSTALL_DIR and LIB_INSTALL_DIR.
--- Makefile | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
Makefile +3 -2
@@ -18,8 +18,9 @@ WARNS := -Wall -Wstrict-prototypes -Wno-trigraphs CFLAGS += -g $(WARNS) $(CKPT_INCLUDE) $(DEBUG) # install dir -BIN_INSTALL_DIR = /bin -LIB_INSTALL_DIR = /lib +PREFIX ?= /usr/local +BIN_INSTALL_DIR := $(PREFIX)/bin +LIB_INSTALL_DIR := $(PREFIX)/lib ECLONE_PROGS = restart nsexec PROGS = checkpoint ckptinfo $(ECLONE_PROGS)
Signature · 1 line
1.6.3.3
PATCH 2/4 user-cr: Make directories during install
In reply to a message not in the archiveThis makes the directories needed to hold the installed files if they do not already exist.
--- Makefile | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile +1 -0
@@ -68,6 +68,7 @@ ckptinfo_types.c: $(CKPT_HEADERS) ckptinfo.py cat $(CKPT_HEADERS) | ./ckptinfo.py > ckptinfo_types.c install: + /usr/bin/install -d -D $(BIN_INSTALL_DIR) $(LIB_INSTALL_DIR) @echo /usr/bin/install -m 755 checkpoint restart nsexec ckptinfo $(BIN_INSTALL_DIR) @/usr/bin/install -m 755 checkpoint restart ckptinfo nsexec $(BIN_INSTALL_DIR) @echo /usr/bin/install -m 755 $(LIB_ECLONE) $(LIB_INSTALL_DIR)
Signature · 1 line
1.6.3.3
PATCH 3/4 user-cr: Fix install rule dependencies
In reply to a message not in the archiveSince we're installing these programs we need them to be built first.
--- Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile +1 -1
@@ -67,7 +67,7 @@ ckptinfo: ckptinfo_types.o ckptinfo_types.c: $(CKPT_HEADERS) ckptinfo.py cat $(CKPT_HEADERS) | ./ckptinfo.py > ckptinfo_types.c -install: +install: $(PROGS) /usr/bin/install -d -D $(BIN_INSTALL_DIR) $(LIB_INSTALL_DIR) @echo /usr/bin/install -m 755 checkpoint restart nsexec ckptinfo $(BIN_INSTALL_DIR) @/usr/bin/install -m 755 checkpoint restart ckptinfo nsexec $(BIN_INSTALL_DIR)
Signature · 1 line
1.6.3.3
PATCH 4/4 user-cr: Remove pointless echo lines and @-prefixed lines
In reply to a message not in the archiveIn Make, actions prefixed with @ do not produce output showing what Make is executing. It seems rather silly to manually echo the precise output Make would produce automatically without the @ prefix.
--- Makefile | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
Makefile +2 -4
@@ -69,10 +69,8 @@ ckptinfo_types.c: $(CKPT_HEADERS) ckptinfo.py install: $(PROGS) /usr/bin/install -d -D $(BIN_INSTALL_DIR) $(LIB_INSTALL_DIR) - @echo /usr/bin/install -m 755 checkpoint restart nsexec ckptinfo $(BIN_INSTALL_DIR) - @/usr/bin/install -m 755 checkpoint restart ckptinfo nsexec $(BIN_INSTALL_DIR) - @echo /usr/bin/install -m 755 $(LIB_ECLONE) $(LIB_INSTALL_DIR) - @/usr/bin/install -m 755 $(LIB_ECLONE) $(LIB_INSTALL_DIR) + /usr/bin/install -m 755 checkpoint restart ckptinfo nsexec $(BIN_INSTALL_DIR) + /usr/bin/install -m 755 $(LIB_ECLONE) $(LIB_INSTALL_DIR) $(CKPT_HEADERS): %: ./scripts/extract-headers.sh -s $(KERNELSRC) -o ./include
Signature · 1 line
1.6.3.3
Quoted 6 lines · Matt Helsley
Some minor fixes to the
Makefile:[PATCH 1/4] user-cr: Add install prefix
[PATCH 2/4] user-cr: Make directories during install [PATCH 3/4] user-cr: Fix install rule dependencies
[PATCH 4/4] user-cr: Remove pointless echo lines and @-prefixed lines
ack 1-4
PATCH 1/1 user-cr: Makefile: Use standard variables
In reply to a message not in the archive[Based on the previous series of Makefile patches]
These are standard variables which many cross compiler systems will setup. I believe they are also variables Make sets up with default values. Make also sets $(MAKE) so you don't accidentally mix make binaries in the same build -- let's use that too.
--- Makefile | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
Makefile +3 -3
@@ -34,10 +34,10 @@ LDLIBS = -lm .PHONY: all distclean clean headers install all: $(PROGS) - @make -C test + @$(MAKE) -C test $(LIB_ECLONE): - ar ruv $(LIB_ECLONE) $^ + $(AR) ruv $(LIB_ECLONE) $^ # restart needs to be thread-safe restart: CFLAGS += -D__REENTRANT -pthread
@@ -82,4 +82,4 @@ distclean: clean clean: @rm -f $(PROGS) $(LIB_ECLONE) $(OTHER) *~ *.o headers.h - @make -C test clean + @$(MAKE) -C test clean
Signature · 1 line
1.6.3.3
A message that is not in the archive (sent off-list or not yet received): 92a207e405307fe1dc528f59e08782985830d5e9.1267213393.git.matthltc-r/[email protected]
Oren Laadan
AppliedRe: [PATCH] user-cr: Makefile: Use standard variables
Applied, thanks.
Quoted 35 lines · Matt Helsley
[Based on the previous series of
Makefilepatches]These are standard variables which many cross compiler systems will setup. I believe they are also variables Make sets up with default values. Make also sets $(MAKE) so you don't accidentally mix make binaries in the same build -- let's use that too.
Signed-off-by Matt Helsley <matthltc-r/[email protected]>--- Makefile | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)Makefile +3
-3@@ -34,10 +34,10 @@ LDLIBS = -lm .PHONY: all distclean clean headers install all: $(PROGS) - @make -C test + @$(MAKE) -C test $(LIB_ECLONE): - ar ruv $(LIB_ECLONE) $^ + $(AR) ruv $(LIB_ECLONE) $^ # restart needs to be thread-safe restart: CFLAGS += -D__REENTRANT -pthread@@ -82,4 +82,4 @@ distclean: clean clean: @rm -f $(PROGS) $(LIB_ECLONE) $(OTHER) *~ *.o headers.h - @make -C test clean + @$(MAKE) -C test clean
Oren Laadan
AppliedApplied, thanks.
Quoted 10 lines · Matt Helsley
Some minor fixes to the
Makefile:[PATCH 1/4] user-cr: Add install prefix
[PATCH 2/4] user-cr: Make directories during install [PATCH 3/4] user-cr: Fix install rule dependencies
[PATCH 4/4] user-cr: Remove pointless echo lines and @-prefixed linesCheers,
-Matt Helsley