* [PATCH 0/4]: makedumpfile: Makefile improvements
@ 2014-03-03 12:02 Simon Kågström
2014-03-03 12:04 ` [PATCH 1/4] build: Derive objects from source files Simon Kågström
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Simon Kågström @ 2014-03-03 12:02 UTC (permalink / raw)
To: kexec
Hi!
The following patches improve the top Makefile a bit to allow
out-of-tree builds and (at some points) simplify the Makefile a bit.
Regards,
// Simon
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] build: Derive objects from source files
2014-03-03 12:02 [PATCH 0/4]: makedumpfile: Makefile improvements Simon Kågström
@ 2014-03-03 12:04 ` Simon Kågström
2014-03-03 12:04 ` [PATCH 2/4] build: Use INCLUDES for normal CFLAGS in addition to CFLAGS_ARCH Simon Kågström
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Simon Kågström @ 2014-03-03 12:04 UTC (permalink / raw)
To: kexec
Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index f20c118..d660951 100644
--- a/Makefile
+++ b/Makefile
@@ -41,9 +41,9 @@ endif
SRC = makedumpfile.c makedumpfile.h diskdump_mod.h sadump_mod.h sadump_info.h
SRC_PART = print_info.c dwarf_info.c elf_info.c erase_info.c sadump_info.c cache.c
-OBJ_PART = print_info.o dwarf_info.o elf_info.o erase_info.o sadump_info.o cache.o
+OBJ_PART=$(patsubst %.c,%.o,$(SRC_PART))
SRC_ARCH = arch/arm.c arch/x86.c arch/x86_64.c arch/ia64.c arch/ppc64.c arch/s390x.c arch/ppc.c
-OBJ_ARCH = arch/arm.o arch/x86.o arch/x86_64.o arch/ia64.o arch/ppc64.o arch/s390x.o arch/ppc.o
+OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH))
LIBS = -ldw -lbz2 -lebl -ldl -lelf -lz
ifneq ($(LINKTYPE), dynamic)
--
1.7.9.6
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] build: Use INCLUDES for normal CFLAGS in addition to CFLAGS_ARCH
2014-03-03 12:02 [PATCH 0/4]: makedumpfile: Makefile improvements Simon Kågström
2014-03-03 12:04 ` [PATCH 1/4] build: Derive objects from source files Simon Kågström
@ 2014-03-03 12:04 ` Simon Kågström
2014-03-03 12:04 ` [PATCH 3/4] build: Honor VPATH to support out-of-tree builds Simon Kågström
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Simon Kågström @ 2014-03-03 12:04 UTC (permalink / raw)
To: kexec
Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index d660951..57e7e44 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ ifeq ($(strip $CC),)
CC = gcc
endif
-CFLAGS = -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
+CFLAGS = $(INCLUDES) -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
-DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"'
CFLAGS_ARCH = $(INCLUDES) -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
--
1.7.9.6
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] build: Honor VPATH to support out-of-tree builds
2014-03-03 12:02 [PATCH 0/4]: makedumpfile: Makefile improvements Simon Kågström
2014-03-03 12:04 ` [PATCH 1/4] build: Derive objects from source files Simon Kågström
2014-03-03 12:04 ` [PATCH 2/4] build: Use INCLUDES for normal CFLAGS in addition to CFLAGS_ARCH Simon Kågström
@ 2014-03-03 12:04 ` Simon Kågström
2014-03-03 12:05 ` [PATCH 4/4] build: Rename generic-sounding SRC -> SRC_BASE Simon Kågström
2014-03-07 8:08 ` [PATCH 0/4]: makedumpfile: Makefile improvements Atsushi Kumagai
4 siblings, 0 replies; 6+ messages in thread
From: Simon Kågström @ 2014-03-03 12:04 UTC (permalink / raw)
To: kexec
Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
---
Makefile | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 57e7e44..b9121ad 100644
--- a/Makefile
+++ b/Makefile
@@ -63,19 +63,20 @@ endif
all: makedumpfile
$(OBJ_PART): $(SRC_PART)
- $(CC) $(CFLAGS) -c -o ./$@ ./$(@:.o=.c)
+ $(CC) $(CFLAGS) -c -o ./$@ $(VPATH)$(@:.o=.c)
$(OBJ_ARCH): $(SRC_ARCH)
- $(CC) $(CFLAGS_ARCH) -c -o ./$@ ./$(@:.o=.c)
+ @mkdir -p $(@D)
+ $(CC) $(CFLAGS_ARCH) -c -o ./$@ $(VPATH)$(@:.o=.c)
makedumpfile: $(SRC) $(OBJ_PART) $(OBJ_ARCH)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -rdynamic -o $@ $< $(LIBS)
echo .TH MAKEDUMPFILE 8 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.8
- grep -v "^.TH MAKEDUMPFILE 8" $(SRC)/makedumpfile.8 >> temp.8
+ grep -v "^.TH MAKEDUMPFILE 8" $(VPATH)makedumpfile.8 >> temp.8
mv temp.8 makedumpfile.8
gzip -c ./makedumpfile.8 > ./makedumpfile.8.gz
echo .TH MAKEDUMPFILE.CONF 5 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.5
- grep -v "^.TH MAKEDUMPFILE.CONF 5" makedumpfile.conf.5 >> temp.5
+ grep -v "^.TH MAKEDUMPFILE.CONF 5" $(VPATH)makedumpfile.conf.5 >> temp.5
mv temp.5 makedumpfile.conf.5
gzip -c ./makedumpfile.conf.5 > ./makedumpfile.conf.5.gz
@@ -87,7 +88,7 @@ clean:
install:
install -m 755 -d ${DESTDIR}/usr/sbin ${DESTDIR}/usr/share/man/man5 ${DESTDIR}/usr/share/man/man8 ${DESTDIR}/etc
- install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile makedumpfile-R.pl
+ install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile $(VPATH)makedumpfile-R.pl
install -m 644 -t ${DESTDIR}/usr/share/man/man8 makedumpfile.8.gz
install -m 644 -t ${DESTDIR}/usr/share/man/man5 makedumpfile.conf.5.gz
- install -m 644 -D makedumpfile.conf ${DESTDIR}/etc/makedumpfile.conf.sample
+ install -m 644 -D $(VPATH)makedumpfile.conf ${DESTDIR}/etc/makedumpfile.conf.sample
--
1.7.9.6
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] build: Rename generic-sounding SRC -> SRC_BASE
2014-03-03 12:02 [PATCH 0/4]: makedumpfile: Makefile improvements Simon Kågström
` (2 preceding siblings ...)
2014-03-03 12:04 ` [PATCH 3/4] build: Honor VPATH to support out-of-tree builds Simon Kågström
@ 2014-03-03 12:05 ` Simon Kågström
2014-03-07 8:08 ` [PATCH 0/4]: makedumpfile: Makefile improvements Atsushi Kumagai
4 siblings, 0 replies; 6+ messages in thread
From: Simon Kågström @ 2014-03-03 12:05 UTC (permalink / raw)
To: kexec
Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index b9121ad..ccf54e1 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,7 @@ CFLAGS += -m32
CFLAGS_ARCH += -m32
endif
-SRC = makedumpfile.c makedumpfile.h diskdump_mod.h sadump_mod.h sadump_info.h
+SRC_BASE = makedumpfile.c makedumpfile.h diskdump_mod.h sadump_mod.h sadump_info.h
SRC_PART = print_info.c dwarf_info.c elf_info.c erase_info.c sadump_info.c cache.c
OBJ_PART=$(patsubst %.c,%.o,$(SRC_PART))
SRC_ARCH = arch/arm.c arch/x86.c arch/x86_64.c arch/ia64.c arch/ppc64.c arch/s390x.c arch/ppc.c
@@ -69,7 +69,7 @@ $(OBJ_ARCH): $(SRC_ARCH)
@mkdir -p $(@D)
$(CC) $(CFLAGS_ARCH) -c -o ./$@ $(VPATH)$(@:.o=.c)
-makedumpfile: $(SRC) $(OBJ_PART) $(OBJ_ARCH)
+makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -rdynamic -o $@ $< $(LIBS)
echo .TH MAKEDUMPFILE 8 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.8
grep -v "^.TH MAKEDUMPFILE 8" $(VPATH)makedumpfile.8 >> temp.8
--
1.7.9.6
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH 0/4]: makedumpfile: Makefile improvements
2014-03-03 12:02 [PATCH 0/4]: makedumpfile: Makefile improvements Simon Kågström
` (3 preceding siblings ...)
2014-03-03 12:05 ` [PATCH 4/4] build: Rename generic-sounding SRC -> SRC_BASE Simon Kågström
@ 2014-03-07 8:08 ` Atsushi Kumagai
4 siblings, 0 replies; 6+ messages in thread
From: Atsushi Kumagai @ 2014-03-07 8:08 UTC (permalink / raw)
To: simon.kagstrom@netinsight.net; +Cc: kexec@lists.infradead.org
Hello Simon,
>Hi!
>
>The following patches improve the top Makefile a bit to allow
>out-of-tree builds and (at some points) simplify the Makefile a bit.
>
>Regards,
>// Simon
Please write a description for each patch even if it's small,
otherwise I can't know what is the purpose, why it's needed and
other points. These are important to review.
Thanks
Atsushi Kumagai
>_______________________________________________
>kexec mailing list
>kexec@lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-03-07 8:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-03 12:02 [PATCH 0/4]: makedumpfile: Makefile improvements Simon Kågström
2014-03-03 12:04 ` [PATCH 1/4] build: Derive objects from source files Simon Kågström
2014-03-03 12:04 ` [PATCH 2/4] build: Use INCLUDES for normal CFLAGS in addition to CFLAGS_ARCH Simon Kågström
2014-03-03 12:04 ` [PATCH 3/4] build: Honor VPATH to support out-of-tree builds Simon Kågström
2014-03-03 12:05 ` [PATCH 4/4] build: Rename generic-sounding SRC -> SRC_BASE Simon Kågström
2014-03-07 8:08 ` [PATCH 0/4]: makedumpfile: Makefile improvements Atsushi Kumagai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox