diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2007-01-15 12:25:04 +0000 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2007-01-15 12:25:04 +0000 |
commit | f28756a6272f0b6eb04bdce6cb94de196444155b (patch) | |
tree | 6d1bb7c4f869dd941fd8b5e3f45a46dd60237794 /extras/mini-os/Makefile | |
parent | 29bbe50b23bc05c4c0fd8082139b3c2bd81fe335 (diff) | |
download | xen-f28756a6272f0b6eb04bdce6cb94de196444155b.tar.gz xen-f28756a6272f0b6eb04bdce6cb94de196444155b.tar.bz2 xen-f28756a6272f0b6eb04bdce6cb94de196444155b.zip |
[MINIOS] Clean up final link stage of the build.
Allow extra application objects to be linked against a partial link of
minios with non-global names localised. For now we assume that global
names ill be assigned a xenos_ prefix in due course. We may decide to
choose a different prefix.
Those who wish to finish the link from an external Makefile can link
their own objects against mini-os.o (which must be first in link
order!) and specify the appropriate architecture linker script.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'extras/mini-os/Makefile')
-rw-r--r-- | extras/mini-os/Makefile | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile index f042d1a18f..0fa1baccd5 100644 --- a/extras/mini-os/Makefile +++ b/extras/mini-os/Makefile @@ -17,7 +17,13 @@ CFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION) ASFLAGS = -D__ASSEMBLY__ LDLIBS = -L. -lminios -LDFLAGS := -N -T minios-$(TARGET_ARCH).lds +LDFLAGS_FINAL := -N -T minios-$(TARGET_ARCH).lds +LDFLAGS := + +# Prefix for global API names. All other symbols are localised before +# linking with EXTRA_OBJS. +GLOBAL_PREFIX := xenos_ +EXTRA_OBJS = # For possible special source directories. EXTRA_SRC = @@ -110,18 +116,16 @@ endif links: $(ARCH_LINKS) [ -e include/xen ] || ln -sf ../../../xen/include/public include/xen -libminios.a: links $(OBJS) $(HEAD) - $(AR) r libminios.a $(HEAD) $(OBJS) - -$(TARGET): libminios.a $(HEAD) - $(LD) $(LDFLAGS) $(HEAD) $(LDLIBS) -o $@.elf - gzip -f -9 -c $@.elf >$@.gz +$(TARGET): links $(OBJS) $(HEAD) + $(LD) -r $(LDFLAGS) $(HEAD) $(OBJS) -o $@.o + $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o + $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@ + gzip -f -9 -c $@ >$@.gz .PHONY: clean clean: find . -type f -name '*.o' | xargs rm -f - rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz - rm -f libminios.a + rm -f *.o *~ core $(TARGET) $(TARGET).gz find . -type l | xargs rm -f rm -f tags TAGS |