This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC][PATCH 21/22] Add Makerules to build %.o and %.os from %.i8


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]