This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC][PATCH 21/22] Add Makerules to build %.o and %.os from %.i8
- From: Gary Benson <gbenson at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 20 Oct 2015 15:56:14 +0100
- Subject: [RFC][PATCH 21/22] Add Makerules to build %.o and %.os from %.i8
- Authentication-results: sourceware.org; auth=none
- References: <1445352975-17844-1-git-send-email-gbenson at redhat dot com>
This commit adds make rules to build %.o and %.os files from %.i8
Infinity note source code.
In order to ensure the correct preprocessor and assembler are used
for cross-builds the compilation is done in three stages. The target
preprocessor specified at ./configure time is used to preprocess the
%.i8 source; I8C consumes this preprocessed source and emits assembly
language; and finally the target assembler specified at ./configure
time is used to assemble the generated assembly language into object
code.
I don't *think* the %.o and %.os files should differ (they don't
contain "real" code, just PT_NOTE sections) but please tell me if
I'm wrong and I will add a separate %.S -> %.os rule.
---
Makerules | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/Makerules b/Makerules
index 1329f73..121b2b2 100644
--- a/Makerules
+++ b/Makerules
@@ -1510,6 +1510,22 @@ $(gpl2lgpl): %: $(..)gpl2lgpl.sed /home/gd/gnu/lib/%
mv -f $@-tmp $@
endif
endif
+
+$(objpfx)infinity-%.i8p: infinity-%.i8
+ $(CPP) -x c $(CFLAGS) $(CPPFLAGS) $^ -o $@
+
+$(objpfx)infinity-%.S: $(objpfx)infinity-%.i8p
+ $(I8C) -S -fpreprocessed $^ -o $@
+
+$(objpfx)infinity-%.o: $(objpfx)infinity-%.S
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $^ -o $@
+
+ifeq ($(build-shared),yes)
+$(objpfx)infinity-%.os: $(objpfx)infinity-%.o
+ cp -f $^ $@
+endif
+
+.PRECIOUS: $(addprefix $(objpfx)infinity-%,.i8p .S .o)
# Local Variables:
# mode: makefile
--
1.7.1